[android] Migrate Manage route and save buttons to Material Components

Signed-off-by: jeanbaptisteC <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
Jean-Baptiste
2025-08-23 10:46:32 +02:00
committed by Konstantin Pastbin
parent beac6aa7bc
commit 9425138782
4 changed files with 33 additions and 18 deletions

View File

@@ -45,6 +45,8 @@ import app.organicmaps.util.UiUtils;
import app.organicmaps.util.Utils;
import app.organicmaps.widget.recycler.DotDividerItemDecoration;
import app.organicmaps.widget.recycler.MultilineLayoutManager;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textview.MaterialTextView;
import java.util.LinkedList;
@@ -153,10 +155,10 @@ final class RoutingBottomMenuController implements View.OnClickListener
mTransitViewDecorator =
new DotDividerItemDecoration(dividerDrawable, res.getDimensionPixelSize(R.dimen.margin_base),
res.getDimensionPixelSize(R.dimen.margin_half));
Button manageRouteButton = altitudeChartFrame.findViewById(R.id.btn__manage_route);
MaterialButton manageRouteButton = altitudeChartFrame.findViewById(R.id.btn__manage_route);
manageRouteButton.setOnClickListener(this);
Button saveButton = altitudeChartFrame.findViewById(R.id.btn__save);
MaterialButton saveButton = altitudeChartFrame.findViewById(R.id.btn__save);
saveButton.setOnClickListener(this);
}
@@ -168,7 +170,7 @@ final class RoutingBottomMenuController implements View.OnClickListener
showRouteAltitudeChart();
showRoutingDetails();
UiUtils.show(mAltitudeChartFrame);
Button saveButton = mAltitudeChartFrame.findViewById(R.id.btn__save);
MaterialButton saveButton = mAltitudeChartFrame.findViewById(R.id.btn__save);
saveButton.setText(R.string.save);
saveButton.setEnabled(true);
}

View File

@@ -3,6 +3,7 @@
<LinearLayout
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"
android:id="@+id/altitude_chart_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -63,17 +64,19 @@
tools:text="5 h 55 min • 1555km"
tools:visibility="visible" />
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/btn__manage_route"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
style="@style/MwmWidget.Button"
android:text="@string/planning_route_manage_route"
android:drawableStart="@drawable/ic_manage_route"
android:drawablePadding="6dp"/>
android:textColor="?android:textColorPrimary"
app:icon="@drawable/ic_manage_route"
app:iconTint="?android:textColorPrimary"
app:iconPadding="6dp"/>
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/btn__save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -82,7 +85,8 @@
android:layout_marginStart="@dimen/margin_base"
android:minHeight="@dimen/primary_button_min_height"
style="@style/MwmWidget.Button"
android:text="@string/save"/>
android:text="@string/save"
android:textColor="?android:textColorPrimary"/>
<Button
android:id="@+id/start"

View File

@@ -3,6 +3,7 @@
<LinearLayout
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"
android:id="@+id/altitude_chart_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -82,24 +83,27 @@
android:layout_weight="10"
android:layout_gravity="center_vertical" />
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/btn__manage_route"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
style="@style/MwmWidget.Button"
android:text="@string/planning_route_manage_route"
android:drawableStart="@drawable/ic_manage_route"
android:drawablePadding="6dp"/>
android:textColor="?android:textColorPrimary"
app:icon="@drawable/ic_manage_route"
app:iconTint="?android:textColorPrimary"
app:iconPadding="6dp"/>
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/btn__save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_base"
style="@style/MwmWidget.Button"
android:minHeight="@dimen/primary_button_min_height"
android:text="@string/save"/>
android:text="@string/save"
android:textColor="?android:textColorPrimary"/>
<Button
android:id="@+id/start"

View File

@@ -3,6 +3,7 @@
<LinearLayout
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"
android:id="@+id/altitude_chart_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -88,17 +89,20 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical" >
<Button
<com.google.android.material.button.MaterialButton
android:layout_weight="1"
android:id="@+id/btn__manage_route"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/MwmWidget.Button"
android:text="@string/planning_route_manage_route"
android:drawableStart="@drawable/ic_manage_route"
android:drawablePadding="@dimen/margin_quarter_plus"/>
android:textColor="?android:textColorPrimary"
android:textAlignment="viewStart"
app:icon="@drawable/ic_manage_route"
app:iconTint="?android:textColorPrimary"
app:iconPadding="@dimen/margin_quarter_plus"/>
<Button
<com.google.android.material.button.MaterialButton
android:layout_weight="0"
android:id="@+id/btn__save"
android:layout_width="wrap_content"
@@ -106,7 +110,8 @@
style="@style/MwmWidget.Button"
android:layout_marginStart="@dimen/margin_base"
android:minHeight="@dimen/primary_button_min_height"
android:text="@string/save"/>
android:text="@string/save"
android:textColor="?android:textColorPrimary"/>
</LinearLayout>
</LinearLayout>