Merge pull request #9096 from osmandapp/Fix_tablet_sizes

Fix toolbar tablet sizes
This commit is contained in:
max-klaus 2020-05-28 13:38:07 +03:00 committed by GitHub
commit 9e6f501249
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 133 additions and 136 deletions

View file

@ -10,5 +10,8 @@
</item>
<item
android:drawable="@drawable/ic_action_import"
android:gravity="center"/>
android:top="4dp"
android:bottom="4dp"
android:left="4dp"
android:right="4dp" />
</layer-list>

View file

@ -10,5 +10,8 @@
</item>
<item
android:drawable="@drawable/ic_action_reset_to_default_dark"
android:gravity="center"/>
android:top="4dp"
android:bottom="4dp"
android:left="4dp"
android:right="4dp" />
</layer-list>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<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"
@ -17,11 +16,8 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/coordinate_input_toolbar"
android:layout_width="match_parent"
android:layout_height="48dp"
osmand:contentInsetEnd="0dp"
osmand:contentInsetLeft="4dp"
osmand:contentInsetRight="0dp"
osmand:contentInsetStart="4dp">
android:layout_height="@dimen/dashboard_map_toolbar"
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"
@ -31,24 +27,27 @@
<ImageButton
android:id="@+id/back_button"
style="@style/Widget.AppCompat.ActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
osmand:srcCompat="@drawable/ic_arrow_back"/>
android:layout_width="@dimen/toolbar_height"
android:layout_height="@dimen/toolbar_height"
android:contentDescription="@string/access_shared_string_navigate_up"
osmand:srcCompat="@drawable/ic_arrow_back" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/toolbar_text"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:text="@string/coordinates"
android:textSize="@dimen/dialog_header_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:textColor="@color/color_white"/>
tools:textColor="@color/color_white" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/options_button"
@ -58,15 +57,15 @@
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:text="@string/shared_string_options"
android:textAllCaps="true"
android:textColor="@color/color_white"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium"
android:paddingStart="16dp"
android:paddingEnd="16dp" />
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
</LinearLayout>
@ -92,7 +91,7 @@
android:layout_height="match_parent"
android:layout_gravity="end"
android:scaleType="fitXY"
osmand:srcCompat="@drawable/bg_shadow_quick_input_left"/>
osmand:srcCompat="@drawable/bg_shadow_quick_input_left" />
</FrameLayout>
@ -108,7 +107,7 @@
android:layout_height="match_parent"
android:layout_gravity="start"
android:scaleType="fitXY"
osmand:srcCompat="@drawable/bg_shadow_quick_input_right"/>
osmand:srcCompat="@drawable/bg_shadow_quick_input_right" />
</FrameLayout>

View file

@ -19,10 +19,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_map_toolbar"
android:minHeight="@dimen/dashboard_map_toolbar"
app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"

View file

@ -22,10 +22,7 @@
android:id="@+id/coordinate_input_toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_map_toolbar"
osmand:contentInsetEnd="0dp"
osmand:contentInsetLeft="4dp"
osmand:contentInsetRight="0dp"
osmand:contentInsetStart="4dp">
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"
@ -35,10 +32,9 @@
<ImageButton
android:id="@+id/back_button"
style="@style/Widget.AppCompat.ActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_width="@dimen/toolbar_height"
android:layout_height="@dimen/toolbar_height"
android:contentDescription="@string/access_shared_string_navigate_up"
tools:src="@drawable/ic_arrow_back"/>
<net.osmand.plus.widgets.TextViewEx
@ -46,6 +42,10 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"

View file

@ -15,10 +15,7 @@
android:layout_height="@dimen/dashboard_map_toolbar"
android:background="?attr/actionModeBackground"
android:minHeight="@dimen/dashboard_map_toolbar"
app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"

View file

@ -15,11 +15,7 @@
android:layout_height="@dimen/toolbar_height"
android:background="?attr/wikivoyage_app_bar_color"
android:gravity="center_vertical"
android:minHeight="@dimen/toolbar_height"
osmand:contentInsetLeft="54dp"
osmand:contentInsetStart="54dp"
osmand:contentInsetRight="0dp"
osmand:contentInsetEnd="0dp">
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"

View file

@ -5,6 +5,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/toolbar_height"
android:background="?attr/actionModeBackground"
android:padding="0dp"
app:contentInsetLeft="0dp"
@ -31,10 +32,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding">
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/toolbar_title"

View file

