Search in sources :

Example 6 with DividerSpaceItem

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

the class AreYouSureBottomSheetDialogFragment method createMenuItems.

@Override
public void createMenuItems(Bundle savedInstanceState) {
    items.add(new BottomSheetItemWithDescription.Builder().setDescription(getString(R.string.unsaved_changes_will_be_lost)).setTitle(getString(R.string.are_you_sure)).setLayoutId(R.layout.bottom_sheet_item_list_title_with_descr).create());
    int spaceHeight = getResources().getDimensionPixelSize(R.dimen.bottom_sheet_exit_button_margin);
    items.add(new DividerSpaceItem(getContext(), spaceHeight));
}
Also used : DividerSpaceItem(net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem) BottomSheetItemWithDescription(net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription)

Example 7 with DividerSpaceItem

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

the class DismissRouteBottomSheetFragment method createMenuItems.

@Override
public void createMenuItems(Bundle savedInstanceState) {
    BaseBottomSheetItem descriptionItem = new BottomSheetItemWithDescription.Builder().setDescription(getString(R.string.stop_routing_confirm)).setTitle(getString(R.string.cancel_route)).setLayoutId(R.layout.bottom_sheet_item_list_title_with_descr).create();
    items.add(descriptionItem);
    int padding = getResources().getDimensionPixelSize(R.dimen.content_padding_small);
    items.add(new DividerSpaceItem(requireContext(), padding));
}
Also used : BaseBottomSheetItem(net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem) DividerSpaceItem(net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem)

Example 8 with DividerSpaceItem

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

the class BugBottomSheetDialog method createMenuItems.

@Override
public void createMenuItems(Bundle savedInstanceState) {
    OsmandApplication app = getMyApplication();
    if (app == null) {
        return;
    }
    items.add(new TitleItem(getString(titleTextId)));
    View osmNoteView = View.inflate(UiUtilities.getThemedContext(app, nightMode), R.layout.open_osm_note_text, null);
    osmNoteView.getViewTreeObserver().addOnGlobalLayoutListener(getShadowLayoutListener());
    TextInputLayout textBox = osmNoteView.findViewById(R.id.name_text_box);
    textBox.setHint(AndroidUtils.addColon(app, R.string.osn_bug_name));
    ColorStateList colorStateList = ColorStateList.valueOf(ColorUtilities.getSecondaryTextColor(app, nightMode));
    textBox.setDefaultHintTextColor(colorStateList);
    noteText = osmNoteView.findViewById(R.id.name_edit_text);
    noteText.setText(text);
    if (noteText.requestFocus()) {
        AndroidUtils.showSoftKeyboard(getActivity(), noteText);
    }
    BaseBottomSheetItem editOsmNote = new BaseBottomSheetItem.Builder().setCustomView(osmNoteView).create();
    items.add(editOsmNote);
    items.add(new DividerSpaceItem(app, app.getResources().getDimensionPixelSize(R.dimen.content_padding_small)));
}
Also used : BaseBottomSheetItem(net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem) OsmandApplication(net.osmand.plus.OsmandApplication) ColorStateList(android.content.res.ColorStateList) TitleItem(net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem) DividerSpaceItem(net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem) TextInputLayout(com.google.android.material.textfield.TextInputLayout) View(android.view.View)

Example 9 with DividerSpaceItem

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

the class OptionsCard method updateContent.

@Override
public void updateContent() {
    ViewGroup itemsContainer = (ViewGroup) view;
    itemsContainer.removeAllViews();
    items.clear();
    boolean fileAvailable = gpxFile.path != null && !gpxFile.showCurrentTrack;
    if (!FileUtils.isTempFile(app, gpxFile.path)) {
        items.add(createShowOnMapItem());
        items.add(createAppearanceItem());
        if (fileAvailable) {
            items.add(createDirectionsItem());
        }
        items.add(createDividerItem());
    }
    if (gpxFile.getGeneralTrack() != null) {
        items.add(createJoinGapsItem());
    }
    items.add(createAnalyzeOnMapItem());
    items.add(createAnalyzeByIntervalsItem());
    items.add(createDividerItem());
    items.add(createShareItem());
    if (fileAvailable) {
        BaseBottomSheetItem uploadOsmItem = createUploadOsmItem();
        if (uploadOsmItem != null) {
            items.add(uploadOsmItem);
        }
        items.add(createDividerItem());
        if (!FileUtils.isTempFile(app, gpxFile.path)) {
            items.add(createEditItem());
        }
        items.add(createRenameItem());
        items.add(createChangeFolderItem());
        boolean plainTrack = gpxFile.hasTrkPt() && !gpxFile.hasRoute() && !gpxFile.hasRtePt();
        if (plainTrack) {
            items.add(createGpsFilterItem());
        }
        items.add(createDividerItem());
        items.add(createDeleteItem());
    }
    items.add(new DividerSpaceItem(mapActivity, AndroidUtils.dpToPx(app, 6)));
    inflateItems();
}
Also used : BaseBottomSheetItem(net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem) ViewGroup(android.view.ViewGroup) DividerSpaceItem(net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem)

Example 10 with DividerSpaceItem

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

the class UploadPhotoProgressBottomSheet method createMenuItems.

@SuppressLint("InflateParams")
@Override
public void createMenuItems(Bundle savedInstanceState) {
    Context context = requireContext();
    LayoutInflater inflater = UiUtilities.getInflater(context, nightMode);
    View view = inflater.inflate(R.layout.bottom_sheet_with_progress_bar, null);
    uploadedPhotosTitle = view.findViewById(R.id.title);
    uploadedPhotosCounter = view.findViewById(R.id.description);
    progressBar = view.findViewById(R.id.progress_bar);
    progressBar.setMax(maxProgress);
    int descriptionId = uploadingFinished ? R.string.uploaded_count : R.string.uploading_count;
    BaseBottomSheetItem descriptionItem = new BottomSheetItemWithDescription.Builder().setDescription(getString(descriptionId, progress, maxProgress)).setTitle(getString(uploadingFinished ? R.string.upload_photo_completed : R.string.upload_photo)).setCustomView(view).create();
    items.add(descriptionItem);
    updateProgress(progress);
    int padding = getResources().getDimensionPixelSize(R.dimen.content_padding_small);
    items.add(new DividerSpaceItem(context, padding));
}
Also used : Context(android.content.Context) BaseBottomSheetItem(net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem) LayoutInflater(android.view.LayoutInflater) DividerSpaceItem(net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem) TextView(android.widget.TextView) View(android.view.View) SuppressLint(android.annotation.SuppressLint) SuppressLint(android.annotation.SuppressLint)

Aggregations

DividerSpaceItem (net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem)25 BaseBottomSheetItem (net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem)14 View (android.view.View)12 Context (android.content.Context)8 TitleItem (net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem)8 LayoutInflater (android.view.LayoutInflater)7 TextView (android.widget.TextView)5 BottomSheetItemWithCompoundButton (net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton)5 SimpleBottomSheetItem (net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem)4 ColorStateList (android.content.res.ColorStateList)3 Fragment (androidx.fragment.app.Fragment)3 BottomSheetItemWithDescription (net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription)3 ShortDescriptionItem (net.osmand.plus.base.bottomsheetmenu.simpleitems.ShortDescriptionItem)3 SuppressLint (android.annotation.SuppressLint)2 Bundle (android.os.Bundle)2 Editable (android.text.Editable)2 SpannableString (android.text.SpannableString)2 TextWatcher (android.text.TextWatcher)2 LinearLayout (android.widget.LinearLayout)2 Slider (com.google.android.material.slider.Slider)2