[android] Use Material button instead TextView

Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
Jean-Baptiste
2025-09-07 23:07:25 +02:00
committed by jeanbaptisteC
parent e9a0b9d2f1
commit d102396c6a
8 changed files with 34 additions and 33 deletions

View File

@@ -23,6 +23,8 @@ import app.organicmaps.util.UiUtils;
import app.organicmaps.util.Utils;
import app.organicmaps.widget.recycler.RecyclerClickListener;
import app.organicmaps.widget.recycler.RecyclerLongClickListener;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.checkbox.MaterialCheckBox;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textview.MaterialTextView;
@@ -59,7 +61,7 @@ public class Holders
public static class HeaderViewHolder extends RecyclerView.ViewHolder
{
@NonNull
private final MaterialTextView mButton;
private final MaterialButton mButton;
@NonNull
private final MaterialTextView mText;
@@ -77,7 +79,7 @@ public class Holders
}
@NonNull
public MaterialTextView getButton()
public MaterialButton getButton()
{
return mButton;
}

View File

@@ -90,8 +90,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
private MultilanguageAdapter mNamesAdapter;
private MaterialTextView mNamesCaption;
private MaterialTextView mAddLanguage;
private MaterialTextView mMoreLanguages;
private MaterialButton mAddLanguage;
private MaterialButton mMoreLanguages;
private MaterialTextView mStreet;
private TextInputEditText mHouseNumber;
@@ -99,7 +99,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
// Define Metadata entries, that have more tricky logic, separately.
private MaterialTextView mPhone;
private MaterialTextView mEditPhoneLink;
private MaterialButton mEditPhoneLink;
private MaterialTextView mCuisine;
private SwitchCompat mWifi;
private MaterialTextView mSelfService;

View File

@@ -209,19 +209,17 @@
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/editor_margin_left"
android:layout_toStartOf="@+id/edit_phone"/>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.button.MaterialButton
android:id="@+id/edit_phone"
android:layout_marginStart="@dimen/margin_half_plus"
android:background="?clickableBackground"
style="@style/Widget.Material3.Button.TextButton"
android:gravity="center_vertical"
android:text="@string/edit"
android:textAllCaps="true"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:textAppearance="@style/MwmTextAppearance.Body1"
android:textColor="?colorSecondary"/>
android:textAppearance="@style/MwmTextAppearance.Body1" />
</RelativeLayout>
<include

View File

@@ -20,9 +20,9 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/categories" />
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.button.MaterialButton
android:id="@+id/button"
style="?fontSubtitle2"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
@@ -30,8 +30,8 @@
android:background="?selectableItemBackground"
android:paddingTop="@dimen/margin_half_plus"
android:text="@string/bookmark_lists_hide_all"
android:textAllCaps="true"
android:textColor="?colorSecondary"
android:textAppearance="@style/MwmTextAppearance.Body1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -56,18 +56,18 @@
android:textAppearance="@style/MwmTextAppearance.PlacePage"
tools:text="Mo-Fr 16:00-18.00\nSu 16:00-18.00"/>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.button.MaterialButton
android:id="@+id/edit_opening_hours"
style="@style/MwmWidget.Editor.FieldLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.Material3.Button.TextButton"
android:layout_below="@id/opening_hours"
android:layout_marginStart="@dimen/editor_margin_timetable_left"
android:layout_marginTop="@dimen/margin_base_plus"
android:background="?clickableBackground"
android:gravity="center_vertical"
android:minHeight="@dimen/height_block_base"
android:text="@string/edit_opening_hours"
android:textAllCaps="true"
android:textAppearance="@style/MwmTextAppearance.Body1"
android:textColor="?colorSecondary"/>
android:textColor="?colorSecondary"
android:textAppearance="@style/MwmTextAppearance.Body1" />
</RelativeLayout>

View File

@@ -2,6 +2,7 @@
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/MwmWidget.Editor.CardView"
android:layout_marginBottom="@dimen/margin_half"
android:layout_marginTop="@dimen/margin_half">
@@ -267,29 +268,28 @@
android:layout_height="wrap_content"
android:orientation="vertical"/>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.button.MaterialButton
android:id="@+id/tv__add_closed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?clickableBackground"
style="@style/Widget.Material3.Button.TextButton"
android:textColor="?colorSecondary"
android:padding="@dimen/margin_half_plus"
android:text="@string/editor_time_add_closed"
android:textAllCaps="true"
android:textAppearance="@style/MwmTextAppearance.Body1"
android:textColor="?colorSecondary"/>
android:textAppearance="@style/MwmTextAppearance.Body1" />
</LinearLayout>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.button.MaterialButton
android:id="@+id/tv__remove_timetable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?clickableBackground"
style="@style/Widget.Material3.Button.TextButton"
android:padding="@dimen/margin_half_plus"
android:text="@string/editor_time_delete"
android:textAllCaps="true"
android:textAppearance="@style/MwmTextAppearance.Body1"
android:textColor="@color/base_red"/>
android:textColor="@color/base_red"
app:rippleColor="@android:color/transparent"/>
</LinearLayout>

View File

@@ -23,22 +23,24 @@
<include layout="@layout/recycler_default" />
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.button.MaterialButton
android:id="@+id/more_names"
android:layout_width="match_parent"
android:layout_height="@dimen/height_block_base"
android:background="?clickableBackground"
style="@style/Widget.Material3.Button.TextButton"
android:gravity="center"
android:text="@string/placepage_more_button"
android:textColor="?colorSecondary"
android:textAppearance="@style/MwmTextAppearance.Button" />
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.button.MaterialButton
android:id="@+id/add_langs"
android:layout_width="match_parent"
android:layout_height="@dimen/height_block_base"
android:background="?clickableBackground"
style="@style/Widget.Material3.Button.TextButton"
android:gravity="center"
android:text="@string/add_language"
android:textColor="?colorSecondary"
android:textAppearance="@style/MwmTextAppearance.Button" />
</LinearLayout>

View File

@@ -101,7 +101,6 @@
<style name="MwmTextAppearance.Button">
<item name="android:textSize">@dimen/text_size_button</item>
<item name="android:textColor">?colorSecondary</item>
<item name="android:textAllCaps">true</item>
</style>
<style name="MwmTextAppearance.Button.Red">