[android] Add new outlined buttons

Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
Jean-Baptiste
2025-09-03 23:11:22 +02:00
committed by jeanbaptisteC
parent b70d45691a
commit 2f5f9e15c3
7 changed files with 23 additions and 27 deletions

View File

@@ -33,6 +33,8 @@ import app.organicmaps.sdk.util.Utils;
import app.organicmaps.util.Graphics; import app.organicmaps.util.Graphics;
import app.organicmaps.util.InputUtils; import app.organicmaps.util.InputUtils;
import app.organicmaps.util.UiUtils; import app.organicmaps.util.UiUtils;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.imageview.ShapeableImageView; import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputEditText;
@@ -134,7 +136,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
private TextInputEditText mDescription; private TextInputEditText mDescription;
private final Map<Metadata.MetadataType, View> mDetailsBlocks = new HashMap<>(); private final Map<Metadata.MetadataType, View> mDetailsBlocks = new HashMap<>();
private final Map<Metadata.MetadataType, View> mSocialMediaBlocks = new HashMap<>(); private final Map<Metadata.MetadataType, View> mSocialMediaBlocks = new HashMap<>();
private MaterialTextView mReset; private MaterialButton mReset;
private EditorHostFragment mParent; private EditorHostFragment mParent;

View File

@@ -182,20 +182,18 @@
app:layout_constraintVertical_bias="0.5" /> app:layout_constraintVertical_bias="0.5" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/report" android:id="@+id/report"
style="@style/MwmWidget.M3.Button" style="@style/MwmWidget.M3.Button.Secondary"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/report_a_bug" android:text="@string/report_a_bug"
android:textAlignment="center" android:textAlignment="center"
android:textColor="@color/text_dark"
android:layout_marginEnd="@dimen/margin_base_plus" android:layout_marginEnd="@dimen/margin_base_plus"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/donate" app:layout_constraintStart_toEndOf="@+id/donate"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5" app:layout_constraintVertical_bias="0.5" />
app:backgroundTint="@color/light_gray"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView

View File

@@ -105,14 +105,12 @@
android:textColor="?android:textColorPrimary" /> android:textColor="?android:textColorPrimary" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/register" android:id="@+id/register"
style="@style/MwmWidget.M3.Button" style="@style/MwmWidget.M3.Button.Secondary"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base" android:layout_marginTop="@dimen/margin_base"
android:padding="@dimen/margin_quarter" android:padding="@dimen/margin_quarter"
android:text="@string/register_at_openstreetmap" android:text="@string/register_at_openstreetmap" />
android:textColor="@color/text_dark"
app:backgroundTint="@color/bg_editor_light"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View File

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

View File

@@ -412,20 +412,16 @@
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView <com.google.android.material.button.MaterialButton
android:id="@+id/cv__more"
style="@style/MwmWidget.Editor.CardView"
android:layout_marginTop="@dimen/margin_double"
android:layout_marginBottom="@dimen/margin_base">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/reset" android:id="@+id/reset"
style="@style/MwmWidget.M3.Button.Secondary"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="36dp" android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:gravity="center" android:gravity="center"
android:textAppearance="@style/MwmTextAppearance.Button" android:layout_marginBottom="@dimen/margin_base"
app:backgroundTint="?cardBackground"
android:textColor="@color/base_red" android:textColor="@color/base_red"
app:strokeColor="@color/base_red"
tools:text="Reset my changes"/> tools:text="Reset my changes"/>
</com.google.android.material.card.MaterialCardView>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@@ -88,14 +88,12 @@
android:textColor="?android:textColorPrimary" /> android:textColor="?android:textColorPrimary" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/register" android:id="@+id/register"
style="@style/MwmWidget.M3.Button" style="@style/MwmWidget.M3.Button.Secondary"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base" android:layout_marginTop="@dimen/margin_base"
android:padding="@dimen/margin_quarter" android:padding="@dimen/margin_quarter"
android:text="@string/register_at_openstreetmap" android:text="@string/register_at_openstreetmap" />
android:textColor="@color/text_dark"
app:backgroundTint="@color/bg_editor_light"/>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
</LinearLayout> </LinearLayout>

View File

@@ -404,4 +404,10 @@
<style name="MwmWidget.M3.Button.Primary" parent="@style/MwmWidget.M3.Button"> <style name="MwmWidget.M3.Button.Primary" parent="@style/MwmWidget.M3.Button">
<item name="backgroundTint">?colorSecondary</item> <item name="backgroundTint">?colorSecondary</item>
</style> </style>
<style name="MwmWidget.M3.Button.Secondary" parent="@style/Widget.Material3.Button.OutlinedButton">
<item name="android:textSize">16sp</item>
<item name="strokeColor">?colorSecondary</item>
<item name="android:textColor">?colorSecondary</item>
</style>
</resources> </resources>