diff --git a/android/res/drawable-hdpi/ic_follow.webp b/android/res/drawable-hdpi/ic_follow.webp deleted file mode 100644 index 5b926848ae..0000000000 Binary files a/android/res/drawable-hdpi/ic_follow.webp and /dev/null differ diff --git a/android/res/drawable-hdpi/ic_follow_and_rotate.webp b/android/res/drawable-hdpi/ic_follow_and_rotate.webp deleted file mode 100644 index 219c36e628..0000000000 Binary files a/android/res/drawable-hdpi/ic_follow_and_rotate.webp and /dev/null differ diff --git a/android/res/drawable-hdpi/ic_not_follow.webp b/android/res/drawable-hdpi/ic_not_follow.webp deleted file mode 100644 index e56bdbc15d..0000000000 Binary files a/android/res/drawable-hdpi/ic_not_follow.webp and /dev/null differ diff --git a/android/res/drawable-mdpi/ic_follow.webp b/android/res/drawable-mdpi/ic_follow.webp deleted file mode 100644 index f57a1f63f8..0000000000 Binary files a/android/res/drawable-mdpi/ic_follow.webp and /dev/null differ diff --git a/android/res/drawable-mdpi/ic_follow_and_rotate.webp b/android/res/drawable-mdpi/ic_follow_and_rotate.webp deleted file mode 100644 index a4c0462d0d..0000000000 Binary files a/android/res/drawable-mdpi/ic_follow_and_rotate.webp and /dev/null differ diff --git a/android/res/drawable-mdpi/ic_not_follow.webp b/android/res/drawable-mdpi/ic_not_follow.webp deleted file mode 100644 index 19e5b8ae90..0000000000 Binary files a/android/res/drawable-mdpi/ic_not_follow.webp and /dev/null differ diff --git a/android/res/drawable-xhdpi/ic_follow.webp b/android/res/drawable-xhdpi/ic_follow.webp deleted file mode 100644 index 43cdf0b63b..0000000000 Binary files a/android/res/drawable-xhdpi/ic_follow.webp and /dev/null differ diff --git a/android/res/drawable-xhdpi/ic_follow_and_rotate.webp b/android/res/drawable-xhdpi/ic_follow_and_rotate.webp deleted file mode 100644 index fac546e970..0000000000 Binary files a/android/res/drawable-xhdpi/ic_follow_and_rotate.webp and /dev/null differ diff --git a/android/res/drawable-xhdpi/ic_not_follow.webp b/android/res/drawable-xhdpi/ic_not_follow.webp deleted file mode 100644 index 55fcbe7eda..0000000000 Binary files a/android/res/drawable-xhdpi/ic_not_follow.webp and /dev/null differ diff --git a/android/res/drawable-xxhdpi/ic_follow.webp b/android/res/drawable-xxhdpi/ic_follow.webp deleted file mode 100644 index 805c3bc658..0000000000 Binary files a/android/res/drawable-xxhdpi/ic_follow.webp and /dev/null differ diff --git a/android/res/drawable-xxhdpi/ic_follow_and_rotate.webp b/android/res/drawable-xxhdpi/ic_follow_and_rotate.webp deleted file mode 100644 index d607c07685..0000000000 Binary files a/android/res/drawable-xxhdpi/ic_follow_and_rotate.webp and /dev/null differ diff --git a/android/res/drawable-xxhdpi/ic_not_follow.webp b/android/res/drawable-xxhdpi/ic_not_follow.webp deleted file mode 100644 index 5bb259728d..0000000000 Binary files a/android/res/drawable-xxhdpi/ic_not_follow.webp and /dev/null differ diff --git a/android/res/drawable-xxxhdpi/ic_follow.webp b/android/res/drawable-xxxhdpi/ic_follow.webp deleted file mode 100644 index ef3563cb1f..0000000000 Binary files a/android/res/drawable-xxxhdpi/ic_follow.webp and /dev/null differ diff --git a/android/res/drawable-xxxhdpi/ic_follow_and_rotate.webp b/android/res/drawable-xxxhdpi/ic_follow_and_rotate.webp deleted file mode 100644 index 46ab6efd34..0000000000 Binary files a/android/res/drawable-xxxhdpi/ic_follow_and_rotate.webp and /dev/null differ diff --git a/android/res/drawable-xxxhdpi/ic_not_follow.webp b/android/res/drawable-xxxhdpi/ic_not_follow.webp deleted file mode 100644 index a0d85501fa..0000000000 Binary files a/android/res/drawable-xxxhdpi/ic_not_follow.webp and /dev/null differ diff --git a/android/res/drawable/bg_circle.xml b/android/res/drawable/bg_circle.xml deleted file mode 100644 index 3f3b877daf..0000000000 --- a/android/res/drawable/bg_circle.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/android/res/drawable/bg_circle_night.xml b/android/res/drawable/bg_circle_night.xml deleted file mode 100644 index d6f2193191..0000000000 --- a/android/res/drawable/bg_circle_night.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/android/res/drawable/bg_circle_pressed.xml b/android/res/drawable/bg_circle_pressed.xml deleted file mode 100644 index d96c5d921a..0000000000 --- a/android/res/drawable/bg_circle_pressed.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/android/res/drawable/bg_circle_pressed_night.xml b/android/res/drawable/bg_circle_pressed_night.xml deleted file mode 100644 index f3ab612445..0000000000 --- a/android/res/drawable/bg_circle_pressed_night.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/android/res/drawable/bg_crown.xml b/android/res/drawable/bg_crown.xml deleted file mode 100644 index df34356d6c..0000000000 --- a/android/res/drawable/bg_crown.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/android/res/drawable/bg_crown_night.xml b/android/res/drawable/bg_crown_night.xml deleted file mode 100644 index 8e39462ade..0000000000 --- a/android/res/drawable/bg_crown_night.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/android/res/drawable/button_navigation_circle.xml b/android/res/drawable/button_navigation_circle.xml deleted file mode 100644 index 96536e113e..0000000000 --- a/android/res/drawable/button_navigation_circle.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/android/res/drawable/button_navigation_circle_night.xml b/android/res/drawable/button_navigation_circle_night.xml deleted file mode 100644 index 64e1bcd58c..0000000000 --- a/android/res/drawable/button_navigation_circle_night.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/android/res/drawable/ic_bookmarks.xml b/android/res/drawable/ic_bookmarks.xml new file mode 100644 index 0000000000..954e7723b3 --- /dev/null +++ b/android/res/drawable/ic_bookmarks.xml @@ -0,0 +1,5 @@ + + + diff --git a/android/res/drawable/ic_follow.xml b/android/res/drawable/ic_follow.xml new file mode 100644 index 0000000000..e14a53b610 --- /dev/null +++ b/android/res/drawable/ic_follow.xml @@ -0,0 +1,5 @@ + + + diff --git a/android/res/drawable/ic_follow_and_rotate.xml b/android/res/drawable/ic_follow_and_rotate.xml new file mode 100644 index 0000000000..d9510afe89 --- /dev/null +++ b/android/res/drawable/ic_follow_and_rotate.xml @@ -0,0 +1,5 @@ + + + diff --git a/android/res/drawable/ic_not_follow.xml b/android/res/drawable/ic_not_follow.xml new file mode 100644 index 0000000000..859760018c --- /dev/null +++ b/android/res/drawable/ic_not_follow.xml @@ -0,0 +1,5 @@ + + + diff --git a/android/res/drawable/ic_search.xml b/android/res/drawable/ic_search.xml new file mode 100644 index 0000000000..e2dd96c6d0 --- /dev/null +++ b/android/res/drawable/ic_search.xml @@ -0,0 +1,5 @@ + + + diff --git a/android/res/layout-land/layout_nav_search.xml b/android/res/layout-land/layout_nav_search.xml index ecf5d9ee3c..a2aed3137d 100644 --- a/android/res/layout-land/layout_nav_search.xml +++ b/android/res/layout-land/layout_nav_search.xml @@ -5,70 +5,73 @@ android:id="@+id/search_button_frame" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:theme="?navButtonsTheme" - android:padding="@dimen/nav_frame_padding" + android:clipChildren="false" + android:clipToPadding="false" android:layoutDirection="ltr" + android:padding="@dimen/nav_frame_padding" + android:theme="?navButtonsTheme" tools:background="@color/bg_primary"> - - - + android:layout_marginBottom="@dimen/margin_half" + android:contentDescription="@string/bookmarks" + android:src="@drawable/ic_bookmarks" /> - - - - + - - + - - + - - + - + style="@style/MwmWidget.MapButton.Search" + android:layout_gravity="center_vertical" + android:layout_marginStart="@dimen/margin_half" + android:contentDescription="@string/atm" + android:src="@drawable/ic_routing_atm_on" /> - - - + android:contentDescription="@string/search" + android:src="@drawable/ic_search" /> diff --git a/android/res/layout-land/map_navigation_buttons.xml b/android/res/layout-land/map_navigation_buttons.xml index 5a60328b33..f39dbb27cc 100644 --- a/android/res/layout-land/map_navigation_buttons.xml +++ b/android/res/layout-land/map_navigation_buttons.xml @@ -18,6 +18,8 @@ android:layout_height="match_parent" android:layout_marginTop="@dimen/menu_line_height" android:layout_marginBottom="@dimen/menu_line_height" + android:clipChildren="false" + android:clipToPadding="false" android:layoutDirection="ltr" android:padding="@dimen/nav_frame_padding" android:theme="?navButtonsTheme"> @@ -25,42 +27,29 @@ layout="@layout/layout_nav_search" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/margin_base" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" tools:visibility="visible" /> - - - - - + - - - - + android:layout_marginBottom="@dimen/margin_half" + android:contentDescription="@string/bookmarks" + android:src="@drawable/ic_bookmarks" /> - - - - - - - - - - + + + + - + android:layout_marginStart="@dimen/margin_half_plus" + android:layout_marginBottom="@dimen/margin_half" + android:contentDescription="@string/atm" + android:src="@drawable/ic_routing_atm_on" /> - - - + android:contentDescription="@string/search" + android:src="@drawable/ic_search" /> diff --git a/android/res/layout/map_navigation_buttons.xml b/android/res/layout/map_navigation_buttons.xml index 2a539aa4cf..944c89a5b9 100644 --- a/android/res/layout/map_navigation_buttons.xml +++ b/android/res/layout/map_navigation_buttons.xml @@ -18,6 +18,8 @@ android:layout_height="match_parent" android:layout_marginTop="@dimen/action_bar_extended_height" android:layout_marginBottom="@dimen/nav_my_position_bottom" + android:clipChildren="false" + android:clipToPadding="false" android:layoutDirection="ltr" android:padding="@dimen/nav_frame_padding" android:theme="?navButtonsTheme"> @@ -25,41 +27,27 @@ layout="@layout/layout_nav_search" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/margin_base" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" tools:visibility="visible" /> - - - - - + - + + + + \ No newline at end of file diff --git a/android/res/values/dimens.xml b/android/res/values/dimens.xml index 7c862f3b81..32764bdb35 100644 --- a/android/res/values/dimens.xml +++ b/android/res/values/dimens.xml @@ -138,7 +138,7 @@ 64dp 360dp - @dimen/margin_eighth + @dimen/margin_half 136dp 12dp diff --git a/android/res/values/styles.xml b/android/res/values/styles.xml index 225a6be7ac..c1713fb780 100644 --- a/android/res/values/styles.xml +++ b/android/res/values/styles.xml @@ -9,12 +9,18 @@ + + - - diff --git a/android/src/com/mapswithme/maps/maplayer/MapButtonsController.java b/android/src/com/mapswithme/maps/maplayer/MapButtonsController.java index ced4f90a63..ab36314af2 100644 --- a/android/src/com/mapswithme/maps/maplayer/MapButtonsController.java +++ b/android/src/com/mapswithme/maps/maplayer/MapButtonsController.java @@ -1,22 +1,20 @@ package com.mapswithme.maps.maplayer; +import android.content.res.TypedArray; import android.os.Bundle; import android.view.View; -import android.widget.ImageButton; -import android.widget.ImageView; import android.widget.RelativeLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; -import androidx.constraintlayout.widget.ConstraintLayout; +import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.mapswithme.maps.R; import com.mapswithme.maps.routing.RoutingController; import com.mapswithme.maps.routing.SearchWheel; import com.mapswithme.maps.widget.menu.MyPositionButton; import com.mapswithme.maps.widget.placepage.PlacePageController; import com.mapswithme.util.Config; -import com.mapswithme.util.Graphics; import com.mapswithme.util.UiUtils; public class MapButtonsController @@ -26,7 +24,7 @@ public class MapButtonsController @NonNull private final View mZoomFrame; @NonNull - private final ImageButton mLayersButton; + private final FloatingActionButton mLayersButton; @NonNull private final View myPosition; @NonNull @@ -39,8 +37,7 @@ public class MapButtonsController private final SearchWheel mSearchWheel; private final PlacePageController mPlacePageController; private final float mBottomMargin; - private final int mButtonWidth; - private final float mInitialButtonMargin; + private final float mButtonWidth; private float mTopLimit; private float mContentHeight; private float mContentWidth; @@ -63,15 +60,18 @@ public class MapButtonsController mSearchButtonFrame = activity.findViewById(R.id.search_button_frame); mSearchWheel = new SearchWheel(frame, (v) -> mapButtonClickListener.onClick(MapButtons.navSearch)); - ImageView bookmarkButton = mSearchButtonFrame.findViewById(R.id.btn_bookmarks); - bookmarkButton.setOnClickListener((v) -> mapButtonClickListener.onClick(MapButtons.navBookmarks)); - bookmarkButton.setImageDrawable(Graphics.tint(bookmarkButton.getContext(), R.drawable.ic_menu_bookmarks)); + mSearchButtonFrame.findViewById(R.id.btn_bookmarks) + .setOnClickListener((v) -> mapButtonClickListener.onClick(MapButtons.navBookmarks)); // Used to get the maximum height the buttons will evolve in frame.addOnLayoutChangeListener(new MapButtonsController.ContentViewLayoutChangeListener(frame)); mBottomMargin = ((RelativeLayout.LayoutParams) mButtonsFrame.getLayoutParams()).bottomMargin; - mInitialButtonMargin = ((ConstraintLayout.LayoutParams) mZoomFrame.getLayoutParams()).bottomMargin; - mButtonWidth = mLayersButton.getLayoutParams().width; + + TypedArray a = frame.getContext().getTheme().obtainStyledAttributes( + R.style.MwmWidget_MapButton, + new int[] { R.attr.fabCustomSize }); + mButtonWidth = a.getDimension(0, 0); + a.recycle(); } public void showButton(boolean show, MapButtonsController.MapButtons button) @@ -109,15 +109,6 @@ public class MapButtonsController final float appliedTranslation = translation <= 0 ? translation : 0; mButtonsFrame.setTranslationY(appliedTranslation); - // Reduce buttons margin to move them only if necessary - // Zoom frame is above the layers so if must move twice as much - final float appliedMarginTranslationLayers = Math.min(-appliedTranslation, mInitialButtonMargin); - final float maxZoomTranslation = UiUtils.isVisible(mLayersButton) ? 2 * mInitialButtonMargin : mInitialButtonMargin; - final float appliedMarginTranslationZoomFrame = Math.min(-appliedTranslation, maxZoomTranslation); - mLayersButton.setTranslationY(appliedMarginTranslationLayers); - mSearchButtonFrame.setTranslationY(appliedMarginTranslationLayers); - mZoomFrame.setTranslationY(appliedMarginTranslationZoomFrame); - updateButtonsVisibility(appliedTranslation); } diff --git a/android/src/com/mapswithme/maps/widget/menu/MyPositionButton.java b/android/src/com/mapswithme/maps/widget/menu/MyPositionButton.java index 37f97c2050..fe02ffb6cc 100644 --- a/android/src/com/mapswithme/maps/widget/menu/MyPositionButton.java +++ b/android/src/com/mapswithme/maps/widget/menu/MyPositionButton.java @@ -8,6 +8,7 @@ import android.widget.ImageView; import androidx.annotation.NonNull; +import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.mapswithme.maps.R; import com.mapswithme.maps.location.LocationState; import com.mapswithme.maps.routing.RoutingController; @@ -20,7 +21,7 @@ public class MyPositionButton private static final int FOLLOW_SHIFT = 1; @NonNull - private final ImageView mButton; + private final FloatingActionButton mButton; private static final SparseArray mIcons = new SparseArray<>(); // Location mode -> Button icon private int mMode; @@ -30,7 +31,7 @@ public class MyPositionButton public MyPositionButton(@NonNull View button, @NonNull View.OnClickListener listener) { - mButton = (ImageView) button; + mButton = (FloatingActionButton) button; mVisible = UiUtils.isVisible(mButton); mButton.setOnClickListener(listener); mIcons.clear();