@ -6,6 +6,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/actionModeBackground"
android:minHeight="@dimen/toolbar_height"
android:padding="0dp"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetRight="0dp"
@ -36,15 +38,15 @@
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding"
android:maxLines="2"
android:textColor="?attr/app_bar_primary_item_color"
android:textSize="@dimen/dialog_header_text_size"
app:typeface="@string/font_roboto_medium"
tools:text="@string/routing_settings_2"
android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding" />
tools:text="@string/routing_settings_2" />
</LinearLayout>

View file

@ -21,8 +21,8 @@
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
android:background="?attr/card_and_list_background_basic"
android:minHeight="@dimen/toolbar_height"
osmand:subtitleTextColor="?android:textColorPrimary"
app:contentInsetStartWithNavigation="@dimen/toolbar_inset_start_with_navigation"
osmand:theme="@style/ThemeOverlay.AppCompat.ActionBar"
osmand:titleTextColor="?android:textColorPrimary">

View file

@ -4,6 +4,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/toolbar_height"
osmand:contentInsetLeft="0dp"
osmand:contentInsetStart="0dp"
osmand:contentInsetRight="0dp"
@ -32,6 +33,10 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding"
android:paddingTop="@dimen/content_padding_half"
android:paddingBottom="@dimen/content_padding_half"
android:background="?attr/card_and_list_background_basic"
@ -42,15 +47,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:maxLines="2"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/dialog_header_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="@string/routing_settings_2"
android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding" />
tools:text="@string/routing_settings_2" />
<TextView
android:id="@+id/toolbar_subtitle"
@ -58,12 +59,8 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:textAppearance="@style/TextAppearance.ContextMenuSubtitle"
tools:text="Some description"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
tools:text="Some description" />
</LinearLayout>
</LinearLayout>

View file

@ -6,6 +6,7 @@
android:layout_height="wrap_content"
android:background="?attr/actionModeBackground"
android:minHeight="@dimen/toolbar_height"
android:padding="0dp"
osmand:contentInsetLeft="0dp"
osmand:contentInsetStart="0dp"
osmand:contentInsetRight="0dp"

View file

@ -4,6 +4,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp"
osmand:contentInsetLeft="0dp"
osmand:contentInsetStart="0dp"
osmand:contentInsetRight="0dp"
@ -38,6 +39,10 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding"
android:paddingTop="@dimen/content_padding_half"
android:paddingBottom="@dimen/content_padding_half"
android:background="?attr/card_and_list_background_basic"
@ -48,15 +53,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:maxLines="2"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/dialog_header_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="@string/routing_settings_2"
android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding" />
tools:text="@string/routing_settings_2" />
<TextView
android:id="@+id/toolbar_subtitle"
@ -64,12 +65,8 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:textAppearance="@style/TextAppearance.ContextMenuSubtitle"
tools:text="Some description"
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
tools:text="Some description" />
</LinearLayout>
<include

View file

@ -1,5 +1,6 @@
<?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:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@ -17,8 +18,10 @@
android:background="@color/osmand_orange"
android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/toolbar_theme"
app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"
android:padding="0dp"
app:contentInsetStartWithNavigation="@dimen/toolbar_inset_start_with_navigation"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
@ -28,10 +31,11 @@
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/titleEdit"
android:layout_width="0dp"
android:layout_height="match_parent"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:layout_weight="1"
android:background="@null"
android:ellipsize="end"
@ -40,7 +44,8 @@
android:singleLine="true"
android:text="@string/coords_search"
android:textColor="@color/color_white"
android:textSize="@dimen/default_list_text_size_large"/>
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/dialog_header_text_size"/>
<ProgressBar
android:id="@+id/searchProgressBar"

View file

@ -9,7 +9,7 @@
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="@dimen/toolbar_height">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
@ -18,8 +18,10 @@
android:background="@color/osmand_orange"
android:minHeight="@dimen/toolbar_height"
android:theme="?attr/toolbar_theme"
app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"
android:padding="0dp"
app:contentInsetStartWithNavigation="@dimen/toolbar_inset_start_with_navigation"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
@ -31,15 +33,14 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="14dp"
android:layout_marginTop="14dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:background="@null"
android:ellipsize="end"
android:lines="1"
@ -47,7 +48,8 @@
android:singleLine="true"
android:text="@string/create_custom_poi"
android:textColor="@color/color_white"
android:textSize="@dimen/default_list_text_size_large"/>
osmand:typeface="@string/font_roboto_medium"
android:textSize="@dimen/dialog_header_text_size"/>
</LinearLayout>

View file

