Merge pull request #9403 from osmandapp/Material_migration

Material theme
This commit is contained in:
Vitaliy 2020-08-11 13:27:43 +03:00 committed by GitHub
commit 265dd9064a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 183 additions and 232 deletions

View file

@ -34,8 +34,8 @@
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding" android:layout_marginTop="@dimen/content_padding"
android:text="@string/waypoint_one" android:text="@string/waypoint_one"
android:layout_marginEnd="@dimen/content_padding" android:layout_marginEnd="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding" /> android:layout_marginStart="@dimen/content_padding" />
<TextView <TextView
android:id="@+id/description" android:id="@+id/description"
@ -47,8 +47,8 @@
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding_half" android:layout_marginTop="@dimen/content_padding_half"
tools:text="Lat: 50.45375 Lon: 30.48693" tools:text="Lat: 50.45375 Lon: 30.48693"
android:layout_marginEnd="@dimen/content_padding" android:layout_marginEnd="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding" /> android:layout_marginStart="@dimen/content_padding" />
</LinearLayout> </LinearLayout>
@ -68,5 +68,5 @@
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:text="@string/shared_string_cancel" android:text="@string/shared_string_cancel"
android:layout_marginEnd="@dimen/content_padding" /> android:layout_marginEnd="@dimen/content_padding" />
</LinearLayout> </LinearLayout>

View file

@ -147,7 +147,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/map_transparency_slider" android:id="@+id/map_transparency_slider"
style="@style/Widget.Styled.Slider"
android:layout_width="@dimen/map_trans_seek_size" android:layout_width="@dimen/map_trans_seek_size"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"/> android:layout_gravity="center"/>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:id="@+id/move_marker_bottom_sheet" android:id="@+id/move_marker_bottom_sheet"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
@ -17,7 +16,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/content_padding" android:padding="@dimen/content_padding"
osmand:srcCompat="@drawable/ic_action_photo_dark"/> osmand:srcCompat="@drawable/ic_action_photo_dark" />
<LinearLayout <LinearLayout
android:layout_weight="1" android:layout_weight="1"
@ -33,8 +32,8 @@
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding" android:layout_marginTop="@dimen/content_padding"
android:text="@string/move_marker_bottom_sheet_title" android:text="@string/move_marker_bottom_sheet_title"
android:layout_marginStart="@dimen/content_padding" android:layout_marginStart="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding" /> android:layout_marginEnd="@dimen/content_padding" />
<TextView <TextView
android:id="@+id/description" android:id="@+id/description"
@ -46,8 +45,8 @@
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding_half" android:layout_marginTop="@dimen/content_padding_half"
tools:text="Lat: 50.45375 Lon: 30.48693" tools:text="Lat: 50.45375 Lon: 30.48693"
android:layout_marginStart="@dimen/content_padding" android:layout_marginStart="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding" /> android:layout_marginEnd="@dimen/content_padding" />
</LinearLayout> </LinearLayout>
@ -57,7 +56,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:text="@string/shared_string_apply"/> android:text="@string/shared_string_apply" />
<androidx.appcompat.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/cancel_button" android:id="@+id/cancel_button"
@ -67,5 +66,5 @@
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:text="@string/shared_string_cancel" android:text="@string/shared_string_cancel"
android:layout_marginEnd="@dimen/content_padding" /> android:layout_marginEnd="@dimen/content_padding" />
</LinearLayout> </LinearLayout>

View file

@ -33,8 +33,8 @@
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding" android:layout_marginTop="@dimen/content_padding"
tools:text="@string/waypoint_one" tools:text="@string/waypoint_one"
android:layout_marginEnd="@dimen/content_padding" android:layout_marginEnd="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding" /> android:layout_marginStart="@dimen/content_padding" />
<TextView <TextView
android:id="@+id/description" android:id="@+id/description"
@ -46,8 +46,8 @@
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding_half" android:layout_marginTop="@dimen/content_padding_half"
tools:text="Lat: 50.45375\nLon: 30.48693" tools:text="Lat: 50.45375\nLon: 30.48693"
android:layout_marginEnd="@dimen/content_padding" android:layout_marginEnd="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding" /> android:layout_marginStart="@dimen/content_padding" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -55,20 +55,26 @@
android:layout_marginBottom="@dimen/content_padding" android:layout_marginBottom="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding_small" android:layout_marginLeft="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small" android:layout_marginRight="@dimen/content_padding_small"
android:layout_marginStart="@dimen/content_padding_small" android:layout_marginStart="@dimen/content_padding_small"
android:layout_marginEnd="@dimen/content_padding_small"> android:layout_marginEnd="@dimen/content_padding_small">
<Button <androidx.appcompat.widget.AppCompatButton
android:id="@+id/create_button" android:id="@+id/create_button"
style="@style/DialogActionButton" style="@style/Widget.AppCompat.Button.Colored"
android:layout_marginRight="@dimen/content_padding_half" android:layout_width="wrap_content"
android:text="@string/shared_string_add" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/content_padding_half" /> android:layout_gravity="center_vertical"
android:text="@string/shared_string_add" />
<Button <androidx.appcompat.widget.AppCompatButton
android:id="@+id/cancel_button" android:id="@+id/cancel_button"
style="@style/DialogCancelButton" style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:text="@string/shared_string_cancel"/> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:text="@string/shared_string_cancel" />
</LinearLayout> </LinearLayout>

View file

@ -82,7 +82,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/speed_slider" android:id="@+id/speed_slider"
style="@style/Widget.Styled.Slider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/content_padding_small" android:layout_marginLeft="@dimen/content_padding_small"

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?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"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="fill_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dialog_content_margin" android:layout_marginLeft="@dimen/dialog_content_margin"
android:layout_marginTop="@dimen/content_padding" android:layout_marginTop="@dimen/content_padding"
@ -18,12 +18,12 @@
<LinearLayout <LinearLayout
android:id="@+id/layout_animate_gpx" android:id="@+id/layout_animate_gpx"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="fill_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dialog_content_margin" android:layout_marginLeft="@dimen/dialog_content_margin"
android:layout_marginTop="@dimen/map_small_button_margin" android:layout_marginTop="@dimen/map_small_button_margin"
@ -36,7 +36,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/Speedup" android:id="@+id/Speedup"
style="@style/Widget.Styled.Slider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dialog_content_margin" android:layout_marginLeft="@dimen/dialog_content_margin"
@ -46,7 +45,7 @@
android:layout_marginEnd="@dimen/content_padding" /> android:layout_marginEnd="@dimen/content_padding" />
<LinearLayout <LinearLayout
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dialog_content_margin" android:layout_marginLeft="@dimen/dialog_content_margin"
android:layout_marginTop="@dimen/map_small_button_margin" android:layout_marginTop="@dimen/map_small_button_margin"

