Fix exit without saving UI

This commit is contained in:
Dima-1 2020-08-17 16:51:51 +03:00
parent 6ce4c12842
commit 2d37a05c7a
5 changed files with 53 additions and 8 deletions

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:minHeight="@dimen/bottom_sheet_selected_item_title_height"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingTop="@dimen/measurement_tool_menu_title_padding_top"
android:orientation="vertical"
android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:paddingBottom="@dimen/measurement_tool_menu_title_padding_bottom"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="Some title" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:letterSpacing="@dimen/description_letter_spacing"
android:lineSpacingMultiplier="@dimen/bottom_sheet_text_spacing_multiplier"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_regular"
tools:text="Some description" />
</LinearLayout>

View file

@ -14,8 +14,8 @@
android:paddingLeft="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingTop="@dimen/multi_selection_menu_padding_top"
android:paddingBottom="@dimen/bottom_sheet_title_padding_bottom"
android:paddingTop="@dimen/measurement_tool_menu_title_padding_top"
android:paddingBottom="@dimen/measurement_tool_menu_title_padding_bottom"
android:text="@string/plan_route_open_existing_track"
android:textAppearance="@style/TextAppearance.ListItemTitle"
osmand:typeface="@string/font_roboto_medium" />

View file

@ -20,8 +20,10 @@
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/choose_navigation_title"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_title_height"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="@dimen/measurement_tool_menu_title_padding_top"
android:paddingBottom="@dimen/measurement_tool_menu_title_padding_bottom"
android:paddingEnd="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"

View file

@ -248,6 +248,8 @@
<dimen name="content_padding_small">12dp</dimen>
<dimen name="content_padding_half">8dp</dimen>
<dimen name="bottom_sheet_content_padding_small">8dp</dimen>
<dimen name="measurement_tool_menu_title_padding_top">13dp</dimen>
<dimen name="measurement_tool_menu_title_padding_bottom">5dp</dimen>
<dimen name="measurement_tool_divider_margin">8dp</dimen>
<dimen name="measurement_tool_content_padding_medium">12dp</dimen>
<dimen name="text_margin_small">4dp</dimen>

View file

@ -14,7 +14,6 @@ import net.osmand.plus.base.MenuBottomSheetDialogFragment;
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemButton;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.ShortDescriptionItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
public class ExitBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
@ -27,12 +26,11 @@ public class ExitBottomSheetDialogFragment extends MenuBottomSheetDialogFragment
@Override
public void createMenuItems(Bundle savedInstanceState) {
items.add(new TitleItem(getString(R.string.exit_without_saving)));
items.add(new ShortDescriptionItem.Builder()
.setDescription(getString(R.string.plan_route_exit_dialog_descr))
.setDescriptionColorId(nightMode ? R.color.text_color_primary_dark : R.color.text_color_primary_light)
.setLayoutId(R.layout.bottom_sheet_item_description_long)
.setTitle(getString(R.string.exit_without_saving))
.setLayoutId(R.layout.bottom_sheet_item_list_title_with_descr)
.create());
items.add(new DividerSpaceItem(getContext(),
@ -75,7 +73,7 @@ public class ExitBottomSheetDialogFragment extends MenuBottomSheetDialogFragment
@Override
protected int getDismissButtonTextId() {
return R.string.shared_string_close;
return R.string.shared_string_cancel;
}
public static void showInstance(@NonNull FragmentManager fragmentManager, @Nullable Fragment targetFragment) {