[android] try to match previous map buttons layout

Signed-off-by: Arnaud Vergnet <arnaud.vergnet@mailo.com>
This commit is contained in:
Arnaud Vergnet 2022-08-12 17:12:17 +02:00 committed by Roman Tsisyk
parent 7f93677763
commit 1e08577dd1
16 changed files with 92 additions and 56 deletions

View file

@ -65,7 +65,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/margin_half"
android:layout_marginBottom="@dimen/zoom_buttons_margin"
app:layout_constraintBottom_toTopOf="@+id/my_position"
app:layout_constraintEnd_toEndOf="parent" />
<include

View file

@ -49,7 +49,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/margin_half"
android:layout_marginBottom="@dimen/zoom_buttons_margin"
app:layout_constraintBottom_toTopOf="@+id/my_position"
app:layout_constraintEnd_toEndOf="parent" />
<include

View file

@ -10,7 +10,7 @@
tools:background="@color/bg_primary">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/map_buttons_top"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="@dimen/margin_double"
@ -30,9 +30,9 @@
android:id="@+id/map_buttons_inner_right"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_above="@id/map_buttons_bottom"
android:layout_below="@id/map_buttons_top"
android:layout_alignParentEnd="true"
android:layout_marginTop="@dimen/action_bar_extended_height"
android:layout_marginBottom="@dimen/map_buttons_bottom_margin"
android:clipChildren="false"
android:clipToPadding="false"
android:padding="@dimen/nav_frame_padding">
@ -41,7 +41,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/margin_half"
android:layout_marginBottom="@dimen/zoom_buttons_margin"
app:layout_constraintBottom_toTopOf="@+id/my_position"
app:layout_constraintEnd_toEndOf="parent" />
<include
@ -61,13 +61,6 @@
android:clipToPadding="false"
android:layoutDirection="ltr"
android:padding="@dimen/nav_frame_padding">
<include
layout="@layout/map_buttons_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<include
layout="@layout/map_buttons_help"
android:layout_width="wrap_content"
@ -75,21 +68,30 @@
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/margin_half"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/menu_button" />
app:layout_constraintStart_toStartOf="parent" />
<include
layout="@layout/map_buttons_bookmarks"
layout="@layout/map_buttons_search_square"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/help_button"
app:layout_constraintEnd_toStartOf="@+id/btn_bookmarks" />
<include
layout="@layout/map_buttons_bookmarks_square"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/btn_search"
app:layout_constraintEnd_toStartOf="@+id/menu_button" />
<include
layout="@layout/map_buttons_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginEnd="@dimen/margin_half"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/btn_search" />
<include
layout="@layout/map_buttons_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>

View file

@ -7,7 +7,6 @@
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:elevation="6dp"
android:layoutDirection="ltr"
android:theme="?navButtonsThemeRound">
<RelativeLayout
@ -17,7 +16,6 @@
android:layout_alignParentStart="true"
android:layout_marginStart="-56dp"
android:background="?searchLayoutBackground"
android:elevation="5dp"
android:visibility="invisible"
tools:visibility="visible">
<com.google.android.material.floatingactionbutton.FloatingActionButton

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.floatingactionbutton.FloatingActionButton
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"
android:contentDescription="@string/bookmarks"
android:src="@drawable/ic_bookmarks" />

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.floatingactionbutton.FloatingActionButton
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"
style="@style/MwmWidget.MapButton.Square"
app:shapeAppearanceOverlay="@style/MwmWidget.MapButton.Square"
android:src="@drawable/ic_question_mark" />

View file