View file

@ -36,7 +36,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/slider" android:id="@+id/slider"
style="@style/Widget.Styled.Slider"
android:layout_marginLeft="@dimen/content_padding" android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -1,40 +1,39 @@
<?xml version="1.0" encoding="utf-8"?> <?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"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="fill_parent" android:layout_height="match_parent"
android:paddingTop="@dimen/content_padding" android:paddingTop="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding" android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding" android:paddingRight="@dimen/content_padding"
android:orientation="vertical" android:orientation="vertical"
android:paddingEnd="@dimen/content_padding" android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding"> android:paddingStart="@dimen/content_padding">
<TextView <TextView
android:text="@string/select_max_zoom_preload_area" android:text="@string/select_max_zoom_preload_area"
android:gravity="center" android:gravity="center"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:layout_marginStart="10dp" /> android:layout_marginStart="10dp" />
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/ZoomToDownload" android:id="@+id/ZoomToDownload"
style="@style/Widget.Styled.Slider" android:layout_width="match_parent"
android:layout_width="fill_parent"
android:stepSize="1" android:stepSize="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/content_padding" android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding_small" android:layout_marginTop="@dimen/content_padding_small"
android:layout_marginEnd="@dimen/content_padding" android:layout_marginEnd="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding" /> android:layout_marginStart="@dimen/content_padding" />
<LinearLayout <LinearLayout
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView
@ -47,8 +46,8 @@
android:paddingRight="@dimen/content_padding_small" android:paddingRight="@dimen/content_padding_small"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingEnd="@dimen/content_padding_small" android:paddingEnd="@dimen/content_padding_small"
android:paddingStart="@dimen/content_padding_small" /> android:paddingStart="@dimen/content_padding_small" />
<TextView <TextView
android:text="15" android:text="15"
@ -60,8 +59,8 @@
android:paddingRight="@dimen/content_padding_small" android:paddingRight="@dimen/content_padding_small"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/content_padding_small" android:paddingStart="@dimen/content_padding_small"
android:paddingEnd="@dimen/content_padding_small" /> android:paddingEnd="@dimen/content_padding_small" />
</LinearLayout> </LinearLayout>
<TextView <TextView
@ -70,17 +69,17 @@
android:id="@+id/DownloadDescription" android:id="@+id/DownloadDescription"
android:layout_marginTop="@dimen/content_padding_small" android:layout_marginTop="@dimen/content_padding_small"
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="fill_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:id="@+id/AreaPreview" android:id="@+id/AreaPreview"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:layout_marginStart="10dp" /> android:layout_marginStart="10dp" />
</LinearLayout> </LinearLayout>

View file

@ -18,6 +18,7 @@
android:gravity="start|center_vertical" android:gravity="start|center_vertical"
android:textSize="@dimen/default_list_text_size" android:textSize="@dimen/default_list_text_size"
android:textAllCaps="false" android:textAllCaps="false"
android:textColor="?attr/textColorAlertDialogListItem"
android:paddingStart="10dp" android:paddingStart="10dp"
android:paddingEnd="10dp" /> android:paddingEnd="10dp" />

View file

@ -90,10 +90,13 @@
android:layout_weight="1" android:layout_weight="1"
android:layout_marginStart="24dp"> android:layout_marginStart="24dp">
<AutoCompleteTextView <com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/poiTypeEditText" android:id="@+id/poiTypeEditText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="@dimen/wpt_list_item_height"
android:gravity="bottom|start"
android:paddingBottom="@dimen/text_margin_small"
android:completionThreshold="1" android:completionThreshold="1"
app:drawableRightCompat="@drawable/ic_action_arrow_drop_down" app:drawableRightCompat="@drawable/ic_action_arrow_drop_down"
app:drawableEndCompat="@drawable/ic_action_arrow_drop_down" app:drawableEndCompat="@drawable/ic_action_arrow_drop_down"

View file

@ -152,7 +152,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/transparency_slider" android:id="@+id/transparency_slider"
style="@style/Widget.Styled.Slider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="@dimen/list_header_settings_top_margin" android:paddingTop="@dimen/list_header_settings_top_margin"
@ -232,7 +231,6 @@
<com.google.android.material.slider.RangeSlider <com.google.android.material.slider.RangeSlider
android:id="@+id/zoom_slider" android:id="@+id/zoom_slider"
style="@style/Widget.Styled.Slider"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"

View file

@ -2,7 +2,7 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/bg_color" android:background="?attr/bg_color"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
@ -35,7 +35,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/slider" android:id="@+id/slider"
style="@style/Widget.Styled.Slider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:valueFrom="0" android:valueFrom="0"

View file

