Search in sources :

Example 1 with Menu

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);
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) MenuItem(com.yydcdut.sdlv.MenuItem) Menu(com.yydcdut.sdlv.Menu)

Aggregations

ColorDrawable (android.graphics.drawable.ColorDrawable)1 Menu (com.yydcdut.sdlv.Menu)1 MenuItem (com.yydcdut.sdlv.MenuItem)1