https://github.com/kakajika/RelativePopupWindow
Android PopupWindow that can be easily located relative to anchor View.
https://github.com/kakajika/RelativePopupWindow
Last synced: about 6 hours 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 (almost 9 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 (9 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
[](https://app.wercker.com/project/byKey/dd38c76d499fee2384c2cdcba37223ba)
[](http://developer.android.com/index.html)![]()
[](https://android-arsenal.com/api?level=9)
[](https://android-arsenal.com/details/1/3908)
[  ](https://bintray.com/kakajika/maven/relativepopupwindow/_latestVersion)Android PopupWindow that can be easily located relative to anchor View.

## 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.