@ -72,7 +72,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/map_transparency_slider" android:id="@+id/map_transparency_slider"
style="@style/Widget.Styled.Slider"
android:layout_width="@dimen/map_trans_seek_size" android:layout_width="@dimen/map_trans_seek_size"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:id="@+id/move_marker_bottom_sheet" android:id="@+id/move_marker_bottom_sheet"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
@ -17,7 +16,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/content_padding" android:padding="@dimen/content_padding"
osmand:srcCompat="@drawable/ic_action_photo_dark"/> osmand:srcCompat="@drawable/ic_action_photo_dark" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -32,8 +31,8 @@
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding" android:layout_marginTop="@dimen/content_padding"
android:text="@string/move_marker_bottom_sheet_title" android:text="@string/move_marker_bottom_sheet_title"
android:layout_marginEnd="@dimen/content_padding" android:layout_marginEnd="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding" /> android:layout_marginStart="@dimen/content_padding" />
<TextView <TextView
android:id="@+id/description" android:id="@+id/description"
@ -45,8 +44,8 @@
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding_half" android:layout_marginTop="@dimen/content_padding_half"
tools:text="Lat: 50.45375\nLon: 30.48693" tools:text="Lat: 50.45375\nLon: 30.48693"
android:layout_marginEnd="@dimen/content_padding" android:layout_marginEnd="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding" /> android:layout_marginStart="@dimen/content_padding" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -54,22 +53,28 @@
android:layout_marginBottom="@dimen/content_padding" android:layout_marginBottom="@dimen/content_padding"
android:layout_marginLeft="@dimen/content_padding_small" android:layout_marginLeft="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small" android:layout_marginRight="@dimen/content_padding_small"
android:layout_marginStart="@dimen/content_padding_small" android:layout_marginStart="@dimen/content_padding_small"
android:layout_marginEnd="@dimen/content_padding_small"> android:layout_marginEnd="@dimen/content_padding_small">
<Button <androidx.appcompat.widget.AppCompatButton
android:id="@+id/apply_button" android:id="@+id/apply_button"
style="@style/DialogActionButton" style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="@dimen/content_padding_half" android:layout_marginRight="@dimen/content_padding_half"
android:text="@string/shared_string_apply" android:text="@string/shared_string_apply"
android:layout_marginEnd="@dimen/content_padding_half" /> android:layout_marginEnd="@dimen/content_padding_half" />
<Button <androidx.appcompat.widget.AppCompatButton
android:id="@+id/cancel_button" android:id="@+id/cancel_button"
style="@style/DialogCancelButton" style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:text="@string/shared_string_cancel"/> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/content_padding"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/content_padding"
android:text="@string/shared_string_cancel" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -37,7 +37,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/slider" android:id="@+id/slider"
style="@style/Widget.Styled.Slider"
android:layout_marginLeft="@dimen/content_padding" android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -14,14 +13,17 @@
android:layout_marginLeft="@dimen/content_padding_small" android:layout_marginLeft="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginStart="@dimen/content_padding_small" android:layout_marginStart="@dimen/content_padding_small"
android:layout_marginEnd="@dimen/content_padding"> android:layout_marginEnd="@dimen/content_padding">
<AutoCompleteTextView <com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/tagEditText" android:id="@+id/tagEditText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="@dimen/wpt_list_item_height"
android:hint="@string/hint_tag" android:hint="@string/hint_tag"
android:gravity="bottom"
android:paddingBottom="@dimen/text_margin_small"
tools:text="Tag text"/> tools:text="Tag text"/>
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -31,11 +33,15 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"> android:layout_weight="1">
<AutoCompleteTextView <com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/valueEditText" android:id="@+id/valueEditText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/hint_value"/> android:minHeight="@dimen/wpt_list_item_height"
android:gravity="bottom"
android:paddingBottom="@dimen/text_margin_small"
android:hint="@string/hint_value"
tools:text="Value text"/>
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>

View file

@ -1,14 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto" xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:theme="?attr/new_app_theme"> android:theme="?attr/new_app_theme">
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@ -17,12 +15,12 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/bg_color" android:background="?attr/bg_color"
android:minHeight="56dp" android:minHeight="@dimen/wpt_list_item_height"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/textView3" android:id="@+id/textView3"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_weight="1"
@ -38,8 +36,8 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/content_padding" android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding" android:layout_marginEnd="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding" /> android:layout_marginStart="@dimen/content_padding" />
</LinearLayout> </LinearLayout>
@ -82,12 +80,15 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/content_padding" android:layout_marginLeft="@dimen/content_padding"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginStart="@dimen/content_padding"> android:layout_marginStart="@dimen/content_padding">
<AutoCompleteTextView <com.google.android.material.textfield.MaterialAutoCompleteTextView
android:id="@+id/poiTypeEditText" android:id="@+id/poiTypeEditText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="@dimen/wpt_list_item_height"
android:gravity="bottom"
android:paddingBottom="@dimen/text_margin_small"
android:completionThreshold="1" android:completionThreshold="1"
osmand:drawableTint="@color/osmand_orange" osmand:drawableTint="@color/osmand_orange"
osmand:drawableRightCompat="@drawable/ic_action_arrow_drop_down" osmand:drawableRightCompat="@drawable/ic_action_arrow_drop_down"
@ -95,17 +96,15 @@
android:hint="@string/poi_dialog_poi_type" android:hint="@string/poi_dialog_poi_type"
android:imeOptions="actionSend" android:imeOptions="actionSend"
android:inputType="text" android:inputType="text"
android:layout_marginLeft="-4dp" tools:text="@string/lorem_ipsum" />
tools:text="@string/lorem_ipsum"
android:layout_marginStart="-4dp" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<ImageButton <ImageButton
android:id="@+id/onlineDocumentationButton" android:id="@+id/onlineDocumentationButton"
android:contentDescription="@string/shared_string_help" android:contentDescription="@string/shared_string_help"
android:layout_width="48dp" android:layout_width="@dimen/dashboard_parking_icon_size"
android:layout_height="48dp" android:layout_height="@dimen/dashboard_parking_icon_size"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="@null" android:background="@null"
osmand:srcCompat="@drawable/ic_action_help"/> osmand:srcCompat="@drawable/ic_action_help"/>
@ -153,9 +152,9 @@
android:textColor="@color/color_white" android:textColor="@color/color_white"
android:textSize="@dimen/default_sub_text_size" android:textSize="@dimen/default_sub_text_size"
osmand:typeface="@string/font_roboto_medium" osmand:typeface="@string/font_roboto_medium"
android:layout_marginStart="@dimen/content_padding" android:layout_marginStart="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding" android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding" /> android:paddingStart="@dimen/content_padding" />
<!--<net.osmand.plus.widgets.ButtonEx--> <!--<net.osmand.plus.widgets.ButtonEx-->
<!--android:id="@+id/addTypeButton"--> <!--android:id="@+id/addTypeButton"-->

View file

@ -120,7 +120,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/angle_slider" android:id="@+id/angle_slider"
style="@style/Widget.Styled.Slider"
android:valueTo="90" android:valueTo="90"
android:stepSize="5" android:stepSize="5"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -105,7 +105,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/activity_background_color" android:background="?attr/activity_background_color"
android:theme="?attr/search_tabbar_layout_theme" style="?attr/search_tabbar_layout_theme"
app:tabGravity="fill" app:tabGravity="fill"
app:tabMaxWidth="0dp" app:tabMaxWidth="0dp"
app:tabMode="fixed"/> app:tabMode="fixed"/>

View file

@ -6,7 +6,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/slider" android:id="@+id/slider"
style="@style/Widget.Styled.Slider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />

View file

