mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Default style for Toolbar. Try to cleanup
This commit is contained in:
parent
992f41d631
commit
5363526f77
33 changed files with 67 additions and 101 deletions
|
@ -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
|
||||
|
|
|
@ -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" />
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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" />
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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" />
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
|
||||
|
|
|
@ -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" />
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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" />
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
50
vector/src/main/res/values/styles_toolbar.xml
Normal file
50
vector/src/main/res/values/styles_toolbar.xml
Normal 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>
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue