mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 21:13:35 +00:00
[android] Migrate Manage route and save buttons to Material Components
Signed-off-by: jeanbaptisteC <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
committed by
Konstantin Pastbin
parent
beac6aa7bc
commit
9425138782
@@ -45,6 +45,8 @@ import app.organicmaps.util.UiUtils;
|
|||||||
import app.organicmaps.util.Utils;
|
import app.organicmaps.util.Utils;
|
||||||
import app.organicmaps.widget.recycler.DotDividerItemDecoration;
|
import app.organicmaps.widget.recycler.DotDividerItemDecoration;
|
||||||
import app.organicmaps.widget.recycler.MultilineLayoutManager;
|
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.imageview.ShapeableImageView;
|
||||||
import com.google.android.material.textview.MaterialTextView;
|
import com.google.android.material.textview.MaterialTextView;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
@@ -153,10 +155,10 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||||||
mTransitViewDecorator =
|
mTransitViewDecorator =
|
||||||
new DotDividerItemDecoration(dividerDrawable, res.getDimensionPixelSize(R.dimen.margin_base),
|
new DotDividerItemDecoration(dividerDrawable, res.getDimensionPixelSize(R.dimen.margin_base),
|
||||||
res.getDimensionPixelSize(R.dimen.margin_half));
|
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);
|
manageRouteButton.setOnClickListener(this);
|
||||||
|
|
||||||
Button saveButton = altitudeChartFrame.findViewById(R.id.btn__save);
|
MaterialButton saveButton = altitudeChartFrame.findViewById(R.id.btn__save);
|
||||||
saveButton.setOnClickListener(this);
|
saveButton.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +170,7 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||||||
showRouteAltitudeChart();
|
showRouteAltitudeChart();
|
||||||
showRoutingDetails();
|
showRoutingDetails();
|
||||||
UiUtils.show(mAltitudeChartFrame);
|
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.setText(R.string.save);
|
||||||
saveButton.setEnabled(true);
|
saveButton.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/altitude_chart_panel"
|
android:id="@+id/altitude_chart_panel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -63,17 +64,19 @@
|
|||||||
tools:text="5 h 55 min • 1555km"
|
tools:text="5 h 55 min • 1555km"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<Button
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn__manage_route"
|
android:id="@+id/btn__manage_route"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="6dp"
|
||||||
style="@style/MwmWidget.Button"
|
style="@style/MwmWidget.Button"
|
||||||
android:text="@string/planning_route_manage_route"
|
android:text="@string/planning_route_manage_route"
|
||||||
android:drawableStart="@drawable/ic_manage_route"
|
android:textColor="?android:textColorPrimary"
|
||||||
android:drawablePadding="6dp"/>
|
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:id="@+id/btn__save"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -82,7 +85,8 @@
|
|||||||
android:layout_marginStart="@dimen/margin_base"
|
android:layout_marginStart="@dimen/margin_base"
|
||||||
android:minHeight="@dimen/primary_button_min_height"
|
android:minHeight="@dimen/primary_button_min_height"
|
||||||
style="@style/MwmWidget.Button"
|
style="@style/MwmWidget.Button"
|
||||||
android:text="@string/save"/>
|
android:text="@string/save"
|
||||||
|
android:textColor="?android:textColorPrimary"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/start"
|
android:id="@+id/start"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/altitude_chart_panel"
|
android:id="@+id/altitude_chart_panel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -82,24 +83,27 @@
|
|||||||
android:layout_weight="10"
|
android:layout_weight="10"
|
||||||
android:layout_gravity="center_vertical" />
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
<Button
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn__manage_route"
|
android:id="@+id/btn__manage_route"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="6dp"
|
||||||
style="@style/MwmWidget.Button"
|
style="@style/MwmWidget.Button"
|
||||||
android:text="@string/planning_route_manage_route"
|
android:text="@string/planning_route_manage_route"
|
||||||
android:drawableStart="@drawable/ic_manage_route"
|
android:textColor="?android:textColorPrimary"
|
||||||
android:drawablePadding="6dp"/>
|
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:id="@+id/btn__save"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/margin_base"
|
android:layout_marginStart="@dimen/margin_base"
|
||||||
style="@style/MwmWidget.Button"
|
style="@style/MwmWidget.Button"
|
||||||
android:minHeight="@dimen/primary_button_min_height"
|
android:minHeight="@dimen/primary_button_min_height"
|
||||||
android:text="@string/save"/>
|
android:text="@string/save"
|
||||||
|
android:textColor="?android:textColorPrimary"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/start"
|
android:id="@+id/start"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/altitude_chart_panel"
|
android:id="@+id/altitude_chart_panel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -88,17 +89,20 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center_vertical" >
|
android:gravity="center_vertical" >
|
||||||
<Button
|
<com.google.android.material.button.MaterialButton
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:id="@+id/btn__manage_route"
|
android:id="@+id/btn__manage_route"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/MwmWidget.Button"
|
style="@style/MwmWidget.Button"
|
||||||
android:text="@string/planning_route_manage_route"
|
android:text="@string/planning_route_manage_route"
|
||||||
android:drawableStart="@drawable/ic_manage_route"
|
android:textColor="?android:textColorPrimary"
|
||||||
android:drawablePadding="@dimen/margin_quarter_plus"/>
|
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:layout_weight="0"
|
||||||
android:id="@+id/btn__save"
|
android:id="@+id/btn__save"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -106,7 +110,8 @@
|
|||||||
style="@style/MwmWidget.Button"
|
style="@style/MwmWidget.Button"
|
||||||
android:layout_marginStart="@dimen/margin_base"
|
android:layout_marginStart="@dimen/margin_base"
|
||||||
android:minHeight="@dimen/primary_button_min_height"
|
android:minHeight="@dimen/primary_button_min_height"
|
||||||
android:text="@string/save"/>
|
android:text="@string/save"
|
||||||
|
android:textColor="?android:textColorPrimary"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user