From 6f2736566ea68cca395a9b084970c08c4997bf8c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 1 Oct 2020 17:43:43 +0200 Subject: [PATCH] Add a menu item to open the setting in room list and in room (#2171) --- CHANGES.md | 1 + .../main/java/im/vector/app/features/home/HomeActivity.kt | 4 ++++ .../app/features/home/room/detail/RoomDetailFragment.kt | 4 ++++ .../app/features/home/room/detail/RoomDetailViewModel.kt | 1 + vector/src/main/res/menu/home.xml | 8 +++++++- vector/src/main/res/menu/menu_timeline.xml | 6 ++++++ 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 4a158086a2..90a5b7afc2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ Improvements 🙌: - Small optimisation of scrolling experience in timeline (#2114) - Allow user to reset cross signing if he has no way to recover (#2052) - Create home shortcut for any room (#1525) + - Add a menu item to open the setting in room list and in room (#2171) Bugfix 🐛: - Improve support for image/audio/video/file selection with intent changes (#1376) diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt index eb024c4db1..233bceaf7f 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt @@ -305,6 +305,10 @@ class HomeActivity : VectorBaseActivity(), ToolbarConfigurable, UnknownDeviceDet navigator.openRoomsFiltering(this) return true } + R.id.menu_home_setting ->{ + navigator.openSettings(this) + return true + } } return super.onOptionsItemSelected(item) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt index 51aeda2aab..74a689977f 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt @@ -656,6 +656,10 @@ class RoomDetailFragment @Inject constructor( roomDetailViewModel.handle(RoomDetailAction.ClearSendQueue) true } + R.id.timeline_setting -> { + navigator.openRoomProfile(requireActivity(), roomDetailArgs.roomId) + true + } R.id.resend_all -> { roomDetailViewModel.handle(RoomDetailAction.ResendAll) true diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt index 1b5e928843..c6896a8b87 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt @@ -533,6 +533,7 @@ class RoomDetailViewModel @AssistedInject constructor( // For now always disable when not in developer mode, worker cancellation is not working properly timeline.pendingEventCount() > 0 && vectorPreferences.developerMode() R.id.resend_all -> state.asyncRoomSummary()?.hasFailedSending == true + R.id.timeline_setting -> true R.id.clear_all -> state.asyncRoomSummary()?.hasFailedSending == true R.id.open_matrix_apps -> true R.id.voice_call, diff --git a/vector/src/main/res/menu/home.xml b/vector/src/main/res/menu/home.xml index db84db6622..7a77c45240 100644 --- a/vector/src/main/res/menu/home.xml +++ b/vector/src/main/res/menu/home.xml @@ -2,6 +2,12 @@ + + \ No newline at end of file diff --git a/vector/src/main/res/menu/menu_timeline.xml b/vector/src/main/res/menu/menu_timeline.xml index e0566ccf6d..eb2227ad21 100644 --- a/vector/src/main/res/menu/menu_timeline.xml +++ b/vector/src/main/res/menu/menu_timeline.xml @@ -3,6 +3,12 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> + +