mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-29 09:13:46 +00:00
[android] Simplify toolbar styles and themes
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
@@ -196,7 +196,7 @@ public final class UiUtils
|
||||
public static void showHomeUpButton(MaterialToolbar toolbar)
|
||||
{
|
||||
toolbar.setNavigationIcon(
|
||||
ThemeUtils.getResource(toolbar.getContext(), androidx.appcompat.R.attr.homeAsUpIndicator));
|
||||
UiUtils.getStyledResourceId(toolbar.getContext(), androidx.appcompat.R.attr.homeAsUpIndicator));
|
||||
}
|
||||
|
||||
// this method returns the total height of the display (in pixels) including notch and other touchable areas
|
||||
|
||||
@@ -6,14 +6,7 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/MwmWidget.ToolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end|center_vertical"
|
||||
android:theme="@style/MwmWidget.ToolbarTheme">
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
<include layout="@layout/toolbar_default"/>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/margin_half_double_plus"
|
||||
android:orientation="horizontal"
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
android:layout_alignParentStart="true"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
app:srcCompat="?homeAsUpIndicator"
|
||||
android:scaleType="center"
|
||||
tools:src="@drawable/ic_expand_more" />
|
||||
android:scaleType="center" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/route_type"
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/MwmWidget.ToolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/MwmWidget.ToolbarTheme.DownButton"/>
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
app:srcCompat="?homeAsUpIndicator"
|
||||
android:scaleType="center"
|
||||
tools:src="@drawable/ic_expand_more"
|
||||
android:contentDescription="@string/back"/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?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.ToolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/MwmWidget.ToolbarTheme.Transparent"/>
|
||||
@@ -148,11 +148,6 @@
|
||||
<item name="buttonGravity">center_vertical</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.ToolbarStyle.Light">
|
||||
<item name="android:titleTextAppearance">@style/MwmTextAppearance.Toolbar.Title.Light</item>
|
||||
<item name="titleTextAppearance">@style/MwmTextAppearance.Toolbar.Title.Light</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.ToolbarStyle.NoElevation">
|
||||
<item name="android:elevation">0dp</item>
|
||||
</style>
|
||||
@@ -164,29 +159,6 @@
|
||||
<item name="iconTint">@color/white_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.ToolbarTheme.Light" parent="MwmWidget.ToolbarTheme">
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="colorAccent">@android:color/white</item>
|
||||
<item name="colorSecondary">#FF32363A</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.ToolbarTheme.Transparent" parent="ThemeOverlay.Material3.Dark.ActionBar">
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="colorAccent">@android:color/white</item>
|
||||
<item name="colorSecondary">@android:color/white</item>
|
||||
<item name="android:windowActionBarOverlay">true</item>
|
||||
<item name="windowActionBarOverlay">true</item>
|
||||
</style>
|
||||
|
||||
<style
|
||||
name="MwmWidget.ToolbarTheme.DownButton"
|
||||
parent="ThemeOverlay.Material3.Dark.ActionBar">
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="colorAccent">@android:color/white</item>
|
||||
<item name="colorSecondary">@android:color/white</item>
|
||||
<item name="android:homeAsUpIndicator">@drawable/ic_expand_more</item>
|
||||
</style>
|
||||
|
||||
<style name="MwmWidget.ListView" parent="android:Widget.Material.ListView">
|
||||
<item name="android:fadingEdge">none</item>
|
||||
<item name="android:divider">@color/divider</item>
|
||||
|
||||
Reference in New Issue
Block a user