@ -24,8 +24,9 @@
android:minHeight="@dimen/dashboard_map_toolbar"
android:padding="0dp"
android:theme="?attr/toolbar_theme"
app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"
app:contentInsetStartWithNavigation="@dimen/toolbar_inset_start_with_navigation"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">

View file

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<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"
@ -13,18 +11,14 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp">
osmand:elevation="0dp">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_map_toolbar"
android:layout_height="@dimen/toolbar_height"
android:background="?attr/wikivoyage_bg_color"
android:minHeight="@dimen/dashboard_map_toolbar"
osmand:contentInsetLeft="54dp"
osmand:contentInsetStart="54dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
android:padding="0dp">
<LinearLayout
android:layout_width="match_parent"
@ -42,7 +36,7 @@
android:text="@string/shared_string_travel_guides"
android:textColor="?attr/wikivoyage_app_bar_text_color"
android:textSize="@dimen/dialog_header_text_size"
osmand:typeface="@string/font_roboto_medium"/>
osmand:typeface="@string/font_roboto_medium" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/options_button"
@ -53,15 +47,15 @@
android:gravity="center_vertical"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:text="@string/shared_string_options"
android:textColor="?attr/wikivoyage_active_color"
android:textSize="@dimen/text_button_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute"
android:paddingStart="16dp"
android:paddingEnd="16dp" />
android:paddingStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" />
</LinearLayout>
@ -80,7 +74,7 @@
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"/>
android:indeterminate="true" />
<FrameLayout
android:id="@+id/search_box"
@ -111,7 +105,7 @@
android:maxLines="1"
android:text="@string/wikivoyage_search_hint"
android:textSize="@dimen/default_list_text_size"
tools:textColor="?attr/searchbar_text_hint"/>
tools:textColor="?attr/searchbar_text_hint" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/search_icon"
@ -136,7 +130,7 @@
<net.osmand.plus.LockableViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@ -147,9 +141,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/wikivoyage_card_bg_color"
app:itemBackground="?attr/wikivoyage_card_bg_color"
app:menu="@menu/wikivoyage_bottom_navigation"
osmand:itemBackground="?attr/wikivoyage_card_bg_color"
osmand:menu="@menu/wikivoyage_bottom_navigation"
tools:itemIconTint="@color/bottom_navigation_color_selector_light"
tools:itemTextColor="@color/bottom_navigation_color_selector_light"/>
tools:itemTextColor="@color/bottom_navigation_color_selector_light" />
</LinearLayout>

View file

@ -121,7 +121,6 @@
<dimen name="bottom_sheet_menu_peek_height">450dp</dimen>
<dimen name="side_of_the_world_button_size">54dp</dimen>
<dimen name="toolbar_height">64dp</dimen>
<dimen name="poi_icon_size">24dp</dimen>
</resources>

View file

@ -9,7 +9,7 @@
<dimen name="wpt_list_category_height">60dp</dimen>
<dimen name="wpt_list_item_height">56dp</dimen>
<dimen name="list_item_button_padding">4dp</dimen>
<dimen name="action_bar_height">64dp</dimen>
<dimen name="action_bar_height">56dp</dimen>
<dimen name="list_content_padding_large">32dp</dimen>
<dimen name="title_padding">20dp</dimen>
<dimen name="title_text_size">28sp</dimen>
@ -335,6 +335,7 @@
<dimen name="toolbar_height">56dp</dimen>
<dimen name="toolbar_height_expanded">96dp</dimen>
<dimen name="toolbar_inset_start_with_navigation">72dp</dimen>
<dimen name="wikivoyage_search_list_header_height">36dp</dimen>
<dimen name="wikivoyage_article_card_icon_size">80dp</dimen>

View file

