From 0f9e26efc59ee06f8d0c9deea8f1face280fce65 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 13 Jul 2020 19:08:31 +0200 Subject: [PATCH 1/5] let instead of also --- .../android/internal/session/sync/SyncResponseHandler.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/SyncResponseHandler.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/SyncResponseHandler.kt index 0769895d38..d8b07586a9 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/SyncResponseHandler.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/SyncResponseHandler.kt @@ -116,11 +116,11 @@ internal class SyncResponseHandler @Inject constructor(@SessionDatabase private tokenStore.saveToken(realm, syncResponse.nextBatch) } // Everything else we need to do outside the transaction - syncResponse.rooms?.also { + syncResponse.rooms?.let { checkPushRules(it, isInitialSync) userAccountDataSyncHandler.synchronizeWithServerIfNeeded(it.invite) } - syncResponse.groups?.also { + syncResponse.groups?.let { scheduleGroupDataFetchingIfNeeded(it) } From 8f7aae498077f1421cbf3f01f3dde763641cdd07 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 14 Jul 2020 10:11:26 +0200 Subject: [PATCH 2/5] Tint the icon (#1613) --- vector/src/main/res/menu/menu_directory_server_picker.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/vector/src/main/res/menu/menu_directory_server_picker.xml b/vector/src/main/res/menu/menu_directory_server_picker.xml index 109ed5f368..9dd4232196 100644 --- a/vector/src/main/res/menu/menu_directory_server_picker.xml +++ b/vector/src/main/res/menu/menu_directory_server_picker.xml @@ -6,6 +6,7 @@ android:id="@+id/action_add_custom_hs" android:icon="@drawable/ic_add_black" android:title="@string/action_open" + app:iconTint="?colorAccent" app:showAsAction="always" /> \ No newline at end of file From 0159e6dc0008e5bb4f6abe051e2d65c4cba86b4d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 14 Jul 2020 10:11:52 +0200 Subject: [PATCH 3/5] Hide the menu item, it's not implemented yet --- vector/src/main/res/menu/menu_directory_server_picker.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/vector/src/main/res/menu/menu_directory_server_picker.xml b/vector/src/main/res/menu/menu_directory_server_picker.xml index 9dd4232196..c544c80f8c 100644 --- a/vector/src/main/res/menu/menu_directory_server_picker.xml +++ b/vector/src/main/res/menu/menu_directory_server_picker.xml @@ -6,6 +6,7 @@ android:id="@+id/action_add_custom_hs" android:icon="@drawable/ic_add_black" android:title="@string/action_open" + android:visible="@bool/false_not_implemented" app:iconTint="?colorAccent" app:showAsAction="always" /> From 484b69165b1bd6f32230248ef9869e2fbd2288ad Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 14 Jul 2020 10:33:58 +0200 Subject: [PATCH 4/5] Add rounded light background to fix dark images on dark background issue (#1613) --- CHANGES.md | 2 +- .../riotx/features/roomdirectory/picker/RoomDirectoryItem.kt | 2 ++ vector/src/main/res/layout/item_room_directory.xml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index e7bf3938ad..b45ad9dff8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,7 @@ Improvements 🙌: - Bugfix 🐛: - - + - Fix theme issue on Room directory screen (#1613) Translations 🗣: - diff --git a/vector/src/main/java/im/vector/riotx/features/roomdirectory/picker/RoomDirectoryItem.kt b/vector/src/main/java/im/vector/riotx/features/roomdirectory/picker/RoomDirectoryItem.kt index 334def592a..c0f77aad74 100644 --- a/vector/src/main/java/im/vector/riotx/features/roomdirectory/picker/RoomDirectoryItem.kt +++ b/vector/src/main/java/im/vector/riotx/features/roomdirectory/picker/RoomDirectoryItem.kt @@ -19,6 +19,7 @@ package im.vector.riotx.features.roomdirectory.picker import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView +import androidx.core.view.isInvisible import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.riotx.R @@ -58,6 +59,7 @@ abstract class RoomDirectoryItem : VectorEpoxyModel() } } .into(holder.avatarView) + holder.avatarView.isInvisible = directoryAvatarUrl.isNullOrBlank() && includeAllNetworks holder.nameView.text = directoryName holder.descritionView.setTextOrHide(directoryDescription) diff --git a/vector/src/main/res/layout/item_room_directory.xml b/vector/src/main/res/layout/item_room_directory.xml index 64679f7b37..8869a22bea 100644 --- a/vector/src/main/res/layout/item_room_directory.xml +++ b/vector/src/main/res/layout/item_room_directory.xml @@ -19,6 +19,8 @@ android:layout_marginLeft="8dp" android:layout_marginTop="4dp" android:layout_marginBottom="4dp" + android:background="@drawable/circle" + android:padding="8dp" app:layout_constraintBottom_toTopOf="@+id/itemRoomDirectoryBottomSeparator" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" From d747d96e77d3176f8a56894400dc4eba5304015c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 15 Jul 2020 14:49:26 +0200 Subject: [PATCH 5/5] Use correct title --- .../roomdirectory/picker/RoomDirectoryPickerFragment.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/riotx/features/roomdirectory/picker/RoomDirectoryPickerFragment.kt b/vector/src/main/java/im/vector/riotx/features/roomdirectory/picker/RoomDirectoryPickerFragment.kt index 1299919d2b..1d71035d99 100644 --- a/vector/src/main/java/im/vector/riotx/features/roomdirectory/picker/RoomDirectoryPickerFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/roomdirectory/picker/RoomDirectoryPickerFragment.kt @@ -26,6 +26,7 @@ import im.vector.matrix.android.api.session.room.model.thirdparty.RoomDirectoryD import im.vector.riotx.R import im.vector.riotx.core.extensions.cleanup import im.vector.riotx.core.extensions.configureWith +import im.vector.riotx.core.platform.VectorBaseActivity import im.vector.riotx.core.platform.VectorBaseFragment import im.vector.riotx.features.roomdirectory.RoomDirectoryAction import im.vector.riotx.features.roomdirectory.RoomDirectorySharedAction @@ -35,7 +36,6 @@ import kotlinx.android.synthetic.main.fragment_room_directory_picker.* import timber.log.Timber import javax.inject.Inject -// TODO Set title to R.string.select_room_directory // TODO Menu to add custom room directory (not done in RiotWeb so far...) class RoomDirectoryPickerFragment @Inject constructor(val roomDirectoryPickerViewModelFactory: RoomDirectoryPickerViewModel.Factory, private val roomDirectoryPickerController: RoomDirectoryPickerController @@ -91,6 +91,11 @@ class RoomDirectoryPickerFragment @Inject constructor(val roomDirectoryPickerVie sharedActionViewModel.post(RoomDirectorySharedAction.Back) } + override fun onResume() { + super.onResume() + (activity as? VectorBaseActivity)?.supportActionBar?.setTitle(R.string.select_room_directory) + } + override fun retry() { Timber.v("Retry") pickerViewModel.handle(RoomDirectoryPickerAction.Retry)