use of com.yydcdut.sdlv.Menu in project PhotoNoter by yydcdut.
the class EditCategoryActivity method initListView.
private void initListView() {
Menu menu = new Menu(true, true);
menu.addItem(new MenuItem.Builder().setWidth((int) getResources().getDimension(R.dimen.slv_item_bg_width) * 3 / 2).setBackground(new ColorDrawable(getResources().getColor(R.color.red_colorPrimary))).setText(getResources().getString(R.string.delete)).setTextColor(Color.WHITE).setTextSize((int) getResources().getDimension(R.dimen.txt_small) / 2).build());
menu.addItem(new MenuItem.Builder().setWidth((int) getResources().getDimension(R.dimen.slv_item_bg_width) * 3 / 2).setBackground(new ColorDrawable(getResources().getColor(R.color.fab_blue))).setText(getResources().getString(R.string.rename)).setDirection(MenuItem.DIRECTION_RIGHT).setTextColor(Color.WHITE).setTextSize((int) getResources().getDimension(R.dimen.txt_small) / 2).build());
mListView.setMenu(menu);
mListView.setAdapter(mCategoryAdapter);
mListView.setOnSlideListener(this);
mListView.setOnMenuItemClickListener(this);
mListView.setOnItemDeleteListener(this);
}
Aggregations