@ -287,10 +287,20 @@
<item name="preferenceTheme">@style/OsmandPreferenceTheme</item>
<item name="stroked_buttons_and_links_outline">@color/stroked_buttons_and_links_outline_light</item>
<item name="btn_bg_border_inactive">@drawable/btn_bg_border_inactive_light</item>
<item name="actionBarSize">@dimen/action_bar_height</item>
<item name="android:toolbarStyle">@style/ToolbarStyle</item>
<item name="toolbarStyle">@style/ToolbarStyle</item>
</style>
<style name="ToolbarStyle" parent="@style/Widget.AppCompat.Toolbar">
<item name="contentInsetStart">0dp</item>
<item name="titleMargin">0dp</item>
<item name="contentInsetStartWithNavigation">@dimen/toolbar_inset_start_with_navigation</item>
</style>
<style name="OverflowMenuButton" parent="@style/Widget.AppCompat.ActionButton.Overflow">
<item name="srcCompat">@drawable/ic_overflow_menu_white</item>
<item name="android:tint">?attr/app_bar_primary_item_color</item>
</style>
<style name="PopupMenuLight" parent="@style/Widget.AppCompat.Light.PopupMenu">
@ -556,6 +566,9 @@
<item name="preferenceTheme">@style/OsmandPreferenceTheme</item>
<item name="stroked_buttons_and_links_outline">@color/stroked_buttons_and_links_outline_dark</item>
<item name="btn_bg_border_inactive">@drawable/btn_bg_border_inactive_dark</item>
<item name="actionBarSize">@dimen/action_bar_height</item>
<item name="android:toolbarStyle">@style/ToolbarStyle</item>
<item name="toolbarStyle">@style/ToolbarStyle</item>
</style>
<style name="FreeVersionBanner" parent="OsmandDarkTheme">
@ -788,5 +801,6 @@
<style name="ThemeOverlay.AppCompat.ActionBar">
<item name="android:padding">0dp</item>
<item name="titleMargin">0dp</item>
</style>
</resources>

View file

@ -124,7 +124,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
MAP_DURING_NAVIGATION(MapDuringNavigationFragment.class.getName(), true, ApplyQueryType.SNACK_BAR, R.xml.map_during_navigation, R.layout.profile_preference_toolbar),
TURN_SCREEN_ON(TurnScreenOnFragment.class.getName(), true, ApplyQueryType.SNACK_BAR, R.xml.turn_screen_on, R.layout.profile_preference_toolbar_with_switch),
DATA_STORAGE(DataStorageFragment.class.getName(), false, null, R.xml.data_storage, R.layout.global_preference_toolbar),
DIALOGS_AND_NOTIFICATIONS_SETTINGS(DialogsAndNotificationsSettingsFragment.class.getName(), false, null, R.xml.dialogs_and_notifications_preferences, R.layout.global_preferences_toolbar_with_switch),
DIALOGS_AND_NOTIFICATIONS_SETTINGS(DialogsAndNotificationsSettingsFragment.class.getName(), false, null, R.xml.dialogs_and_notifications_preferences, R.layout.global_preference_toolbar),
PROFILE_APPEARANCE(ProfileAppearanceFragment.TAG, true, null, R.xml.profile_appearance, R.layout.profile_preference_toolbar),
OPEN_STREET_MAP_EDITING(OsmEditingFragment.class.getName(), false, null, R.xml.osm_editing, R.layout.global_preference_toolbar),
MULTIMEDIA_NOTES(MultimediaNotesFragment.class.getName(), true, ApplyQueryType.SNACK_BAR, R.xml.multimedia_notes, R.layout.profile_preference_toolbar),

View file

@ -1,8 +1,5 @@
package net.osmand.plus.settings.fragments;
import android.view.LayoutInflater;
import android.view.View;
import androidx.preference.Preference;
import androidx.preference.SwitchPreferenceCompat;
@ -12,12 +9,6 @@ public class DialogsAndNotificationsSettingsFragment extends BaseSettingsFragmen
public static final String TAG = DialogsAndNotificationsSettingsFragment.class.getSimpleName();
@Override
protected void createToolbar(LayoutInflater inflater, View view) {
super.createToolbar(inflater, view);
view.findViewById(R.id.toolbar_switch_container).setVisibility(View.GONE);
}
@Override
protected void setupPreferences() {
Preference mapDuringNavigationInfo = findPreference("dialogs_and_notifications_preferences_info");

View file

@ -9,8 +9,6 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import net.osmand.plus.OsmandApplication;
@ -68,7 +66,7 @@ public class TravelDownloadUpdateCard extends BaseTravelCard {
DownloadUpdateVH holder = (DownloadUpdateVH) viewHolder;
this.ref = new WeakReference<TravelDownloadUpdateCard.DownloadUpdateVH>(holder);
holder.title.setText(getTitle(loading));
holder.icon.setImageDrawable(getIcon());
holder.icon.setImageResource(getIconRes());
holder.description.setText(getDescription());
if (indexItem == null) {
holder.fileDataContainer.setVisibility(View.GONE);
@ -117,9 +115,8 @@ public class TravelDownloadUpdateCard extends BaseTravelCard {
return app.getString(download ? R.string.download_file : R.string.update_is_available);
}
private Drawable getIcon() {
int id = download ? R.drawable.travel_card_download_icon : R.drawable.travel_card_update_icon;
return AppCompatResources.getDrawable(app, id);
private int getIconRes() {
return download ? R.drawable.travel_card_download_icon : R.drawable.travel_card_update_icon;
}
@NonNull