@ -96,7 +96,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/split_slider" android:id="@+id/split_slider"
style="@style/Widget.Styled.Slider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/content_padding" android:layout_marginLeft="@dimen/content_padding"

View file

@ -95,7 +95,6 @@
<com.google.android.material.slider.Slider <com.google.android.material.slider.Slider
android:id="@+id/width_slider" android:id="@+id/width_slider"
style="@style/Widget.Styled.Slider"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/content_padding" android:layout_marginLeft="@dimen/content_padding"

View file

@ -73,7 +73,6 @@
<com.google.android.material.slider.RangeSlider <com.google.android.material.slider.RangeSlider
android:id="@+id/zoom_slider" android:id="@+id/zoom_slider"
style="@style/Widget.Styled.Slider"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/content_padding" android:layout_marginLeft="@dimen/content_padding"

View file

@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?> <?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Dialog_Fullscreen" parent="android:Theme">
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/color_transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
<!-- Dashboard styles --> <!-- Dashboard styles -->
<style name="DashboardSubHeader"> <style name="DashboardSubHeader">
<item name="android:layout_width">0dp</item> <item name="android:layout_width">0dp</item>
@ -36,18 +28,6 @@
<item name="android:background">?attr/dashboard_button</item> <item name="android:background">?attr/dashboard_button</item>
</style> </style>
<style name="DashboardSearchButton">
<item name="android:paddingTop">@dimen/dashSearchPaddingTop</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_weight">1</item>
<item name="android:textColor">?android:textColorPrimary</item>
<item name="android:textSize">@dimen/default_sub_text_size</item>
<item name="android:gravity">bottom|center_horizontal</item>
<item name="android:paddingBottom">@dimen/dashSearchPaddingBot</item>
<item name="android:background">?attr/dashboard_button</item>
</style>
<style name="DialogActionButton"> <style name="DialogActionButton">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
@ -60,18 +40,6 @@
<item name="android:background">?attr/btn_round</item> <item name="android:background">?attr/btn_round</item>
</style> </style>
<style name="DialogCancelButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:minHeight">@dimen/dialog_button_height</item>
<item name="android:paddingLeft">16dp</item>
<item name="android:paddingRight">16dp</item>
<item name="android:paddingTop">8dp</item>
<item name="android:paddingBottom">8dp</item>
<item name="android:textColor">?attr/contextMenuButtonColor</item>
<item name="android:background">?attr/selectableItemBackground</item>
</style>
<style name="FirstSplashScreenCustom" parent="OsmandLightTheme.NoActionbar"> <style name="FirstSplashScreenCustom" parent="OsmandLightTheme.NoActionbar">
<item name="android:windowBackground">@drawable/first_splash_screen_free</item> <item name="android:windowBackground">@drawable/first_splash_screen_free</item>
</style> </style>
@ -88,43 +56,14 @@
<item name="android:windowBackground">@drawable/first_splash_screen_free_dev</item> <item name="android:windowBackground">@drawable/first_splash_screen_free_dev</item>
</style> </style>
<style name="OsmandTextFieldBoxes" parent="OsmandDarkTheme">
<item name="android:textColorTertiary">@color/white_50_transparent</item>
<item name="primaryColor">@color/white_50_transparent</item>
<item name="errorColor">@color/coordinate_input_error_color</item>
</style>
<style name="OsmandLightThemeWithLightStatusBar" parent="OsmandLightTheme">
<item name="android:statusBarColor">@color/status_bar_route_light</item>
</style>
<style name="TextAppearance.App.DarkTextInputLayout" parent="@android:style/TextAppearance"> <style name="TextAppearance.App.DarkTextInputLayout" parent="@android:style/TextAppearance">
<item name="android:textColor">@color/active_color_primary_dark</item> <item name="android:textColor">@color/active_color_primary_dark</item>
</style> </style>
<style name="OsmandMaterialLightTheme" parent="Theme.MaterialComponents.Light">
<item name="colorPrimary">@color/active_color_primary_light</item>
<item name="dashboard_divider">@color/divider_color_light</item>
<item name="divider_color">@color/divider_color</item>
<item name="android:textColorPrimary">@color/text_color_primary_light</item>
<item name="android:textColorSecondary">@color/text_color_secondary_light</item>
</style>
<style name="OsmandMaterialDarkTheme" parent="Theme.MaterialComponents">
<item name="colorPrimary">@color/active_color_primary_dark</item>
<item name="dashboard_divider">@color/divider_color_dark</item>
<item name="divider_color">@color/divider_color_dark</item>
<item name="android:textColorPrimary">@color/text_color_primary_dark</item>
<item name="android:textColorSecondary">@color/text_color_secondary_dark</item>
</style>
<!-- MaterialComponents Widgets override -->
<style name="Widget.Styled.Slider" parent="Widget.MaterialComponents.Slider">
<item name="android:theme">@style/Theme.MaterialComponents</item>
</style>
<!-- Osmand themes styles --> <!-- Osmand themes styles -->
<style name="OsmandLightTheme" parent="Theme.AppCompat.Light"> <style name="OsmandLightTheme" parent="Theme.MaterialComponents.Light">
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
<item name="buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
<item name="bottom_bar_background_color">@color/bottom_bar_background_color_light</item> <item name="bottom_bar_background_color">@color/bottom_bar_background_color_light</item>
<item name="android:textDirection">locale</item> <item name="android:textDirection">locale</item>
<item name="android:statusBarColor">@color/status_bar_color_light</item> <item name="android:statusBarColor">@color/status_bar_color_light</item>
@ -188,6 +127,7 @@
<item name="dashboard_general_button_text_color">@color/active_color_primary_light</item> <item name="dashboard_general_button_text_color">@color/active_color_primary_light</item>
<item name="android:listChoiceIndicatorMultiple">@drawable/check_light</item> <item name="android:listChoiceIndicatorMultiple">@drawable/check_light</item>
<item name="android:textColor">@color/text_color_primary_light</item>
<item name="android:textColorPrimary">@color/text_color_primary_light</item> <item name="android:textColorPrimary">@color/text_color_primary_light</item>
<item name="android:textColorSecondary">@color/text_color_secondary_light</item> <item name="android:textColorSecondary">@color/text_color_secondary_light</item>
<item name="android:textColorTertiary">@color/text_color_tertiary_light</item> <item name="android:textColorTertiary">@color/text_color_tertiary_light</item>
@ -196,7 +136,7 @@
<item name="spinnerListBackground">@color/spinner_list_background_light</item> <item name="spinnerListBackground">@color/spinner_list_background_light</item>
<item name="colorButtonNormal">@color/color_white</item> <item name="colorButtonNormal">@color/color_white</item>
<item name="colorPrimary">@color/osmand_orange</item> <item name="colorPrimary">@color/active_color_primary_light</item>
<item name="colorPrimaryDark">@color/osmand_orange_dark</item> <item name="colorPrimaryDark">@color/osmand_orange_dark</item>
<item name="colorAccent">@color/active_color_primary_light</item> <item name="colorAccent">@color/active_color_primary_light</item>
@ -343,8 +283,9 @@
<!--<item name="actionMenuTextColor">@color/color_white</item>--> <!--<item name="actionMenuTextColor">@color/color_white</item>-->
</style> </style>
<style name="OsmandLightTheme.SearchTabbar"> <style name="OsmandLightTheme.SearchTabbar" parent="Widget.MaterialComponents.TabLayout">
<item name="android:textColorPrimary">@color/osmand_orange</item> <item name="android:textColorPrimary">@color/osmand_orange</item>
<item name="tabTextColor">@color/osmand_orange</item>
<item name="colorAccent">@color/osmand_orange</item> <item name="colorAccent">@color/osmand_orange</item>
<item name="android:textColorSecondary">@color/text_color_secondary_light</item> <item name="android:textColorSecondary">@color/text_color_secondary_light</item>
<item name="android:textColorHint">@color/text_color_secondary_light</item> <item name="android:textColorHint">@color/text_color_secondary_light</item>
@ -371,8 +312,10 @@
<item name="colorAccent">@color/color_white</item> <item name="colorAccent">@color/color_white</item>
</style> </style>
<style name="OsmandDarkTheme.SearchTabbar"> <style name="OsmandDarkTheme.SearchTabbar" parent="Widget.MaterialComponents.TabLayout">
<item name="android:textColorPrimary">@color/osmand_orange</item> <item name="android:textColorPrimary">@color/osmand_orange</item>
<item name="tabIndicatorColor">@color/osmand_orange</item>
<item name="tabTextColor">@color/osmand_orange</item>
<item name="colorAccent">@color/osmand_orange</item> <item name="colorAccent">@color/osmand_orange</item>
<item name="android:textColorSecondary">@color/text_color_secondary_dark</item> <item name="android:textColorSecondary">@color/text_color_secondary_dark</item>
<item name="android:textColorHint">@color/text_color_secondary_dark</item> <item name="android:textColorHint">@color/text_color_secondary_dark</item>
@ -420,7 +363,7 @@
<item name="colorControlNormal">?attr/coordinate_input_edit_text_normal</item> <item name="colorControlNormal">?attr/coordinate_input_edit_text_normal</item>
</style> </style>
<style name="OsmandDarkTheme" parent="Theme.AppCompat"> <style name="OsmandDarkTheme" parent="Theme.MaterialComponents">
<item name="bottom_bar_background_color">@color/bottom_bar_background_color_dark</item> <item name="bottom_bar_background_color">@color/bottom_bar_background_color_dark</item>
<item name="android:textDirection">locale</item> <item name="android:textDirection">locale</item>
<item name="android:statusBarColor">@color/status_bar_color_dark</item> <item name="android:statusBarColor">@color/status_bar_color_dark</item>
@ -478,6 +421,7 @@
<item name="dashboard_general_button_text_color">@color/active_color_primary_dark</item> <item name="dashboard_general_button_text_color">@color/active_color_primary_dark</item>
<item name="android:listChoiceIndicatorMultiple">@drawable/check_dark</item> <item name="android:listChoiceIndicatorMultiple">@drawable/check_dark</item>
<item name="android:textColor">@color/text_color_primary_dark</item>
<item name="android:textColorPrimary">@color/text_color_primary_dark</item> <item name="android:textColorPrimary">@color/text_color_primary_dark</item>
<item name="android:textColorSecondary">@color/text_color_secondary_dark</item> <item name="android:textColorSecondary">@color/text_color_secondary_dark</item>
<item name="android:textColorTertiary">@color/text_color_tertiary_dark</item> <item name="android:textColorTertiary">@color/text_color_tertiary_dark</item>
@ -501,6 +445,8 @@
<item name="search_tabbar_layout_theme">@style/OsmandDarkTheme.SearchTabbar</item> <item name="search_tabbar_layout_theme">@style/OsmandDarkTheme.SearchTabbar</item>
<item name="toolbar_theme">@style/OsmandDarkTheme</item> <item name="toolbar_theme">@style/OsmandDarkTheme</item>
<item name="new_app_theme">@style/OsmandDarkTheme</item> <item name="new_app_theme">@style/OsmandDarkTheme</item>
<item name="colorPrimary">@color/active_color_primary_dark</item>
<item name="colorAccent">@color/active_color_primary_dark</item> <item name="colorAccent">@color/active_color_primary_dark</item>
<item name="contextMenuButtonColor">@color/osmand_orange</item> <item name="contextMenuButtonColor">@color/osmand_orange</item>

