本文整理汇总了Java中com.flyco.dialog.entity.DialogMenuItem类的典型用法代码示例。如果您正苦于以下问题:Java DialogMenuItem类的具体用法?Java DialogMenuItem怎么用?Java DialogMenuItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DialogMenuItem类属于com.flyco.dialog.entity包,在下文中一共展示了DialogMenuItem类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: normalListDialogNoTitle
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
private void normalListDialogNoTitle(final String content) {
final ArrayList<DialogMenuItem> testItems = new ArrayList<>();
// testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
// testItems.add(new DialogMenuItem("删除", R.mipmap.ic_winstyle_delete));
testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
final NormalListDialog dialog = new NormalListDialog(TrackwayDetailActivity.this, testItems);
dialog.title("请选择")//
.isTitleShow(false)//
.itemPressColor(Color.parseColor("#85D3EF"))//
.itemTextColor(Color.parseColor("#303030"))//
.itemTextSize(15)//
.cornerRadius(2)//
.widthScale(0.75f)//
.show();
dialog.setOnOperItemClickL(new OnOperItemClickL() {
@Override
public void onOperItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0://复制
copyFromComment(content);
break;
}
dialog.dismiss();
}
});
}
示例2: normalListDialogNoTitle
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
private void normalListDialogNoTitle(final String content) {
final ArrayList<DialogMenuItem> testItems = new ArrayList<>();
// testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
// testItems.add(new DialogMenuItem("删除", R.mipmap.ic_winstyle_delete));
testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
final NormalListDialog dialog = new NormalListDialog(getActivity(), testItems);
dialog.title("请选择")//
.isTitleShow(false)//
.itemPressColor(Color.parseColor("#85D3EF"))//
.itemTextColor(Color.parseColor("#303030"))//
.itemTextSize(15)//
.cornerRadius(2)//
.widthScale(0.75f)//
.show();
dialog.setOnOperItemClickL(new OnOperItemClickL() {
@Override
public void onOperItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0://复制
copyFromComment(content);
break;
}
dialog.dismiss();
}
});
}
示例3: normalListDialogNoTitle
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
private void normalListDialogNoTitle(final String content) {
final ArrayList<DialogMenuItem> testItems = new ArrayList<>();
// testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
// testItems.add(new DialogMenuItem("删除", R.mipmap.ic_winstyle_delete));
testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
final NormalListDialog dialog = new NormalListDialog(CaptionDetailActivity.this, testItems);
dialog.title("请选择")//
.isTitleShow(false)//
.itemPressColor(Color.parseColor("#85D3EF"))//
.itemTextColor(Color.parseColor("#303030"))//
.itemTextSize(15)//
.cornerRadius(2)//
.widthScale(0.75f)//
.show();
dialog.setOnOperItemClickL(new OnOperItemClickL() {
@Override
public void onOperItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0://复制
copyFromComment(content);
break;
}
dialog.dismiss();
}
});
}
示例4: onPopupMenu
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
/**
* 弹出将照片保存到手机按钮
*
* @param bitmap
*/
private void onPopupMenu(final Bitmap bitmap) {
ArrayList<DialogMenuItem> menuItems = new ArrayList<>();
menuItems.add(new DialogMenuItem("保存到手机", R.mipmap.ic_winstyle_download));
final NormalListDialog dialog = new NormalListDialog(mContext, menuItems);
dialog.title("请选择") //
.isTitleShow(false) //
.itemPressColor(Color.parseColor("#CACACA")) //
.itemTextColor(Color.parseColor("#303030")) //
.itemTextSize(15) //
.cornerRadius(2) //
.widthScale(0.75f) //
.show();
dialog.setOnOperItemClickL(new OnOperItemClickL() {
@Override
public void onOperItemClick(AdapterView<?> parent, View view, int position, long id) {
saveImageToExternalStorage(bitmap);
dialog.dismiss();
}
});
}
示例5: normalListDialogNoTitle
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
private void normalListDialogNoTitle(final String content, final String gUid, final String mAuthorAccount, int type, final View v) {
final ArrayList<DialogMenuItem> testItems = new ArrayList<>();
if (type == 1) {
testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
testItems.add(new DialogMenuItem("删除", R.mipmap.ic_winstyle_delete));
} else if (type == 2) {
testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
}
final NormalListDialog dialog = new NormalListDialog(mContext, testItems);
dialog.title("请选择")//
.isTitleShow(false)//
.itemPressColor(Color.parseColor("#85D3EF"))//
.itemTextColor(Color.parseColor("#303030"))//
.itemTextSize(15)//
.cornerRadius(2)//
.widthScale(0.75f)//
.show();
dialog.setOnOperItemClickL(new OnOperItemClickL() {
@Override
public void onOperItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0://复制
copyFromComment(content);
break;
case 1://删除
showDelDialog(gUid, mAuthorAccount, v);
break;
}
dialog.dismiss();
}
});
}
示例6: normalListDialogNoTitle
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
private void normalListDialogNoTitle(final String content, final String gUid, final int type, final int parentPosition, final int childPosition, final int commentType, final int typeDelete) {
final ArrayList<DialogMenuItem> testItems = new ArrayList<>();
// testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
// testItems.add(new DialogMenuItem("删除", R.mipmap.ic_winstyle_delete));
if (type == 1 || type == 0) {
testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
testItems.add(new DialogMenuItem("删除", R.mipmap.ic_winstyle_delete));
} else if (type == 2) {
testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
}
final NormalListDialog dialog = new NormalListDialog(mContext, testItems);
dialog.title("请选择")//
.isTitleShow(false)//
.itemPressColor(Color.parseColor("#85D3EF"))//
.itemTextColor(Color.parseColor("#303030"))//
.itemTextSize(15)//
.cornerRadius(2)//
.widthScale(0.75f)//
.show();
dialog.setOnOperItemClickL(new OnOperItemClickL() {
@Override
public void onOperItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0://复制
copyFromComment(content);
break;
case 1://删除
showDelDialog(gUid, parentPosition, childPosition, commentType, typeDelete);
break;
}
dialog.dismiss();
}
});
}
示例7: normalListDialogNoTitle
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
private void normalListDialogNoTitle(final String content, final String gUid, final int type, final int parentPosition, final int childPosition, final int commentType) {
final ArrayList<DialogMenuItem> testItems = new ArrayList<>();
// testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
// testItems.add(new DialogMenuItem("删除", R.mipmap.ic_winstyle_delete));
if (type == 1 || type == 0) {
testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
testItems.add(new DialogMenuItem("删除", R.mipmap.ic_winstyle_delete));
} else if (type == 2) {
testItems.add(new DialogMenuItem("复制", R.mipmap.ic_winstyle_copy));
}
final NormalListDialog dialog = new NormalListDialog(mContext, testItems);
dialog.title("请选择")//
.isTitleShow(false)//
.itemPressColor(Color.parseColor("#85D3EF"))//
.itemTextColor(Color.parseColor("#303030"))//
.itemTextSize(15)//
.cornerRadius(2)//
.widthScale(0.75f)//
.show();
dialog.setOnOperItemClickL(new OnOperItemClickL() {
@Override
public void onOperItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0://复制
copyFromComment(content);
break;
case 1://删除
showDelDialog(gUid, parentPosition, childPosition, commentType);
break;
}
dialog.dismiss();
}
});
}
示例8: ActionSheetDialog
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
public ActionSheetDialog(Context context, String[] items, View animateView) {
super(context, animateView);
mContents = new ArrayList<>();
for (String item : items) {
DialogMenuItem customBaseItem = new DialogMenuItem(item, 0);
mContents.add(customBaseItem);
}
init();
}
示例9: getView
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final DialogMenuItem item = mContents.get(position);
LinearLayout llItem = new LinearLayout(mContext);
llItem.setOrientation(LinearLayout.HORIZONTAL);
llItem.setGravity(Gravity.CENTER_VERTICAL);
ImageView ivItem = new ImageView(mContext);
ivItem.setPadding(0, 0, dp2px(15), 0);
llItem.addView(ivItem);
TextView tvItem = new TextView(mContext);
tvItem.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
tvItem.setSingleLine(true);
tvItem.setGravity(Gravity.CENTER);
tvItem.setTextColor(mItemTextColor);
tvItem.setTextSize(TypedValue.COMPLEX_UNIT_SP, mItemTextSize);
tvItem.setHeight(dp2px(mItemHeight));
llItem.addView(tvItem);
float radius = dp2px(mCornerRadius);
if (mIsTitleShow) {
llItem.setBackgroundDrawable((CornerUtils.listItemSelector(radius, Color.TRANSPARENT, mItemPressColor,
position == mContents.size() - 1)));
} else {
llItem.setBackgroundDrawable(CornerUtils.listItemSelector(radius, Color.TRANSPARENT, mItemPressColor,
mContents.size(), position));
}
ivItem.setImageResource(item.mResId);
tvItem.setText(item.mOperName);
ivItem.setVisibility(item.mResId == 0 ? View.GONE : View.VISIBLE);
return llItem;
}
示例10: NormalListDialog
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
public NormalListDialog(Context context, String[] items) {
super(context);
mContents = new ArrayList<>();
for (String item : items) {
DialogMenuItem customBaseItem = new DialogMenuItem(item, 0);
mContents.add(customBaseItem);
}
init();
}
示例11: TestAdapter
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
public TestAdapter(Context context, ArrayList<DialogMenuItem> customBaseItems) {
this.mContext = context;
this.mMenuItems = customBaseItems;
mDisplayMetrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(mDisplayMetrics);
}
示例12: getView
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final DialogMenuItem item = mMenuItems.get(position);
LinearLayout ll_item = new LinearLayout(mContext);
ll_item.setOrientation(LinearLayout.HORIZONTAL);
ll_item.setGravity(Gravity.CENTER_VERTICAL);
ImageView iv_item = new ImageView(mContext);
iv_item.setPadding(0, 0, (int) (15 * mDisplayMetrics.density), 0);
ll_item.addView(iv_item);
TextView tv_item = new TextView(mContext);
tv_item.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
tv_item.setSingleLine(true);
tv_item.setTextColor(Color.parseColor("#303030"));
tv_item.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
ll_item.addView(tv_item);
ll_item.setPadding(item.mResId == 0 ? (int) (18 * mDisplayMetrics.density) : (int) (16 * mDisplayMetrics.density), (int) (10 * mDisplayMetrics.density), 0,
(int) (10 * mDisplayMetrics.density));
iv_item.setImageResource(item.mResId);
tv_item.setText(item.mOperName);
iv_item.setVisibility(item.mResId == 0 ? View.GONE : View.VISIBLE);
return ll_item;
}
示例13: onCreate
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ac_dialog_home);
ButterKnife.bind(this);
mMenuItems.add(new DialogMenuItem("收藏", R.mipmap.ic_winstyle_favor));
mMenuItems.add(new DialogMenuItem("下载", R.mipmap.ic_winstyle_download));
mMenuItems.add(new DialogMenuItem("分享", R.mipmap.ic_winstyle_share));
mMenuItems.add(new DialogMenuItem("删除", R.mipmap.ic_winstyle_delete));
mMenuItems.add(new DialogMenuItem("歌手", R.mipmap.ic_winstyle_artist));
mMenuItems.add(new DialogMenuItem("专辑", R.mipmap.ic_winstyle_album));
mBasIn = new BounceTopEnter();
mBasOut = new SlideBottomExit();
View decorView = getWindow().getDecorView();
HomeAdapter adapter = new HomeAdapter(mContext);
mElv.setAdapter(adapter);
// extend all group
for (int i = 0; i < mGroups.length; i++) {
mElv.expandGroup(i);
}
mElv.setOnChildClickListener(this);
mElv.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
return true;
}
});
}
示例14: getView
import com.flyco.dialog.entity.DialogMenuItem; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final DialogMenuItem item = mContents.get(position);
LinearLayout llItem = new LinearLayout(mContext);
llItem.setOrientation(LinearLayout.HORIZONTAL);
llItem.setGravity(Gravity.CENTER_VERTICAL);
ImageView ivItem = new ImageView(mContext);
ivItem.setPadding(0, 0, dp2px(15), 0);
llItem.addView(ivItem);
TextView tvItem = new TextView(mContext);
tvItem.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
tvItem.setSingleLine(true);
tvItem.setTextColor(mItemTextColor);
tvItem.setTextSize(TypedValue.COMPLEX_UNIT_SP, mItemTextSize);
llItem.addView(tvItem);
float radius = dp2px(mCornerRadius);
if (mIsTitleShow) {
llItem.setBackgroundDrawable((CornerUtils.listItemSelector(radius, Color.TRANSPARENT, mItemPressColor,
position == mContents.size() - 1)));
} else {
llItem.setBackgroundDrawable(CornerUtils.listItemSelector(radius, Color.TRANSPARENT, mItemPressColor,
mContents.size(), position));
}
int left = item.mResId == 0 ? dp2px(18) : dp2px(16);
int top = dp2px(10);
int right = 0;
int bottom = dp2px(10);
llItem.setPadding(left + mItemExtraLeft, top + mItemExtraTop, right + mItemExtraRight, bottom + mItemExtraBottom);
ivItem.setImageResource(item.mResId);
tvItem.setText(item.mOperName);
ivItem.setVisibility(item.mResId == 0 ? View.GONE : View.VISIBLE);
return llItem;
}