TipPopup - OneUIProject/OneUI-Design-Library GitHub Wiki
de.dlyt.yanndroid.oneui.view.TipPopup
Create new instance:
new TipPopup(view);
new TipPopup(view, mode);
view
is the view where the popup shows, mode
can be TipPopup.MODE_NORMAL or TipPopup.MODE_TRANSLUCENT
Methods
Show/Dismiss the popup, direction = DIRECTION_TOP_LEFT, DIRECTION_TOP_RIGHT, DIRECTION_BOTTOM_LEFT, DIRECTION_BOTTOM_RIGHT.
public void show(int direction)
public boolean isShowing()
public void dismiss(boolean withAnimation)
Set popup text.
public void setMessage(CharSequence message)
Set popup button text and listener.
public void setAction(CharSequence actionText, View.OnClickListener listener)
Decide if you want to call the parent view onclick when touching the popup.
public void semCallParentViewsOnClick(boolean needToCall)
Sets default status to expanded when popup is shown (must be called before show).
public void setExpanded(boolean expanded)
Custom popup position.
public void setTargetPosition(int x, int y)
Sets content description for the "?" icon.
public void setHintDescription(CharSequence hintDescription)
Update the popup when the instance is already created/it is already shown.
public void update()
public void update(int direction, boolean resetHintTimer)
Color methods
public void setMessageTextColor(int color)
public void setActionTextColor(int color)
public void setBackgroundColor(int color)
public void setBackgroundColorWithAlpha(int color)
Sets the "?" color
public void setBorderColor(int color)
Allows the popup window to extend beyond the bounds of the screen
setPopupWindowClippingEnabled(boolean enabled)
Adds a listener that gets called when the popup changes state (dimissed, hint, expanded)
setOnStateChangeListener(OnStateChangeListener changeListener)
Adds a listener that gets called when the popup is dismissed
setOnDismissListener(OnDismissListener onDismissListener)