View file

@ -36,6 +36,7 @@ import androidx.appcompat.content.res.AppCompatResources;
import androidx.appcompat.view.ContextThemeWrapper; import androidx.appcompat.view.ContextThemeWrapper;
import androidx.appcompat.widget.ListPopupWindow; import androidx.appcompat.widget.ListPopupWindow;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat; import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.view.ViewCompat; import androidx.core.view.ViewCompat;
@ -547,6 +548,19 @@ public class UiUtilities {
compoundButton.setBackgroundColor(Color.TRANSPARENT); compoundButton.setBackgroundColor(Color.TRANSPARENT);
} }
public static void setupToolbarOverflowIcon(Toolbar toolbar, @DrawableRes int iconId, @ColorRes int colorId) {
Context ctx = toolbar.getContext();
if (ctx != null) {
Drawable icon = ContextCompat.getDrawable(ctx, iconId);
toolbar.setOverflowIcon(icon);
if (icon != null) {
int color = ContextCompat.getColor(ctx, colorId);
DrawableCompat.setTint(icon.mutate(), color);
toolbar.setOverflowIcon(icon);
}
}
}
public static ViewGroup createSliderView(@NonNull Context ctx, boolean nightMode) { public static ViewGroup createSliderView(@NonNull Context ctx, boolean nightMode) {
return (ViewGroup) getInflater(ctx, nightMode).inflate(R.layout.slider, null, false); return (ViewGroup) getInflater(ctx, nightMode).inflate(R.layout.slider, null, false);
} }
@ -692,14 +706,6 @@ public class UiUtilities {
} }
} }
public static LayoutInflater getMaterialInflater(Context ctx, boolean nightMode) {
return LayoutInflater.from(getThemedMaterialContext(ctx, nightMode));
}
private static Context getThemedMaterialContext(Context context, boolean nightMode) {
return getThemedContext(context, nightMode, R.style.OsmandMaterialLightTheme, R.style.OsmandMaterialDarkTheme);
}
public static LayoutInflater getInflater(Context ctx, boolean nightMode) { public static LayoutInflater getInflater(Context ctx, boolean nightMode) {
return LayoutInflater.from(getThemedContext(ctx, nightMode)); return LayoutInflater.from(getThemedContext(ctx, nightMode));
} }

