Default style for Toolbar. Try to cleanup

This commit is contained in:
Benoit Marty 2021-06-10 17:37:38 +02:00 committed by Benoit Marty
parent 992f41d631
commit 5363526f77
33 changed files with 67 additions and 101 deletions

View File

@ -13,7 +13,6 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="4dp"
app:layout_constraintTop_toTopOf="parent" />
<androidx.fragment.app.FragmentContainerView

View File

@ -8,7 +8,6 @@
android:id="@+id/bigImageViewerToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -9,8 +9,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/bugReportToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="4dp" />
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/bug_report_body_view"

View File

@ -13,7 +13,6 @@
android:id="@+id/callTransferToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="4dp"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.tabs.TabLayout

View File

@ -33,6 +33,7 @@
android:id="@+id/emojiPickerToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="0dp"
android:minHeight="0dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap|enterAlways"
tools:title="@string/reactions" />

View File

@ -13,7 +13,6 @@
android:id="@+id/filteredRoomsToolbar"
android:layout_width="0dp"
android:layout_height="?attr/actionBarSize"
android:elevation="4dp"
app:contentInsetStart="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -13,7 +13,6 @@
android:id="@+id/searchToolbar"
android:layout_width="0dp"
android:layout_height="?attr/actionBarSize"
android:elevation="4dp"
app:contentInsetStart="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -9,13 +10,14 @@
android:layout_height="match_parent"
android:orientation="vertical">
<!-- Use VectorToolbarStyleWithPadding on this screen for better alignment with setting items -->
<!-- Use VectorToolbarSettings on this screen for better alignment with setting items -->
<androidx.appcompat.widget.Toolbar
android:id="@+id/settingsToolbar"
style="@style/VectorToolbarStyleWithPadding"
style="@style/VectorToolbarSettings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="4dp" />
tools:navigationIcon="@drawable/ic_back_24dp"
tools:title="Title" />
<FrameLayout
android:id="@+id/vector_settings_page"

View File

@ -10,7 +10,6 @@
android:id="@+id/webview_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="4dp"
app:layout_constraintTop_toTopOf="parent"
tools:title="Title of the web page" />

View File

@ -20,6 +20,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#40000000"
android:elevation="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@ -14,7 +14,6 @@
android:id="@+id/phoneBookToolbar"
android:layout_width="0dp"
android:layout_height="?actionBarSize"
android:elevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

View File

@ -14,7 +14,6 @@
android:id="@+id/createRoomToolbar"
android:layout_width="0dp"
android:layout_height="?actionBarSize"
android:elevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

View File

@ -15,7 +15,6 @@
android:id="@+id/createRoomToolbar"
android:layout_width="0dp"
android:layout_height="?actionBarSize"
android:elevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

View File

@ -10,7 +10,6 @@
android:id="@+id/groupToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">

View File

@ -10,7 +10,6 @@
android:id="@+id/loginWebToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="4dp"
tools:subtitle="https://www.example.org"
tools:title="@string/auth_login" />

View File

@ -24,7 +24,6 @@
android:id="@+id/publicRoomsToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="4dp"
android:minHeight="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -26,7 +26,6 @@
android:id="@+id/addRoomToSpaceToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="4dp"
android:minHeight="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -10,7 +10,6 @@
android:id="@+id/roomToolbar"
android:layout_width="0dp"
android:layout_height="?actionBarSize"
android:elevation="4dp"
android:transitionName="toolbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -38,7 +38,6 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="4dp"
app:layout_collapseMode="pin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -14,8 +14,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/roomPreviewNoPreviewToolbar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:elevation="4dp">
android:layout_height="?actionBarSize">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"

View File

@ -11,7 +11,6 @@
android:id="@+id/roomSettingsToolbar"
android:layout_width="0dp"
android:layout_height="?actionBarSize"
android:elevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

View File

@ -18,7 +18,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:elevation="4dp"
app:layout_collapseMode="pin">
<androidx.constraintlayout.widget.ConstraintLayout

View File

@ -25,7 +25,6 @@
android:id="@+id/addRoomToSpaceToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="4dp"
android:minHeight="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -15,7 +15,6 @@
android:id="@+id/roomPreviewNoPreviewToolbar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:elevation="4dp"
app:navigationIcon="@drawable/ic_x_18dp">
<androidx.constraintlayout.widget.ConstraintLayout

View File

@ -13,7 +13,6 @@
android:id="@+id/showUserCodeToolBar"
android:layout_width="0dp"
android:layout_height="?actionBarSize"
android:elevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

