Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation | New Home tab to priorize all unread - BLOCKED #4010

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions library/ui-styles/src/main/res/values/attrs_drawables.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<!-- room message colors -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update this comment?

<attr name="vctr_empty_state_dm" format="reference" />
<attr name="vctr_empty_state_rooms" format="reference" />

</resources>
4 changes: 4 additions & 0 deletions library/ui-styles/src/main/res/values/theme_dark.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<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>

<!-- drawables -->
<item name="vctr_empty_state_dm">@drawable/empty_state_dm_dark</item>
<item name="vctr_empty_state_rooms">@drawable/empty_state_room_dark</item>

<!-- room message colors -->
<item name="vctr_notice_secondary">#61708B</item>
<item name="vctr_unsent_message_text_color">?colorError</item>
Expand Down
4 changes: 4 additions & 0 deletions library/ui-styles/src/main/res/values/theme_light.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<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>

<!-- drawables -->
<item name="vctr_empty_state_dm">@drawable/empty_state_dm</item>
<item name="vctr_empty_state_rooms">@drawable/empty_state_room</item>

<!-- room message colors -->
<item name="vctr_notice_secondary">#61708B</item>
<item name="vctr_unsent_message_text_color">?colorError</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import im.vector.app.features.home.room.list.actions.RoomListQuickActionsSharedA
import im.vector.app.features.home.room.list.actions.RoomListQuickActionsSharedActionViewModel
import im.vector.app.features.home.room.list.widget.NotifsFabMenuView
import im.vector.app.features.notifications.NotificationDrawerManager
import im.vector.app.features.themes.ThemeUtils
import kotlinx.parcelize.Parcelize
import org.matrix.android.sdk.api.extensions.orTrue
import org.matrix.android.sdk.api.session.room.model.RoomSummary
Expand Down Expand Up @@ -430,27 +431,44 @@ class RoomListFragment @Inject constructor(
!adapterInfosList.any { it.sectionHeaderAdapter.roomsSectionData.isLoading }
if (shouldShowEmpty) {
val emptyState = when (roomListParams.displayMode) {
RoomListDisplayMode.HOME -> {
StateView.State.Empty(
title = getString(R.string.room_list_catchup_empty_title),
image = ContextCompat.getDrawable(requireContext(), R.drawable.ic_noun_party_popper),
message = getString(R.string.room_list_catchup_empty_body))
}
RoomListDisplayMode.PEOPLE ->
// RoomListDisplayMode.HOME -> {
// StateView.State.Empty(
// title = getString(R.string.room_list_catchup_empty_title),
// image = ContextCompat.getDrawable(requireContext(), R.drawable.ic_noun_party_popper),
// message = getString(R.string.room_list_catchup_empty_body))
// }
RoomListDisplayMode.PEOPLE ->
StateView.State.Empty(
title = getString(R.string.room_list_people_empty_title),
image = ContextCompat.getDrawable(requireContext(), R.drawable.empty_state_dm),
image = ThemeUtils.getAttribute(requireContext(), R.attr.vctr_empty_state_dm)?.let {
ContextCompat.getDrawable(requireContext(),
it.resourceId)
},
isBigImage = true,
message = getString(R.string.room_list_people_empty_body)
)
RoomListDisplayMode.ROOMS ->
RoomListDisplayMode.ROOMS ->
StateView.State.Empty(
title = getString(R.string.room_list_rooms_empty_title),
image = ContextCompat.getDrawable(requireContext(), R.drawable.empty_state_room),
image = ThemeUtils.getAttribute(requireContext(), R.attr.vctr_empty_state_rooms)?.let {
ContextCompat.getDrawable(requireContext(),
it.resourceId)
},
isBigImage = true,
message = getString(R.string.room_list_rooms_empty_body)
)
else ->
RoomListDisplayMode.HOME,
RoomListDisplayMode.ALL_IN_ONE ->
StateView.State.Empty(
title = getString(R.string.room_list_people_empty_title),
image = ThemeUtils.getAttribute(requireContext(), R.attr.vctr_empty_state_rooms)?.let {
ContextCompat.getDrawable(requireContext(),
it.resourceId)
},
isBigImage = true,
message = getString(R.string.room_list_all_in_one_empty_body)
)
else ->
// Always display the content in this mode, because if the footer
StateView.State.Content
}
Expand Down
1 change: 1 addition & 0 deletions vector/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2192,6 +2192,7 @@
<string name="room_list_people_empty_body">Your direct message conversations will be displayed here. Tap the + bottom right to start some.</string>
<string name="room_list_rooms_empty_title">Rooms</string>
<string name="room_list_rooms_empty_body">Your rooms will be displayed here. Tap the + bottom right to find existing ones or start some of your own.</string>
<string name="room_list_all_in_one_empty_body">Your conversations will be displayed here. Tap the + bottom right to start some.</string>

<string name="title_activity_emoji_reaction_picker">Reactions</string>
<string name="reactions_agree">Agree</string>
Expand Down