mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-24 06:53:46 +00:00
[android] Migrate FAB to Material 3 theme
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
@@ -3,10 +3,11 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/feedback_fab"
|
||||
style="MwmWidget.M3.FAB.Primary"
|
||||
app:shapeAppearance="@style/ShapeAppearanceOverlay.Material3.FloatingActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/feedback"
|
||||
app:tint="?android:textColorPrimaryInverse"
|
||||
app:srcCompat="@drawable/ic_feedback"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
style="@style/MwmWidget.M3.FAB.Primary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/action"
|
||||
@@ -33,7 +34,6 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/margin_base"
|
||||
android:layout_marginBottom="@dimen/margin_base"
|
||||
app:tint="?android:textColorPrimaryInverse"
|
||||
app:srcCompat="@drawable/ic_plus"/>
|
||||
|
||||
<app.organicmaps.widget.PlaceholderView
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/tv__append_phone"
|
||||
style="@style/MwmWidget.M3.FAB.Primary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/margin_base"
|
||||
@@ -32,7 +33,6 @@
|
||||
app:fabSize="normal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@drawable/ic_plus"
|
||||
app:iconTint="?android:textColorPrimaryInverse" />
|
||||
app:srcCompat="@drawable/ic_plus" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/btn_bookmarks"
|
||||
style="@style/MwmWidget.MapButton.Square"
|
||||
app:shapeAppearanceOverlay="@style/MwmWidget.MapButton.Square"
|
||||
style="@style/MwmWidget.M3.FAB.MapButton.Square"
|
||||
app:shapeAppearanceOverlay="@style/MwmWidget.M3.FAB.MapButton.Square"
|
||||
android:contentDescription="@string/bookmarks"
|
||||
app:srcCompat="@drawable/ic_bookmarks" />
|
||||
@@ -3,6 +3,6 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/help_button"
|
||||
style="@style/MwmWidget.MapButton.Square"
|
||||
app:shapeAppearanceOverlay="@style/MwmWidget.MapButton.Square"
|
||||
style="@style/MwmWidget.M3.FAB.MapButton.Square"
|
||||
app:shapeAppearanceOverlay="@style/MwmWidget.M3.FAB.MapButton.Square"
|
||||
app:srcCompat="@drawable/ic_question_mark" />
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/layers_button"
|
||||
style="@style/MwmWidget.MapButton"
|
||||
style="@style/MwmWidget.M3.FAB.MapButton"
|
||||
android:contentDescription="@string/layers_title"
|
||||
android:tint="?accentColorSelector"
|
||||
app:tint="?accentColorSelector"
|
||||
app:srcCompat="@drawable/ic_layers" />
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/menu_button"
|
||||
style="@style/MwmWidget.MapButton.Square"
|
||||
style="@style/MwmWidget.M3.FAB.MapButton.Square"
|
||||
android:contentDescription="@string/menu"
|
||||
app:shapeAppearanceOverlay="@style/MwmWidget.MapButton.Square"
|
||||
app:shapeAppearanceOverlay="@style/MwmWidget.M3.FAB.MapButton.Square"
|
||||
app:srcCompat="@drawable/ic_menu_open" />
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/btn_search"
|
||||
style="@style/MwmWidget.MapButton.Square"
|
||||
app:shapeAppearanceOverlay="@style/MwmWidget.MapButton.Square"
|
||||
style="@style/MwmWidget.M3.FAB.MapButton.Square"
|
||||
app:shapeAppearanceOverlay="@style/MwmWidget.M3.FAB.MapButton.Square"
|
||||
android:contentDescription="@string/search"
|
||||
app:srcCompat="@drawable/ic_search" />
|
||||
@@ -3,6 +3,6 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/track_recording_status"
|
||||
style="@style/MwmWidget.MapButton"
|
||||
android:tint="@color/accent_color_selector"
|
||||
style="@style/MwmWidget.M3.FAB.MapButton"
|
||||
app:tint="@color/accent_color_selector"
|
||||
app:srcCompat="@drawable/ic_track_recording_status" />
|
||||
@@ -410,4 +410,26 @@
|
||||
<item name="strokeColor">?colorSecondary</item>
|
||||
<item name="android:textColor">?colorSecondary</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.M3.FAB.Primary" parent="@style/Widget.Material3.FloatingActionButton.Primary">
|
||||
<item name="shapeAppearance">@style/ShapeAppearanceOverlay.Material3.FloatingActionButton</item>
|
||||
<item name="rippleColor">@null</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.M3.FAB.MapButton" parent="@style/Widget.Material3.FloatingActionButton.Primary">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="shapeAppearance">@style/ShapeAppearanceOverlay.Material3.FloatingActionButton</item>
|
||||
<item name="backgroundTint">?menuBackground</item>
|
||||
<item name="tint">?iconTint</item>
|
||||
<item name="fabCustomSize">@dimen/map_button_size</item>
|
||||
<item name="maxImageSize">@dimen/map_button_icon_size</item>
|
||||
<item name="elevation">0dp</item>
|
||||
<item name="pressedTranslationZ">0dp</item>
|
||||
<item name="hoveredFocusedTranslationZ">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.M3.FAB.MapButton.Square">
|
||||
<item name="backgroundTint">?menuBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<item name="android:textColorSecondary">@color/text_dark_subtitle</item>
|
||||
<item name="android:windowBackground">?windowBackgroundForced</item>
|
||||
<item name="android:colorPrimaryDark">@color/bg_primary_dark</item>
|
||||
<item name="colorPrimaryVariant">@color/bg_primary_dark</item>
|
||||
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
|
||||
<item name="android:fontFamily">@string/robotoRegular</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
@@ -30,7 +29,6 @@
|
||||
<item name="colorPrimary">@color/bg_primary</item>
|
||||
<item name="colorControlNormal">?secondary</item>
|
||||
<item name="colorAccent">@color/base_accent</item>
|
||||
<item name="colorSecondary">@color/base_accent</item>
|
||||
<item name="colorAccentTransparent">@color/base_accent_transparent</item>
|
||||
<item name="colorBtnHighlight">@color/white_38</item>
|
||||
<item name="panel">@color/bg_panel</item>
|
||||
@@ -132,6 +130,13 @@
|
||||
<item name="bottomSheetStyle">@style/MwmWidget.BottomSheet</item>
|
||||
<!-- Theme used for bottom sheet dialog components -->
|
||||
<item name="bottomSheetDialogTheme">@style/MwmTheme.BottomSheetDialog</item>
|
||||
|
||||
<!-- M3 colors -->
|
||||
<item name="colorPrimaryVariant">@color/bg_primary_dark</item>
|
||||
<item name="colorSecondary">@color/base_accent</item>
|
||||
<item name="colorPrimaryContainer">?colorSecondary</item>
|
||||
<item name="colorOnPrimaryContainer">?android:textColorPrimaryInverse</item>
|
||||
|
||||
</style>
|
||||
|
||||
<!-- Night theme -->
|
||||
@@ -148,7 +153,6 @@
|
||||
<item name="android:textColorSecondary">@color/text_light_subtitle</item>
|
||||
<item name="android:windowBackground">?windowBackgroundForced</item>
|
||||
<item name="android:colorPrimaryDark">@color/bg_primary_dark_night</item>
|
||||
<item name="colorPrimaryVariant">@color/bg_primary_dark_night</item>
|
||||
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
|
||||
<item name="android:fontFamily">@string/robotoRegular</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
@@ -166,7 +170,6 @@
|
||||
<item name="colorPrimary">@color/bg_primary_night</item>
|
||||
<item name="colorControlNormal">?secondary</item>
|
||||
<item name="colorAccent">@color/base_accent_night</item>
|
||||
<item name="colorSecondary">@color/base_accent_night</item>
|
||||
<item name="colorAccentTransparent">@color/base_accent_transparent</item>
|
||||
<item name="colorBtnHighlight">@color/white_24</item>
|
||||
<item name="panel">@color/bg_panel_night</item>
|
||||
@@ -252,6 +255,12 @@
|
||||
|
||||
<item name="bottomSheetStyle">@style/MwmWidget.BottomSheet</item>
|
||||
<item name="bottomSheetDialogTheme">@style/MwmTheme.BottomSheetDialog</item>
|
||||
|
||||
<!-- M3 colors -->
|
||||
<item name="colorPrimaryVariant">@color/bg_primary_dark_night</item>
|
||||
<item name="colorSecondary">@color/base_accent_night</item>
|
||||
<item name="colorPrimaryContainer">?colorSecondary</item>
|
||||
<item name="colorOnPrimaryContainer">?android:textColorPrimaryInverse</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme" parent="MwmTheme.Base"/>
|
||||
|
||||
Reference in New Issue
Block a user