@ -51,6 +51,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/margin_half"
app:layout_constraintStart_toEndOf="@+id/my_position"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<include
@ -58,8 +60,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginEnd="@dimen/margin_half"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/zoom_buttons_container" />
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -10,7 +10,7 @@
tools:background="@color/bg_primary">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/map_buttons_top"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="@dimen/margin_double"
@ -30,9 +30,8 @@
android:id="@+id/map_buttons_inner_right"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_above="@id/map_buttons_bottom"
android:layout_below="@id/map_buttons_top"
android:layout_alignParentEnd="true"
android:layout_marginTop="@dimen/action_bar_extended_height"
android:layout_marginBottom="@dimen/nav_menu_height" android:layout_alignParentEnd="true"
android:clipChildren="false"
android:clipToPadding="false"
android:padding="@dimen/nav_frame_padding">
@ -41,16 +40,16 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="@dimen/margin_half"
app:layout_constraintBottom_toTopOf="@+id/my_position"
app:layout_constraintEnd_toEndOf="parent" />
<include
layout="@layout/map_buttons_myposition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginEnd="@dimen/margin_half"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/zoom_buttons_container" />
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/map_buttons_bottom"
@ -61,13 +60,6 @@
android:clipToPadding="false"
android:layoutDirection="ltr"
android:padding="@dimen/nav_frame_padding">
<include
layout="@layout/map_buttons_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<include
layout="@layout/map_buttons_help"
android:layout_width="wrap_content"
@ -75,21 +67,30 @@
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/margin_half"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/menu_button" />
app:layout_constraintStart_toStartOf="parent" />
<include
layout="@layout/map_buttons_bookmarks"
layout="@layout/map_buttons_search_square"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/help_button"
app:layout_constraintEnd_toStartOf="@+id/btn_bookmarks" />
<include
layout="@layout/map_buttons_bookmarks_square"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/btn_search"
app:layout_constraintEnd_toStartOf="@+id/menu_button" />
<include
layout="@layout/map_buttons_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginEnd="@dimen/margin_half"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/btn_search" />
<include
layout="@layout/map_buttons_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.floatingactionbutton.FloatingActionButton
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"
style="@style/MwmWidget.MapButton.Square"
app:shapeAppearanceOverlay="@style/MwmWidget.MapButton.Square"
android:src="@drawable/ic_menu_open" />

View file

@ -7,7 +7,6 @@
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:elevation="6dp"
android:layoutDirection="ltr"
android:theme="?navButtonsThemeRect">
<LinearLayout
@ -16,7 +15,6 @@
android:layout_height="48dp"
android:layout_alignParentStart="true"
android:background="?searchLayoutBackground"
android:elevation="5dp"
android:orientation="horizontal"
android:padding="@dimen/margin_quarter"
android:visibility="invisible"

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.floatingactionbutton.FloatingActionButton
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"
android:contentDescription="@string/search"
android:src="@drawable/ic_search" />

View file

@ -85,6 +85,8 @@
<color name="bg_menu">#CCFFFFFF</color>
<color name="bg_menu_night">#CC2D3237</color>
<color name="bg_map_button">#99FFFFFF</color>
<color name="bg_map_button_night">#992D3237</color>
<color name="bg_statusbar">#197841</color>
<color name="bg_statusbar_night">#14181C</color>

View file

@ -139,6 +139,7 @@
<dimen name="nav_menu_landscape_width">360dp</dimen>
<dimen name="nav_frame_padding">@dimen/margin_half</dimen>
<dimen name="zoom_buttons_margin">64dp</dimen>
<dimen name="map_buttons_bottom_margin">136dp</dimen>
<dimen name="panel_elevation">12dp</dimen>

View file

@ -12,10 +12,13 @@
<style name="MwmWidget.MapButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:backgroundTint">?cardBackground</item>
<item name="android:alpha">0.8</item>
<item name="android:backgroundTint">?mapButtonBackground</item>
<item name="elevation">0dp</item>
<item name="hoveredFocusedTranslationZ">0dp</item>
<item name="pressedTranslationZ">0dp</item>
<item name="android:tint">?iconTint</item>
<item name="fabCustomSize">48dp</item>
<item name="maxImageSize">28dp</item>
<item name="borderWidth">0dp</item>
</style>
@ -23,6 +26,12 @@
<item name="fabCustomSize">38dp</item>
</style>
<style name="MwmWidget.MapButton.Square">
<item name="android:backgroundTint">?menuBackground</item>
<item name="cornerFamily">rounded</item>
<item name="cornerSize">10dp</item>
</style>
<style name="MwmWidget.Button">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>

View file

@ -43,6 +43,7 @@
<attr name="primaryButtonBackground" format="reference" />
<attr name="circleAccent" format="reference" />
<attr name="menuBackground" format="color" />
<attr name="mapButtonBackground" format="color" />
<attr name="myPositionButtonAnimation" format="reference" />
<attr name="wheelPendingAnimation" format="reference" />
<attr name="trafficLoadingAnimation" format="reference" />

View file

@ -71,6 +71,7 @@
<item name="circleAccent">@drawable/circle_accent</item>
<item name="menuBackground">@color/bg_menu</item>
<item name="mapButtonBackground">@color/bg_map_button</item>
<item name="myPositionButtonAnimation">@drawable/anim_myposition_pending</item>
<item name="wheelPendingAnimation">@drawable/anim_spinner_pending</item>
@ -248,6 +249,7 @@
<item name="circleAccent">@drawable/circle_accent_night</item>
<item name="menuBackground">@color/bg_menu_night</item>
<item name="mapButtonBackground">@color/bg_map_button_night</item>
<item name="myPositionButtonAnimation">@drawable/anim_myposition_pending_night</item>
<item name="wheelPendingAnimation">@drawable/anim_spinner_pending</item>