use of com.vondear.rxtools.view.popupwindows.RxPopupSingleView in project RxTools by vondear.
the class ActivityPopupView method initPopupView.
private void initPopupView() {
titlePopup = new RxPopupSingleView(mContext, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, R.layout.popupwindow_definition_layout);
titlePopup.addAction(new ActionItem("标清"));
titlePopup.addAction(new ActionItem("高清"));
titlePopup.addAction(new ActionItem("超清"));
titlePopup.setItemOnClickListener(new RxPopupSingleView.OnItemOnClickListener() {
@Override
public void onItemClick(ActionItem item, int position) {
// TODO Auto-generated method stub
if (titlePopup.getAction(position).mTitle.equals(mTvDefinition.getText())) {
RxToast.showToast(mContext, "当前已经为" + mTvDefinition.getText(), 500);
} else {
if (position >= 0 && position < 3) {
mTvDefinition.setText(titlePopup.getAction(position).mTitle);
}
}
}
});
}
Aggregations