Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kakajika/RelativePopupWindow
Android PopupWindow that can be easily located relative to anchor View.
https://github.com/kakajika/RelativePopupWindow
Last synced: about 1 month ago
JSON representation
Android PopupWindow that can be easily located relative to anchor View.
- Host: GitHub
- URL: https://github.com/kakajika/RelativePopupWindow
- Owner: kakajika
- License: mit
- Created: 2016-07-08T16:37:32.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-06T08:07:08.000Z (over 5 years ago)
- Last Synced: 2024-08-03T01:25:45.817Z (4 months ago)
- Language: Java
- Homepage:
- Size: 2.5 MB
- Stars: 810
- Watchers: 14
- Forks: 123
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-android-ui - RelativePopupWindow - 轻松对锚视图相对定位 (浮动菜单)
README
# RelativePopupWindow
[![wercker status](https://app.wercker.com/status/dd38c76d499fee2384c2cdcba37223ba/s/master)](https://app.wercker.com/project/byKey/dd38c76d499fee2384c2cdcba37223ba)
[![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html)
[![API](https://img.shields.io/badge/API-9%2B-yellow.svg?style=flat)](https://android-arsenal.com/api?level=9)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-RelativePopupWindow-green.svg?style=true)](https://android-arsenal.com/details/1/3908)
[ ![Download](https://api.bintray.com/packages/kakajika/maven/relativepopupwindow/images/download.svg) ](https://bintray.com/kakajika/maven/relativepopupwindow/_latestVersion)Android PopupWindow that can be easily located relative to anchor View.
![Art](art/art1.gif)
## How To Use
Extend [RelativePopupWindow](relativepopupwindow/src/main/java/com/labo/kaji/relativepopupwindow/RelativePopupWindow.java) class and call showOnAnchor().
```java
popup.showOnAnchor(anchor, VerticalPosition.ABOVE, HorizontalPosition.CENTER);
```See detail example in [ExampleCardPopup.kt](example/src/main/kotlin/com/labo/kaji/relativepopupwindow/example/ExampleCardPopup.kt)
or in Java, [ExampleCardPopup.java](example/src/main/java/com/labo/kaji/relativepopupwindow/example/java/ExampleCardPopup.java).## Position Parameters
### VerticalPosition
- ABOVE
- ALIGN_BOTTOM
- CENTER
- ALIGN_TOP
- BELOW### HorizontalPosition
- LEFT
- ALIGN_RIGHT
- CENTER
- ALIGN_LEFT
- RIGHT### Fit In Screen
If you want Popup not to fit in screen automatically, add parameter to disable it.
```java
popup.showOnAnchor(anchor, VerticalPosition.ABOVE, HorizontalPosition.CENTER, false);
```## Install
This library is available in jcenter.
- for AndroidX:
```groovy
implementation 'com.labo.kaji:relativepopupwindow:0.4.1'
```- for legacy Support Library:
```groovy
implementation 'com.labo.kaji:relativepopupwindow:0.3.1'
```## License
MIT License.