View file

@ -130,7 +130,6 @@ public class PluginsActivity extends OsmandListActivity implements DownloadIndex
} }
protected class PluginsListAdapter extends ArrayAdapter<Object> { protected class PluginsListAdapter extends ArrayAdapter<Object> {
PluginsListAdapter() { PluginsListAdapter() {
super(PluginsActivity.this, R.layout.plugins_list_item, new ArrayList<>()); super(PluginsActivity.this, R.layout.plugins_list_item, new ArrayList<>());
addAll(getMyApplication().getAidlApi().getConnectedApps()); addAll(getMyApplication().getAidlApi().getConnectedApps());
@ -193,7 +192,7 @@ public class PluginsActivity extends OsmandListActivity implements DownloadIndex
AndroidUtils.removeLinkUnderline(pluginDescription); AndroidUtils.removeLinkUnderline(pluginDescription);
OsmandApplication app = getMyApplication(); OsmandApplication app = getMyApplication();
int color = AndroidUtils.getColorFromAttr(app, R.attr.list_background_color); int color = AndroidUtils.getColorFromAttr(PluginsActivity.this, R.attr.list_background_color);
pluginLogo.setImageDrawable(UiUtilities.tintDrawable(plugin.getLogoResource(), color)); pluginLogo.setImageDrawable(UiUtilities.tintDrawable(plugin.getLogoResource(), color));
pluginLogo.setOnClickListener(new View.OnClickListener() { pluginLogo.setOnClickListener(new View.OnClickListener() {
@Override @Override

View file

@ -600,8 +600,9 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
ContextMenuItem contextMenuItem = optionsMenuAdapter.getItem(j); ContextMenuItem contextMenuItem = optionsMenuAdapter.getItem(j);
if (j + 1 >= max && optionsMenuAdapter.length() > max) { if (j + 1 >= max && optionsMenuAdapter.length() > max) {
if (split == null) { if (split == null) {
Drawable icOverflowMenu = getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_overflow_menu_white);
split = menu.addSubMenu(0, 1, j + 1, R.string.shared_string_more_actions); split = menu.addSubMenu(0, 1, j + 1, R.string.shared_string_more_actions);
split.setIcon(R.drawable.ic_overflow_menu_white); split.setIcon(icOverflowMenu);
split.getItem(); split.getItem();
MenuItemCompat.setShowAsAction(split.getItem(), MenuItemCompat.SHOW_AS_ACTION_ALWAYS); MenuItemCompat.setShowAsAction(split.getItem(), MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
} }

View file

@ -8,6 +8,7 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.ActionBar;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter; import androidx.fragment.app.FragmentPagerAdapter;
@ -45,7 +46,8 @@ public class OsmLiveActivity extends AbstractDownloadActivity implements Downloa
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
getMyApplication().applyTheme(this); OsmandApplication app = getMyApplication();
app.applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_livie_updates); setContentView(R.layout.activity_livie_updates);
@ -69,6 +71,13 @@ public class OsmLiveActivity extends AbstractDownloadActivity implements Downloa
getLastUpdateDateTask = new GetLastUpdateDateTask(this); getLastUpdateDateTask = new GetLastUpdateDateTask(this);
getLastUpdateDateTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); getLastUpdateDateTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} }
boolean nightMode = !app.getSettings().isLightContent();
int normalTabColor = ContextCompat.getColor(app,
nightMode ? R.color.searchbar_tab_inactive_dark : R.color.searchbar_tab_inactive_light);
int selectedTabColor = ContextCompat.getColor(app,
nightMode ? R.color.text_color_tab_active_dark : R.color.text_color_tab_active_light);
tabLayout.setTabTextColors(normalTabColor, selectedTabColor);
} }
@Override @Override

View file

@ -3,11 +3,9 @@ package net.osmand.plus.liveupdates;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
@ -21,8 +19,6 @@ import android.widget.ProgressBar;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.AttrRes;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.google.gson.Gson; import com.google.gson.Gson;
@ -205,9 +201,9 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect
}; };
monthReportsSpinner.setOnItemSelectedListener(onItemSelectedListener); monthReportsSpinner.setOnItemSelectedListener(onItemSelectedListener);
inactiveColor = getColorFromAttr(R.attr.plugin_details_install_header_bg); inactiveColor = AndroidUtils.getColorFromAttr(container.getContext(), R.attr.plugin_details_install_header_bg);
textColorPrimary = getColorFromAttr(android.R.attr.textColorPrimary); textColorPrimary = AndroidUtils.getColorFromAttr(container.getContext(), android.R.attr.textColorPrimary);
textColorSecondary = getColorFromAttr(android.R.attr.textColorSecondary); textColorSecondary = AndroidUtils.getColorFromAttr(container.getContext(), android.R.attr.textColorSecondary);
return view; return view;
} }
@ -427,12 +423,4 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect
donationsTotalTextView.setTextColor(textColorPrimary); donationsTotalTextView.setTextColor(textColorPrimary);
recipientsTextView.setTextColor(textColorPrimary); recipientsTextView.setTextColor(textColorPrimary);
} }
@ColorInt
private int getColorFromAttr(@AttrRes int colorAttribute) {
TypedValue typedValue = new TypedValue();
Resources.Theme theme = getActivity().getTheme();
theme.resolveAttribute(colorAttribute, typedValue, true);
return typedValue.data;
}
} }

View file

