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));
}
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));
}
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)));
}
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();
}
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));
}
Aggregations