[android] Migrate Primary buttons to Material 3 themes

Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
Jean-Baptiste
2025-08-24 17:48:33 +02:00
committed by Konstantin Pastbin
parent 05cc660641
commit ca5cc46f2b
20 changed files with 90 additions and 66 deletions

View File

@@ -112,7 +112,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/donate"
style="@style/MwmWidget.Button.Accent"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
@@ -121,13 +121,13 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/report"
style="@style/MwmWidget.Button"
style="@style/MwmWidget.M3.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:background="@color/light_gray"
android:layout_marginTop="@dimen/margin_half"
android:text="@string/report_a_bug"
android:textColor="@color/text_dark" />
android:textColor="@color/text_dark"
app:backgroundTint="@color/light_gray"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/faq"

View File

@@ -41,7 +41,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_continue"
style="@style/MwmWidget.Button.Accent"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"

View File

@@ -25,7 +25,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_grant_permissions"
style="@style/MwmWidget.Button.Accent"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"

View File

@@ -71,9 +71,9 @@
tools:visibility="visible" />
</LinearLayout>
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/start"
style="@style/MwmWidget.Button.Primary"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
@@ -94,10 +94,11 @@
android:id="@+id/btn__manage_route"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/MwmWidget.Button"
style="@style/Widget.Material3.Button.TextButton"
android:text="@string/planning_route_manage_route"
android:textColor="?android:textColorPrimary"
android:textAlignment="viewStart"
android:textAppearance="@style/MwmTextAppearance.Body1"
app:icon="@drawable/ic_manage_route"
app:iconTint="?android:textColorPrimary"
app:iconPadding="@dimen/margin_quarter_plus"/>
@@ -107,11 +108,12 @@
android:id="@+id/btn__save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/MwmWidget.Button"
style="@style/Widget.Material3.Button.TextButton"
android:layout_marginStart="@dimen/margin_base"
android:minHeight="@dimen/primary_button_min_height"
android:text="@string/save"
android:textColor="?android:textColorPrimary"/>
android:textColor="?android:textColorPrimary"
android:textAppearance="@style/MwmTextAppearance.Body1"/>
</LinearLayout>
</LinearLayout>

View File

@@ -31,7 +31,7 @@
app:trackColor="@color/bg_routing_progress"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_download_resources"
style="@style/MwmWidget.Button.Primary"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_base_plus"

View File

@@ -94,11 +94,10 @@
android:layout_marginBottom="@dimen/margin_base">
<com.google.android.material.button.MaterialButton
android:id="@+id/login"
style="@style/MwmWidget.Button.Accent"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/login_osm"
android:textAppearance="@style/MwmTextAppearance.Body2.Light" />
android:text="@string/login_osm" />
<ProgressBar
android:id="@+id/osm_login_progress"
android:layout_width="@dimen/editor_auth_btn_height"
@@ -109,14 +108,16 @@
</FrameLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/lost_password"
style="@style/MwmWidget.Button"
style="@style/MwmWidget.M3.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:background="?clickableBackground"
android:padding="@dimen/margin_half"
android:text="@string/forgot_password"
android:textAppearance="@style/MwmTextAppearance.Body3" />
android:textAppearance="@style/MwmTextAppearance.Body3"
android:textColor="@color/text_dark"
tools:visibility="invisible"/>
<com.google.android.material.divider.MaterialDivider
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -130,15 +131,14 @@
android:textColor="?android:textColorPrimary" />
<com.google.android.material.button.MaterialButton
android:id="@+id/register"
style="@style/MwmWidget.Button.Accent"
style="@style/MwmWidget.M3.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base"
android:background="@drawable/button_editor_light"
android:padding="@dimen/margin_quarter"
android:text="@string/register_at_openstreetmap"
android:textAppearance="@style/MwmTextAppearance.Body2"
android:textColor="@color/text_dark" />
android:textColor="@color/text_dark"
app:backgroundTint="@color/bg_editor_light"/>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@@ -60,7 +60,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn__download_map"
style="@style/MwmWidget.Button.Primary"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_marginTop="@dimen/margin_half"
android:text="@string/downloader_download_map"/>
</LinearLayout>
@@ -85,7 +85,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn__select_map"
style="@style/MwmWidget.Button.Primary"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_marginTop="@dimen/margin_half"
android:text="@string/search_select_map"/>
</LinearLayout>

View File

@@ -45,13 +45,15 @@
android:maxLines="6" />
</com.google.android.material.textfield.TextInputLayout>
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/send_note_button"
style="@style/MwmWidget.Button.Accent"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="?accentButtonBackground"
android:layout_marginTop="@dimen/margin_base"
android:enabled="false"
android:text="@string/editor_report_problem_send_button" />
android:enabled="true"
android:text="@string/editor_report_problem_send_button"
app:backgroundTint="@null"/>
</LinearLayout>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/margin_base_plus"
@@ -8,10 +9,12 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn__add_time"
style="@style/MwmWidget.Button.Primary"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_gravity="center"
android:enabled="false"
android:background="?accentButtonBackground"
android:padding="@dimen/margin_base"
android:text="@string/editor_time_add"/>
android:text="@string/editor_time_add"
app:backgroundTint="@null"/>
</FrameLayout>

View File

@@ -89,21 +89,22 @@
android:paddingStart="0dp"
android:paddingEnd="@dimen/altitude_chart_container_padding_left">
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/btn__cancel"
style="@style/MwmWidget.Button"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/cancel"
android:textColor="?android:attr/textColorPrimary"
android:textColor="?android:textColorPrimary"
android:textAppearance="@style/MwmTextAppearance.Body1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/btn__plan"
style="@style/MwmWidget.Button.Primary"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"

View File

@@ -53,7 +53,7 @@
android:clipChildren="false">
<com.google.android.material.button.MaterialButton
android:id="@+id/downloader_button"
style="@style/MwmWidget.Button.Primary"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_width="180dp"
android:layout_gravity="center"
android:visibility="gone"

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Button
<com.google.android.material.button.MaterialButton
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/start"
style="@style/MwmWidget.Button.Primary"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="@dimen/start_button_width"