RelativePopupWindow

General

Category
Free
Tag
Windows
License
MIT License
Min SDK
7 (Android 2.1 Eclair)
Registered
Jul 14, 2016
Favorites
8
Link
https://github.com/kakajika/RelativePopupWindow
See also
FreeView
BalloonPerformer

Additional

Language
Java
Version
N/A
Created
Jul 8, 2016
Updated
Sep 6, 2019 (Retired)
Owner
Keita Kajiwara (kakajika)
Contributors
Keita Kajiwara (kakajika)
Chintan Rathod (ChintanRathod)
2
Activity
Badge
Generate
Download
Source code

RelativePopupWindow

Android PopupWindow that can be easily located relative to anchor View.

How To Use

Extend RelativePopupWindow class and call showOnAnchor().

popup.showOnAnchor(anchor, VerticalPosition.ABOVE, HorizontalPosition.CENTER);

See detail example in ExampleCardPopup.kt or in 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.

popup.showOnAnchor(anchor, VerticalPosition.ABOVE, HorizontalPosition.CENTER, false);

Install

This library is available in jcenter.

  • for AndroidX:
implementation 'com.labo.kaji:relativepopupwindow:0.4.1'
  • for legacy Support Library:
implementation 'com.labo.kaji:relativepopupwindow:0.3.1'

License

MIT License.