View File

@ -14,7 +14,6 @@
android:id="@+id/userDirectoryToolbar"
android:layout_width="0dp"
android:layout_height="?actionBarSize"
android:elevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

View File

@ -13,7 +13,6 @@
android:id="@+id/userListToolbar"
android:layout_width="0dp"
android:layout_height="?actionBarSize"
android:elevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

View File

@ -42,6 +42,9 @@
<color name="android_status_bar_background_dark">@color/element_background_dark</color>
<color name="android_navigation_bar_background_dark">@color/element_system_dark</color>
<!-- Used for toolbar background -->
<attr name="vctr_toolbar_background" format="color" />
<!-- Used for header background -->
<attr name="vctr_header_background" format="color" />

View File

@ -3,14 +3,6 @@
<!-- ************************ Common items ************************ -->
<!-- toolbar styles-->
<style name="VectorToolbarStyleWithPadding" parent="Widget.MaterialComponents.Toolbar">
<!-- main text -->
<item name="titleTextAppearance">@style/Vector.Toolbar.Title</item>
<item name="subtitleTextAppearance">@style/Vector.Toolbar.SubTitle</item>
<item name="android:background">?android:colorBackground</item>
</style>
<style name="ActionModeTheme" parent="Widget.AppCompat.ActionMode">
<item name="background">?android:colorBackground</item>
<item name="titleTextStyle">@style/Vector.Toolbar.Title</item>
@ -18,20 +10,6 @@
<item name="actionMenuTextColor">?colorOnPrimary</item>
</style>
<style name="VectorToolbarStyle" parent="VectorToolbarStyleWithPadding">
<item name="contentInsetStartWithNavigation">0dp</item>
</style>
<style name="Vector.Toolbar.Title" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">20sp</item>
<item name="android:fontFamily">"sans-serif-medium"</item>
</style>
<style name="Vector.Toolbar.SubTitle" parent="TextAppearance.Widget.AppCompat.Toolbar.Subtitle">
<item name="android:textSize">16sp</item>
<item name="android:fontFamily">"sans-serif"</item>
</style>
<style name="Vector.Toolbar.Profile" parent="@style/ThemeOverlay.AppCompat.ActionBar">
<item name="colorControlNormal">?colorSecondary</item>
</style>
@ -74,40 +52,6 @@
<item name="android:dropDownVerticalOffset">0dp</item>
</style>
<!-- actionbar icons color -->
<style name="Vector.ActionBarTheme" parent="ThemeOverlay.MaterialComponents.ActionBar">
<item name="colorControlNormal">?vctr_content_primary</item>
</style>
<!-- custom action bar -->
<style name="Vector.Styled.ActionBar" parent="Widget.MaterialComponents.Toolbar">
<item name="android:background">?colorPrimary</item>
<item name="background">?colorPrimary</item>
<!-- remove shadow under the action bar -->
<item name="elevation">0dp</item>
<!-- main text -->
<item name="titleTextStyle">@style/ActionBarTitleText</item>
<!-- sub text -->
<item name="subtitleTextStyle">@style/ActionBarSubTitleText</item>
</style>
<!-- main text -->
<style name="ActionBarTitleText" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">?vctr_content_primary</item>
<item name="android:fontFamily">"sans-serif-medium"</item>
<item name="android:textSize">20sp</item>
</style>
<!-- sub text -->
<style name="ActionBarSubTitleText" parent="TextAppearance.AppCompat.Widget.ActionBar.Subtitle">
<item name="android:textColor">?vctr_content_primary</item>
<item name="android:fontFamily">"sans-serif-medium"</item>
<item name="android:textSize">12sp</item>
</style>
<!-- Styles for login screen -->
<style name="LoginEditTextStyle" parent="Widget.AppCompat.EditText">
<item name="android:textSize">16sp</item>

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="VectorToolbarBase" parent="Widget.MaterialComponents.Toolbar">
<item name="android:background">?vctr_toolbar_background</item>
<item name="android:elevation">4dp</item>
<!-- main text -->
<item name="titleTextStyle">@style/ActionBarTitleText</item>
<!-- sub text -->
<item name="subtitleTextStyle">@style/ActionBarSubTitleText</item>
</style>
<!-- Default toolbar style -->
<style name="VectorToolbar" parent="VectorToolbarBase">
<item name="contentInsetStartWithNavigation">0dp</item>
</style>
<!-- Toolbar for settings Activity (so we keep the default contentInsetStartWithNavigation here) -->
<style name="VectorToolbarSettings" parent="VectorToolbarBase" />
<!-- Toolbar text style -->
<!-- main text -->
<style name="ActionBarTitleText" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">?vctr_content_primary</item>
<item name="android:fontFamily">"sans-serif-medium"</item>
<item name="android:textSize">20sp</item>
</style>
<!-- sub text -->
<style name="ActionBarSubTitleText" parent="TextAppearance.AppCompat.Widget.ActionBar.Subtitle">
<item name="android:textColor">?vctr_content_primary</item>
<item name="android:fontFamily">"sans-serif-medium"</item>
<item name="android:textSize">12sp</item>
</style>
<!-- Action mode text style -->
<style name="Vector.Toolbar.Title" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">20sp</item>
<item name="android:fontFamily">"sans-serif-medium"</item>
</style>
<style name="Vector.Toolbar.SubTitle" parent="TextAppearance.Widget.AppCompat.Toolbar.Subtitle">
<item name="android:textSize">16sp</item>
<item name="android:fontFamily">"sans-serif"</item>
</style>
</resources>

