mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-15 00:24:23 +00:00
[android] Use M3 top bar in the app
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
@@ -712,7 +712,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
if (!TextUtils.isEmpty(appName))
|
||||
{
|
||||
setTitle(appName);
|
||||
((MaterialTextView) mPointChooser.findViewById(R.id.title)).setText(appName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar_default" />
|
||||
layout="@layout/mtoolbar_default" />
|
||||
<ScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar_default"/>
|
||||
layout="@layout/mtoolbar_default"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_container"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
android:background="?appBackground">
|
||||
|
||||
<include
|
||||
layout="@layout/toolbar_default"/>
|
||||
layout="@layout/mtoolbar_default"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_container"
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
android:layout_height="match_parent">
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/MwmWidget.ToolbarStyle"
|
||||
style="@style/MwmWidget.M3.ToolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/MwmWidget.ToolbarTheme">
|
||||
android:layout_height="wrap_content">
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/save"
|
||||
android:layout_width="?actionBarSize"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:scaleType="centerInside"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
app:srcCompat="@drawable/ic_done"/>
|
||||
app:srcCompat="@drawable/ic_done"
|
||||
app:tint="?iconTint"/>
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:scrollbars="none"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<include layout="@layout/toolbar_default"/>
|
||||
<include layout="@layout/mtoolbar_default"/>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/margin_half_double_plus"
|
||||
android:orientation="horizontal"
|
||||
|
||||
@@ -7,13 +7,12 @@
|
||||
android:background="?appBackground">
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/MwmWidget.ToolbarStyle"
|
||||
style="@style/MwmWidget.M3.ToolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/MwmWidget.ToolbarTheme">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
app:tint="@color/image_view"
|
||||
app:tint="?iconTint"
|
||||
android:id="@+id/save"
|
||||
app:srcCompat="@drawable/ic_done"
|
||||
android:layout_width="?actionBarSize"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar_default" />
|
||||
layout="@layout/mtoolbar_default" />
|
||||
<ScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
8
android/app/src/main/res/layout/mtoolbar_default.xml
Normal file
8
android/app/src/main/res/layout/mtoolbar_default.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/MwmWidget.M3.ToolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize" />
|
||||
@@ -8,24 +8,15 @@
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar_point_chooser"
|
||||
style="@style/MwmWidget.ToolbarStyle"
|
||||
style="@style/MwmWidget.M3.ToolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end|center_vertical"
|
||||
android:theme="@style/MwmWidget.ToolbarTheme"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/margin_half"
|
||||
android:text="@string/editor_add_select_location"
|
||||
android:textAppearance="@style/MwmTextAppearance.Toolbar.Title"/>
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:title="@string/editor_add_select_location"
|
||||
app:titleMargin="@dimen/margin_half"/>
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -368,4 +368,15 @@
|
||||
<item name="cornerSizeTopLeft">50%</item>
|
||||
<item name="cornerSizeTopRight">50%</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.M3.ToolbarStyle" parent="Widget.Material3.Toolbar">
|
||||
<item name="android:background">?appBackground</item>
|
||||
<item name="android:displayOptions">homeAsUp|showTitle</item>
|
||||
<item name="contentInsetStart">0dp</item>
|
||||
<item name="buttonGravity">center_vertical</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmTheme.M3.ToolbarTheme" parent="ThemeOverlay.Material3.Dark.ActionBar">
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user