@ -101,7 +101,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
app = requireMyApplication(); app = requireMyApplication();
nightMode = app.getDaynightHelper().isNightModeForMapControls(); nightMode = app.getDaynightHelper().isNightModeForMapControls();
view = UiUtilities.getMaterialInflater(getContext(), nightMode) view = UiUtilities.getInflater(getContext(), nightMode)
.inflate(R.layout.point_editor_fragment_new, container, false); .inflate(R.layout.point_editor_fragment_new, container, false);
AndroidUtils.addStatusBarPadding21v(getActivity(), view); AndroidUtils.addStatusBarPadding21v(getActivity(), view);

View file

@ -142,7 +142,8 @@ public class EditMapSourceDialogFragment extends BaseOsmAndDialogFragment
sqliteDB = savedInstanceState.getBoolean(SQLITE_DB_KEY); sqliteDB = savedInstanceState.getBoolean(SQLITE_DB_KEY);
fromTemplate = savedInstanceState.getBoolean(FROM_TEMPLATE_KEY); fromTemplate = savedInstanceState.getBoolean(FROM_TEMPLATE_KEY);
} }
View root = UiUtilities.getMaterialInflater(requireContext(), nightMode).inflate(R.layout.fragment_edit_map_source, container, false); View root = UiUtilities.getInflater(requireContext(), nightMode)
.inflate(R.layout.fragment_edit_map_source, container, false);
Toolbar toolbar = root.findViewById(R.id.toolbar); Toolbar toolbar = root.findViewById(R.id.toolbar);
toolbar.setBackgroundColor(ContextCompat.getColor(app, nightMode ? R.color.app_bar_color_dark : R.color.app_bar_color_light)); toolbar.setBackgroundColor(ContextCompat.getColor(app, nightMode ? R.color.app_bar_color_dark : R.color.app_bar_color_light));
toolbar.setTitleTextColor(ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_text_dark : R.color.active_buttons_and_links_text_light)); toolbar.setTitleTextColor(ContextCompat.getColor(app, nightMode ? R.color.active_buttons_and_links_text_dark : R.color.active_buttons_and_links_text_light));
@ -491,7 +492,7 @@ public class EditMapSourceDialogFragment extends BaseOsmAndDialogFragment
} }
private void addConfigurationItems(ConfigurationItem... items) { private void addConfigurationItems(ConfigurationItem... items) {
LayoutInflater inflater = UiUtilities.getMaterialInflater(app, nightMode); LayoutInflater inflater = UiUtilities.getInflater(app, nightMode);
for (ConfigurationItem item : items) { for (ConfigurationItem item : items) {
View view = inflater.inflate(R.layout.list_item_ui_customization, null); View view = inflater.inflate(R.layout.list_item_ui_customization, null);
((ImageView) view.findViewById(R.id.icon)).setImageDrawable(app.getUIUtilities().getIcon(item.iconRes, nightMode)); ((ImageView) view.findViewById(R.id.icon)).setImageDrawable(app.getUIUtilities().getIcon(item.iconRes, nightMode));

View file

@ -51,7 +51,7 @@ public class ExpireTimeBottomSheet extends MenuBottomSheetDialogFragment {
if (savedInstanceState != null) { if (savedInstanceState != null) {
expireValue = savedInstanceState.getInt(EXPIRE_VALUE_KEY, EXPIRE_TIME_NEVER); expireValue = savedInstanceState.getInt(EXPIRE_VALUE_KEY, EXPIRE_TIME_NEVER);
} }
LayoutInflater inflater = UiUtilities.getMaterialInflater(getContext(), nightMode); LayoutInflater inflater = UiUtilities.getInflater(getContext(), nightMode);
TitleItem titleItem = new TitleItem(getString(R.string.expire_time)); TitleItem titleItem = new TitleItem(getString(R.string.expire_time));
items.add(titleItem); items.add(titleItem);
final View inputValueLayout = inflater.inflate(R.layout.edit_text_with_descr, null); final View inputValueLayout = inflater.inflate(R.layout.edit_text_with_descr, null);

View file

@ -6,7 +6,6 @@ import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.Spanned; import android.text.Spanned;
import android.text.style.StyleSpan;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
@ -81,7 +80,7 @@ public class InputZoomLevelsBottomSheet extends MenuBottomSheetDialogFragment {
sliderDescrRes = savedInstanceState.getInt(SLIDER_DESCR_RES_KEY); sliderDescrRes = savedInstanceState.getInt(SLIDER_DESCR_RES_KEY);
newMapSource = savedInstanceState.getBoolean(NEW_MAP_SOURCE); newMapSource = savedInstanceState.getBoolean(NEW_MAP_SOURCE);
} }
LayoutInflater inflater = UiUtilities.getMaterialInflater(app, nightMode); LayoutInflater inflater = UiUtilities.getInflater(app, nightMode);
TitleItem titleItem = new TitleItem(getString(R.string.shared_string_zoom_levels)); TitleItem titleItem = new TitleItem(getString(R.string.shared_string_zoom_levels));
items.add(titleItem); items.add(titleItem);
final View sliderView = inflater.inflate(R.layout.zoom_levels_with_descr, null); final View sliderView = inflater.inflate(R.layout.zoom_levels_with_descr, null);

View file

@ -988,7 +988,7 @@ public class TrackPointFragment extends OsmandExpandableListFragment implements
categoryName = getString(R.string.shared_string_waypoints); categoryName = getString(R.string.shared_string_waypoints);
} }
SpannableStringBuilder text = new SpannableStringBuilder(categoryName).append(" (").append(String.valueOf(getChildrenCount(groupPosition))).append(")"); SpannableStringBuilder text = new SpannableStringBuilder(categoryName).append(" (").append(String.valueOf(getChildrenCount(groupPosition))).append(")");
text.setSpan(new ForegroundColorSpan(AndroidUtils.getColorFromAttr(app, R.attr.wikivoyage_primary_text_color)), text.setSpan(new ForegroundColorSpan(AndroidUtils.getColorFromAttr(mainView.getContext(), R.attr.wikivoyage_primary_text_color)),
0, categoryName.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); 0, categoryName.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
text.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, R.color.wikivoyage_secondary_text)), text.setSpan(new ForegroundColorSpan(ContextCompat.getColor(app, R.color.wikivoyage_secondary_text)),
categoryName.length() + 1, text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); categoryName.length() + 1, text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

View file

@ -7,7 +7,6 @@ import android.text.Editable;
import android.text.InputFilter; import android.text.InputFilter;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.ContextThemeWrapper; import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnFocusChangeListener; import android.view.View.OnFocusChangeListener;
@ -23,7 +22,8 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import net.osmand.AndroidUtils; import com.google.android.material.textfield.MaterialAutoCompleteTextView;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.osm.AbstractPoiType; import net.osmand.osm.AbstractPoiType;
import net.osmand.osm.MapPoiTypes; import net.osmand.osm.MapPoiTypes;
@ -215,9 +215,7 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
public void addTagView(String tg, String vl) { public void addTagView(String tg, String vl) {
View convertView = LayoutInflater.from(linearLayout.getContext()) View convertView = LayoutInflater.from(linearLayout.getContext())
.inflate(R.layout.poi_tag_list_item, null, false); .inflate(R.layout.poi_tag_list_item, null, false);
final AutoCompleteTextView tagEditText = final MaterialAutoCompleteTextView tagEditText = convertView.findViewById(R.id.tagEditText);
(AutoCompleteTextView) convertView.findViewById(R.id.tagEditText);
AndroidUtils.setTextHorizontalGravity(tagEditText, Gravity.START);
ImageButton deleteItemImageButton = ImageButton deleteItemImageButton =
(ImageButton) convertView.findViewById(R.id.deleteItemImageButton); (ImageButton) convertView.findViewById(R.id.deleteItemImageButton);
deleteItemImageButton.setImageDrawable(deleteDrawable); deleteItemImageButton.setImageDrawable(deleteDrawable);
@ -229,17 +227,15 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
editPoiData.removeTag(tagEditText.getText().toString()); editPoiData.removeTag(tagEditText.getText().toString());
} }
}); });
final AutoCompleteTextView valueEditText = final MaterialAutoCompleteTextView valueEditText = convertView.findViewById(R.id.valueEditText);
(AutoCompleteTextView) convertView.findViewById(R.id.valueEditText); valueEditText.setFilters(new InputFilter[]{
AndroidUtils.setTextHorizontalGravity(valueEditText, Gravity.START); new InputFilter.LengthFilter(AMENITY_TEXT_LENGTH)
valueEditText.setFilters(new InputFilter[] {
new InputFilter.LengthFilter(AMENITY_TEXT_LENGTH)
}); });
tagEditText.setText(tg); tagEditText.setText(tg);
tagEditText.setAdapter(tagAdapter); tagEditText.setAdapter(tagAdapter);
tagEditText.setThreshold(1); tagEditText.setThreshold(1);
tagEditText.setOnFocusChangeListener(new OnFocusChangeListener() { tagEditText.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override @Override
public void onFocusChange(View v, boolean hasFocus) { public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus) { if (!hasFocus) {
if (!editPoiData.isInEdit()) { if (!editPoiData.isInEdit()) {

View file

@ -64,7 +64,7 @@ public class VehicleParametersBottomSheet extends BasePreferenceBottomSheet {
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
private BaseBottomSheetItem createBottomSheetItem(OsmandApplication app) { private BaseBottomSheetItem createBottomSheetItem(OsmandApplication app) {
final SizePreference preference = (SizePreference) getPreference(); final SizePreference preference = (SizePreference) getPreference();
View mainView = UiUtilities.getMaterialInflater(getContext(), nightMode) View mainView = UiUtilities.getInflater(getContext(), nightMode)
.inflate(R.layout.bottom_sheet_item_edit_with_recyclerview, null); .inflate(R.layout.bottom_sheet_item_edit_with_recyclerview, null);
TextView title = mainView.findViewById(R.id.title); TextView title = mainView.findViewById(R.id.title);
title.setText(preference.getTitle().toString()); title.setText(preference.getTitle().toString());

View file

@ -933,7 +933,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
public void setupPrefRoundedBg(PreferenceViewHolder holder) { public void setupPrefRoundedBg(PreferenceViewHolder holder) {
View selectableView = holder.itemView.findViewById(R.id.selectable_list_item); View selectableView = holder.itemView.findViewById(R.id.selectable_list_item);
if (selectableView != null) { if (selectableView != null) {
int color = AndroidUtils.getColorFromAttr(app, R.attr.activity_background_color); int color = AndroidUtils.getColorFromAttr(holder.itemView.getContext(), R.attr.activity_background_color);
int selectedColor = UiUtilities.getColorWithAlpha(getActiveProfileColor(), 0.3f); int selectedColor = UiUtilities.getColorWithAlpha(getActiveProfileColor(), 0.3f);
Drawable bgDrawable = getPaintedIcon(R.drawable.rectangle_rounded, color); Drawable bgDrawable = getPaintedIcon(R.drawable.rectangle_rounded, color);

View file

@ -79,7 +79,7 @@ public class CustomColorBottomSheet extends MenuBottomSheetDialogFragment implem
} }
private View createPickerView() { private View createPickerView() {
LayoutInflater themedInflater = UiUtilities.getMaterialInflater(getActivity(), nightMode); LayoutInflater themedInflater = UiUtilities.getInflater(getActivity(), nightMode);
View colorView = themedInflater.inflate(R.layout.custom_color_picker, null); View colorView = themedInflater.inflate(R.layout.custom_color_picker, null);
colorPicker = colorView.findViewById(R.id.color_picker_view); colorPicker = colorView.findViewById(R.id.color_picker_view);
newColorPanel = colorView.findViewById(R.id.color_panel_new); newColorPanel = colorView.findViewById(R.id.color_panel_new);

View file

@ -30,6 +30,7 @@ import net.osmand.AndroidUtils;
import net.osmand.IndexConstants; import net.osmand.IndexConstants;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.TrackActivity; import net.osmand.plus.activities.TrackActivity;
@ -442,8 +443,9 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme
@Override @Override
protected void setupToolbar(Toolbar toolbar) { protected void setupToolbar(Toolbar toolbar) {
super.setupToolbar(toolbar); super.setupToolbar(toolbar);
toolbar.setOverflowIcon(getIcon(R.drawable.ic_overflow_menu_white, R.color.icon_color_default_light));
UiUtilities.setupToolbarOverflowIcon(
toolbar, R.drawable.ic_overflow_menu_white, R.color.icon_color_default_light);
Menu menu = toolbar.getMenu(); Menu menu = toolbar.getMenu();
MenuItem.OnMenuItemClickListener itemClickListener = new MenuItem.OnMenuItemClickListener() { MenuItem.OnMenuItemClickListener itemClickListener = new MenuItem.OnMenuItemClickListener() {
@Override @Override