public class PopupList
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static interface |
PopupList.AdapterPopupListListener |
static interface |
PopupList.PopupListListener |
限定符和类型 | 字段和说明 |
---|---|
static int |
DEFAULT_BACKGROUND_RADIUS_DP |
static int |
DEFAULT_DIVIDER_COLOR |
static float |
DEFAULT_DIVIDER_HEIGHT_DP |
static float |
DEFAULT_DIVIDER_WIDTH_DP |
static int |
DEFAULT_NORMAL_BACKGROUND_COLOR |
static int |
DEFAULT_NORMAL_TEXT_COLOR |
static int |
DEFAULT_PRESSED_BACKGROUND_COLOR |
static int |
DEFAULT_PRESSED_TEXT_COLOR |
static float |
DEFAULT_TEXT_PADDING_BOTTOM_DP |
static float |
DEFAULT_TEXT_PADDING_LEFT_DP |
static float |
DEFAULT_TEXT_PADDING_RIGHT_DP |
static float |
DEFAULT_TEXT_PADDING_TOP_DP |
static float |
DEFAULT_TEXT_SIZE_DP |
构造器和说明 |
---|
PopupList(android.content.Context context) |
限定符和类型 | 方法和说明 |
---|---|
int |
dp2px(float value) |
int |
getBackgroundCornerRadius() |
android.view.View |
getDefaultIndicatorView(android.content.Context context) |
int |
getDividerColor() |
int |
getDividerHeight() |
int |
getDividerWidth() |
android.view.View |
getIndicatorView() |
int |
getNormalBackgroundColor() |
int |
getNormalTextColor() |
int |
getPressedBackgroundColor() |
int |
getPressedTextColor() |
android.content.res.Resources |
getResources() |
int |
getTextPaddingBottom() |
int |
getTextPaddingLeft() |
int |
getTextPaddingRight() |
int |
getTextPaddingTop() |
float |
getTextSize() |
android.view.View |
getTriangleIndicatorView(android.content.Context context,
float widthPixel,
float heightPixel,
int color) |
void |
hidePopupListWindow() |
void |
setBackgroundCornerRadius(int backgroundCornerRadiusPixel) |
void |
setDividerColor(int dividerColor) |
void |
setDividerHeight(int dividerHeightPixel) |
void |
setDividerWidth(int dividerWidthPixel) |
void |
setIndicatorSize(int widthPixel,
int heightPixel) |
void |
setIndicatorView(android.view.View indicatorView) |
void |
setNormalBackgroundColor(int normalBackgroundColor) |
void |
setNormalTextColor(int normalTextColor) |
void |
setPressedBackgroundColor(int pressedBackgroundColor) |
void |
setPressedTextColor(int pressedTextColor) |
void |
setTextPadding(int left,
int top,
int right,
int bottom) |
void |
setTextPaddingBottom(int textPaddingBottom) |
void |
setTextPaddingLeft(int textPaddingLeft) |
void |
setTextPaddingRight(int textPaddingRight) |
void |
setTextPaddingTop(int textPaddingTop) |
void |
setTextSize(float textSizePixel) |
void |
show(android.view.View anchorView,
java.util.List<java.lang.String> popupItemList,
PopupList.PopupListListener popupListListener)
Popup a window when anchorView is clicked and held.
|
void |
showPopupListWindow(android.view.View anchorView,
int contextPosition,
float rawX,
float rawY,
java.util.List<java.lang.String> popupItemList,
PopupList.PopupListListener popupListListener)
show a popup window in a bubble style.
|
int |
sp2px(float value) |
public static final int DEFAULT_NORMAL_TEXT_COLOR
public static final int DEFAULT_PRESSED_TEXT_COLOR
public static final float DEFAULT_TEXT_SIZE_DP
public static final float DEFAULT_TEXT_PADDING_LEFT_DP
public static final float DEFAULT_TEXT_PADDING_TOP_DP
public static final float DEFAULT_TEXT_PADDING_RIGHT_DP
public static final float DEFAULT_TEXT_PADDING_BOTTOM_DP
public static final int DEFAULT_NORMAL_BACKGROUND_COLOR
public static final int DEFAULT_PRESSED_BACKGROUND_COLOR
public static final int DEFAULT_BACKGROUND_RADIUS_DP
public static final int DEFAULT_DIVIDER_COLOR
public static final float DEFAULT_DIVIDER_WIDTH_DP
public static final float DEFAULT_DIVIDER_HEIGHT_DP
public void show(android.view.View anchorView, java.util.List<java.lang.String> popupItemList, PopupList.PopupListListener popupListListener)
View.setOnTouchListener(View.OnTouchListener)
and
View.setOnLongClickListener(View.OnLongClickListener)
(or
AdapterView.setOnItemLongClickListener(AdapterView.OnItemLongClickListener)
if anchorView is a instance of AbsListView), so you can only use
showPopupListWindow(View, int, float, float, List, PopupListListener)
if you called those method before.anchorView
- the view on which to pin the popup windowpopupItemList
- the list of the popup menupopupListListener
- the Listenerpublic void showPopupListWindow(android.view.View anchorView, int contextPosition, float rawX, float rawY, java.util.List<java.lang.String> popupItemList, PopupList.PopupListListener popupListListener)
anchorView
- the view on which to pin the popup windowcontextPosition
- context positionrawX
- the original raw X coordinaterawY
- the original raw Y coordinatepopupItemList
- the list of the popup menupopupListListener
- the Listenerpublic void hidePopupListWindow()
public android.view.View getIndicatorView()
public void setIndicatorView(android.view.View indicatorView)
public android.view.View getDefaultIndicatorView(android.content.Context context)
public android.view.View getTriangleIndicatorView(android.content.Context context, float widthPixel, float heightPixel, int color)
public void setIndicatorSize(int widthPixel, int heightPixel)
public int getNormalTextColor()
public void setNormalTextColor(int normalTextColor)
public int getPressedTextColor()
public void setPressedTextColor(int pressedTextColor)
public float getTextSize()
public void setTextSize(float textSizePixel)
public int getTextPaddingLeft()
public void setTextPaddingLeft(int textPaddingLeft)
public int getTextPaddingTop()
public void setTextPaddingTop(int textPaddingTop)
public int getTextPaddingRight()
public void setTextPaddingRight(int textPaddingRight)
public int getTextPaddingBottom()
public void setTextPaddingBottom(int textPaddingBottom)
public void setTextPadding(int left, int top, int right, int bottom)
left
- the left padding in pixelstop
- the top padding in pixelsright
- the right padding in pixelsbottom
- the bottom padding in pixelspublic int getNormalBackgroundColor()
public void setNormalBackgroundColor(int normalBackgroundColor)
public int getPressedBackgroundColor()
public void setPressedBackgroundColor(int pressedBackgroundColor)
public int getBackgroundCornerRadius()
public void setBackgroundCornerRadius(int backgroundCornerRadiusPixel)
public int getDividerColor()
public void setDividerColor(int dividerColor)
public int getDividerWidth()
public void setDividerWidth(int dividerWidthPixel)
public int getDividerHeight()
public void setDividerHeight(int dividerHeightPixel)
public android.content.res.Resources getResources()
public int dp2px(float value)
public int sp2px(float value)