Search in sources :

Example 1 with TitleDividerItem

use of net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleDividerItem in project Osmand by osmandapp.

the class SelectedPointBottomSheetDialogFragment method createMenuItems.

@Override
public void createMenuItems(Bundle savedInstanceState) {
    BaseBottomSheetItem titleItem = new BottomSheetItemWithDescription.Builder().setDescription(getDescription()).setIcon(getActiveIcon(R.drawable.ic_action_measure_point)).setTitle(getTitle()).setLayoutId(R.layout.bottom_sheet_item_with_descr_56dp).create();
    items.add(titleItem);
    items.add(new TitleDividerItem(getContext()));
    BaseBottomSheetItem moveItem = new SimpleBottomSheetItem.Builder().setIcon(getContentIcon(R.drawable.ic_action_move_point)).setTitle(getString(R.string.shared_string_move)).setLayoutId(R.layout.bottom_sheet_item_simple).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (listener != null) {
                listener.moveOnClick();
            }
            dismiss();
        }
    }).create();
    items.add(moveItem);
    BaseBottomSheetItem deleteItem = new SimpleBottomSheetItem.Builder().setIcon(getContentIcon(R.drawable.ic_action_remove_dark)).setTitle(getString(R.string.shared_string_delete)).setLayoutId(R.layout.bottom_sheet_item_simple).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (listener != null) {
                listener.deleteOnClick();
            }
            dismiss();
        }
    }).create();
    items.add(deleteItem);
    items.add(new DividerHalfItem(getContext()));
    BaseBottomSheetItem addAfterItem = new SimpleBottomSheetItem.Builder().setIcon(getContentIcon(R.drawable.ic_action_addpoint_above)).setTitle(getString(R.string.add_point_after)).setLayoutId(R.layout.bottom_sheet_item_simple).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (listener != null) {
                listener.addPointAfterOnClick();
            }
            dismiss();
        }
    }).create();
    items.add(addAfterItem);
    BaseBottomSheetItem addBeforeItem = new SimpleBottomSheetItem.Builder().setIcon(getContentIcon(R.drawable.ic_action_addpoint_below)).setTitle(getString(R.string.add_point_before)).setLayoutId(R.layout.bottom_sheet_item_simple).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (listener != null) {
                listener.addPointBeforeOnClick();
            }
            dismiss();
        }
    }).create();
    items.add(addBeforeItem);
}
Also used : BaseBottomSheetItem(net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem) SimpleBottomSheetItem(net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem) DividerHalfItem(net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerHalfItem) TitleDividerItem(net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleDividerItem) View(android.view.View) BottomSheetItemWithDescription(net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription)

Aggregations

View (android.view.View)1 BaseBottomSheetItem (net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem)1 BottomSheetItemWithDescription (net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription)1 SimpleBottomSheetItem (net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem)1 DividerHalfItem (net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerHalfItem)1 TitleDividerItem (net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleDividerItem)1