Adds options menu

This commit is contained in:
ericdecanini 2022-07-26 16:00:46 +02:00
parent 5958559186
commit 7334d909d5
10 changed files with 52 additions and 9 deletions

View File

@ -0,0 +1,4 @@
<vector android:height="22dp" android:viewportHeight="22"
android:viewportWidth="22" android:width="22dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#737D8C" android:fillType="evenOdd" android:pathData="M16.999,14.899C18.07,13.407 18.7,11.577 18.7,9.6C18.7,4.574 14.626,0.5 9.6,0.5C4.574,0.5 0.5,4.574 0.5,9.6C0.5,14.626 4.574,18.7 9.6,18.7C11.577,18.7 13.406,18.07 14.899,16.999C14.941,17.055 14.988,17.109 15.039,17.161L18.939,21.061C19.525,21.646 20.475,21.646 21.06,21.061C21.646,20.475 21.646,19.525 21.06,18.939L17.16,15.039C17.109,14.988 17.055,14.941 16.999,14.899ZM15.7,9.6C15.7,12.969 12.969,15.7 9.6,15.7C6.231,15.7 3.5,12.969 3.5,9.6C3.5,6.231 6.231,3.5 9.6,3.5C12.969,3.5 15.7,6.231 15.7,9.6Z"/>
</vector>

View File

@ -41,9 +41,7 @@
<!-- Material 3 -->
<style name="Widget.Vector.Material3.Toolbar" parent="Widget.Material3.Toolbar">
</style>
<style name="Widget.Vector.Material3.Toolbar" parent="Widget.Material3.Toolbar" />
<style name="Widget.Vector.Material3.CollapsingToolbar.Medium" parent="Widget.Material3.CollapsingToolbar.Medium">
<item name="expandedTitleTextAppearance">@style/TextAppearance.Vector.Title.Medium</item>

View File

@ -28,7 +28,7 @@ import im.vector.app.R
import im.vector.app.core.platform.SimpleTextWatcher
fun EditText.setupAsSearch(
@DrawableRes searchIconRes: Int = R.drawable.ic_search,
@DrawableRes searchIconRes: Int = R.drawable.ic_home_search,
@DrawableRes clearIconRes: Int = R.drawable.ic_x_gray
) {
addTextChangedListener(object : SimpleTextWatcher() {

View File

@ -549,7 +549,7 @@ class HomeActivity :
}
}
override fun getMenuRes() = R.menu.home
override fun getMenuRes() = if (vectorFeatures.isNewAppLayoutEnabled()) R.menu.menu_new_home else R.menu.menu_home
override fun handlePrepareMenu(menu: Menu) {
menu.findItem(R.id.menu_home_init_sync_legacy).isVisible = vectorPreferences.developerMode()

View File

@ -286,9 +286,11 @@ class NewHomeDetailFragment @Inject constructor(
}
private fun setupToolbar() {
// TODO: Reimplement
setupToolbar(views.toolbar)
}
private fun setupBottomNavigationView() {
views.bottomNavigationView.menu.findItem(R.id.bottom_action_notification).isVisible = vectorPreferences.labAddNotificationTab()
views.bottomNavigationView.setOnItemSelectedListener {

View File

@ -17,4 +17,4 @@
android:left="14dp"
android:right="14dp"
android:top="14dp" />
</layer-list>
</layer-list>

View File

@ -49,13 +49,13 @@
app:layout_constraintTop_toBottomOf="@id/syncStateView">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/groupToolbar"
style="@style/Widget.Vector.Material3.CollapsingToolbar.Medium"
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutMediumSize"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
style="@style/Widget.Vector.Material3.Toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"

View File

@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/search"
android:icon="@drawable/ic_search"
android:icon="@drawable/ic_home_search"
app:iconTint="?vctr_content_primary"
android:title="@string/search"
app:actionViewClass="android.widget.SearchView"

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<item
android:id="@+id/menu_home_setting"
android:icon="@drawable/ic_settings_x"
android:title="@string/settings"
app:showAsAction="never" />
<item
android:id="@+id/menu_home_suggestion"
android:icon="@drawable/ic_material_bug_report"
android:title="@string/send_suggestion" />
<item
android:id="@+id/menu_home_report_bug"
android:icon="@drawable/ic_material_bug_report"
android:title="@string/send_bug_report" />
<item
android:id="@+id/menu_home_init_sync_legacy"
android:title="Do a legacy init sync"
tools:ignore="HardcodedText" />
<item
android:id="@+id/menu_home_init_sync_optimized"
android:title="Do an optimized init sync"
tools:ignore="HardcodedText" />
<item
android:id="@+id/menu_home_filter"
android:icon="@drawable/ic_home_search"
android:title="@string/home_filter_placeholder_home"
app:iconTint="?vctr_content_secondary"
app:showAsAction="always" />
</menu>