View File

@ -20,6 +20,7 @@
<item name="vctr_reaction_background_off">@color/vctr_reaction_background_off_black</item>
<item name="vctr_reaction_background_on">@color/vctr_reaction_background_on_black</item>
<item name="vctr_markdown_block_background_color">#FF4D4D4D</item>
<item name="vctr_toolbar_background">@color/element_background_black</item>
<!-- Material color -->
<item name="colorSurface">@android:color/black</item>

View File

@ -32,6 +32,7 @@
<item name="vctr_bottom_nav_icon_color">@color/vctr_bottom_nav_icon_color_dark</item>
<item name="vctr_waiting_background_color">@color/vctr_waiting_background_color_dark</item>
<item name="vctr_chat_effect_snow_background">@color/vctr_chat_effect_snow_background_dark</item>
<item name="vctr_toolbar_background">@color/element_system_dark</item>
<!-- room message colors -->
<item name="vctr_notice_secondary">#61708B</item>
@ -65,7 +66,7 @@
<!-- Default styles -->
<item name="materialButtonStyle">@style/VectorButtonStyle</item>
<item name="toolbarStyle">@style/VectorToolbarStyle</item>
<item name="toolbarStyle">@style/VectorToolbar</item>
<item name="materialAlertDialogTheme">@style/VectorAlertDialogStyleDark</item>
<!-- Default style for text input -->
@ -89,13 +90,6 @@
<!-- fonts -->
<item name="android:typeface">sans</item>
<!-- custom action bar -->
<item name="android:actionBarStyle">@style/Vector.Styled.ActionBar</item>
<item name="actionBarStyle">@style/Vector.Styled.ActionBar</item>
<!-- actionbar icons color -->
<item name="actionBarTheme">@style/Vector.ActionBarTheme</item>
<!-- remove the shadow under the actionbar -->
<item name="android:windowContentOverlay">@null</item>

View File

@ -32,6 +32,7 @@
<item name="vctr_bottom_nav_icon_color">@color/vctr_bottom_nav_icon_color_light</item>
<item name="vctr_waiting_background_color">@color/vctr_waiting_background_color_light</item>
<item name="vctr_chat_effect_snow_background">@color/vctr_chat_effect_snow_background_light</item>
<item name="vctr_toolbar_background">@color/element_background_light</item>
<!-- room message colors -->
<item name="vctr_notice_secondary">#61708B</item>
@ -65,7 +66,7 @@
<!-- Default styles -->
<item name="materialButtonStyle">@style/VectorButtonStyle</item>
<item name="toolbarStyle">@style/VectorToolbarStyle</item>
<item name="toolbarStyle">@style/VectorToolbar</item>
<item name="materialAlertDialogTheme">@style/VectorAlertDialogStyleLight</item>
<!-- Default style for text input -->
@ -89,13 +90,6 @@
<!-- fonts -->
<item name="android:typeface">sans</item>
<!-- custom action bar -->
<item name="android:actionBarStyle">@style/Vector.Styled.ActionBar</item>
<item name="actionBarStyle">@style/Vector.Styled.ActionBar</item>
<!-- actionbar icons color -->
<item name="actionBarTheme">@style/Vector.ActionBarTheme</item>
<!-- remove the shadow under the actionbar -->
<item name="android:windowContentOverlay">@null</item>