Redo hidden bottom bar and combined chats view for v1.0 merge
This commit is contained in:
parent
95850440bd
commit
e857052e37
@ -90,8 +90,8 @@ class HomeDetailFragment @Inject constructor(
|
|||||||
|
|
||||||
withState(viewModel) {
|
withState(viewModel) {
|
||||||
// Update the navigation view if needed (for when we restore the tabs)
|
// Update the navigation view if needed (for when we restore the tabs)
|
||||||
bottomNavigationView.selectedItemId = it.displayMode.toMenuId()
|
//bottomNavigationView.selectedItemId = it.displayMode.toMenuId()
|
||||||
bottomNavigationView.visibility = if (bottomNavigationView.selectedItemId != R.id.bottom_action_notification) View.VISIBLE else View.GONE
|
bottomNavigationView.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.selectSubscribe(this, HomeDetailViewState::groupSummary) { groupSummary ->
|
viewModel.selectSubscribe(this, HomeDetailViewState::groupSummary) { groupSummary ->
|
||||||
@ -249,7 +249,8 @@ class HomeDetailFragment @Inject constructor(
|
|||||||
val displayMode = when (it.itemId) {
|
val displayMode = when (it.itemId) {
|
||||||
R.id.bottom_action_people -> RoomListDisplayMode.PEOPLE
|
R.id.bottom_action_people -> RoomListDisplayMode.PEOPLE
|
||||||
R.id.bottom_action_rooms -> RoomListDisplayMode.ROOMS
|
R.id.bottom_action_rooms -> RoomListDisplayMode.ROOMS
|
||||||
else -> RoomListDisplayMode.NOTIFICATIONS
|
R.id.bottom_action_notification -> RoomListDisplayMode.NOTIFICATIONS
|
||||||
|
else -> RoomListDisplayMode.ALL
|
||||||
}
|
}
|
||||||
viewModel.handle(HomeDetailAction.SwitchDisplayMode(displayMode))
|
viewModel.handle(HomeDetailAction.SwitchDisplayMode(displayMode))
|
||||||
true
|
true
|
||||||
|
@ -27,7 +27,7 @@ import im.vector.matrix.android.api.session.sync.SyncState
|
|||||||
data class HomeDetailViewState(
|
data class HomeDetailViewState(
|
||||||
val groupSummary: Option<GroupSummary> = Option.empty(),
|
val groupSummary: Option<GroupSummary> = Option.empty(),
|
||||||
val asyncRooms: Async<List<RoomSummary>> = Uninitialized,
|
val asyncRooms: Async<List<RoomSummary>> = Uninitialized,
|
||||||
val displayMode: RoomListDisplayMode = RoomListDisplayMode.PEOPLE,
|
val displayMode: RoomListDisplayMode = RoomListDisplayMode.ALL,
|
||||||
val notificationCountCatchup: Int = 0,
|
val notificationCountCatchup: Int = 0,
|
||||||
val notificationHighlightCatchup: Boolean = false,
|
val notificationHighlightCatchup: Boolean = false,
|
||||||
val notificationCountPeople: Int = 0,
|
val notificationCountPeople: Int = 0,
|
||||||
|
@ -20,6 +20,7 @@ import androidx.annotation.StringRes
|
|||||||
import im.vector.riotx.R
|
import im.vector.riotx.R
|
||||||
|
|
||||||
enum class RoomListDisplayMode(@StringRes val titleRes: Int) {
|
enum class RoomListDisplayMode(@StringRes val titleRes: Int) {
|
||||||
|
ALL(R.string.bottom_action_all),
|
||||||
NOTIFICATIONS(R.string.bottom_action_notification),
|
NOTIFICATIONS(R.string.bottom_action_notification),
|
||||||
PEOPLE(R.string.bottom_action_people_x),
|
PEOPLE(R.string.bottom_action_people_x),
|
||||||
ROOMS(R.string.bottom_action_rooms),
|
ROOMS(R.string.bottom_action_rooms),
|
||||||
|
@ -28,8 +28,9 @@ class RoomListDisplayModeFilter(private val displayMode: RoomListDisplayMode) :
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return when (displayMode) {
|
return when (displayMode) {
|
||||||
|
RoomListDisplayMode.ALL -> true
|
||||||
RoomListDisplayMode.NOTIFICATIONS ->
|
RoomListDisplayMode.NOTIFICATIONS ->
|
||||||
true //roomSummary.notificationCount > 0 || roomSummary.membership == Membership.INVITE || roomSummary.userDrafts.isNotEmpty()
|
roomSummary.notificationCount > 0 || roomSummary.membership == Membership.INVITE || roomSummary.userDrafts.isNotEmpty()
|
||||||
RoomListDisplayMode.PEOPLE -> roomSummary.isDirect && roomSummary.membership.isActive()
|
RoomListDisplayMode.PEOPLE -> roomSummary.isDirect && roomSummary.membership.isActive()
|
||||||
RoomListDisplayMode.ROOMS -> !roomSummary.isDirect && roomSummary.membership.isActive()
|
RoomListDisplayMode.ROOMS -> !roomSummary.isDirect && roomSummary.membership.isActive()
|
||||||
RoomListDisplayMode.FILTERED -> roomSummary.membership == Membership.JOIN
|
RoomListDisplayMode.FILTERED -> roomSummary.membership == Membership.JOIN
|
||||||
|
@ -138,6 +138,7 @@ class RoomListFragment @Inject constructor(
|
|||||||
|
|
||||||
private fun setupCreateRoomButton() {
|
private fun setupCreateRoomButton() {
|
||||||
when (roomListParams.displayMode) {
|
when (roomListParams.displayMode) {
|
||||||
|
RoomListDisplayMode.ALL,
|
||||||
RoomListDisplayMode.NOTIFICATIONS -> createChatFabMenu.isVisible = true
|
RoomListDisplayMode.NOTIFICATIONS -> createChatFabMenu.isVisible = true
|
||||||
RoomListDisplayMode.PEOPLE -> createChatRoomButton.isVisible = true
|
RoomListDisplayMode.PEOPLE -> createChatRoomButton.isVisible = true
|
||||||
RoomListDisplayMode.ROOMS -> createGroupRoomButton.isVisible = true
|
RoomListDisplayMode.ROOMS -> createGroupRoomButton.isVisible = true
|
||||||
@ -164,6 +165,7 @@ class RoomListFragment @Inject constructor(
|
|||||||
RecyclerView.SCROLL_STATE_DRAGGING,
|
RecyclerView.SCROLL_STATE_DRAGGING,
|
||||||
RecyclerView.SCROLL_STATE_SETTLING -> {
|
RecyclerView.SCROLL_STATE_SETTLING -> {
|
||||||
when (roomListParams.displayMode) {
|
when (roomListParams.displayMode) {
|
||||||
|
RoomListDisplayMode.ALL,
|
||||||
RoomListDisplayMode.NOTIFICATIONS -> createChatFabMenu.hide()
|
RoomListDisplayMode.NOTIFICATIONS -> createChatFabMenu.hide()
|
||||||
RoomListDisplayMode.PEOPLE -> createChatRoomButton.hide()
|
RoomListDisplayMode.PEOPLE -> createChatRoomButton.hide()
|
||||||
RoomListDisplayMode.ROOMS -> createGroupRoomButton.hide()
|
RoomListDisplayMode.ROOMS -> createGroupRoomButton.hide()
|
||||||
@ -207,6 +209,7 @@ class RoomListFragment @Inject constructor(
|
|||||||
private val showFabRunnable = Runnable {
|
private val showFabRunnable = Runnable {
|
||||||
if (isAdded) {
|
if (isAdded) {
|
||||||
when (roomListParams.displayMode) {
|
when (roomListParams.displayMode) {
|
||||||
|
RoomListDisplayMode.ALL,
|
||||||
RoomListDisplayMode.NOTIFICATIONS -> createChatFabMenu.show()
|
RoomListDisplayMode.NOTIFICATIONS -> createChatFabMenu.show()
|
||||||
RoomListDisplayMode.PEOPLE -> createChatRoomButton.show()
|
RoomListDisplayMode.PEOPLE -> createChatRoomButton.show()
|
||||||
RoomListDisplayMode.ROOMS -> createGroupRoomButton.show()
|
RoomListDisplayMode.ROOMS -> createGroupRoomButton.show()
|
||||||
@ -258,6 +261,7 @@ class RoomListFragment @Inject constructor(
|
|||||||
roomController.update(state)
|
roomController.update(state)
|
||||||
// Mark all as read menu
|
// Mark all as read menu
|
||||||
when (roomListParams.displayMode) {
|
when (roomListParams.displayMode) {
|
||||||
|
RoomListDisplayMode.ALL,
|
||||||
RoomListDisplayMode.NOTIFICATIONS,
|
RoomListDisplayMode.NOTIFICATIONS,
|
||||||
RoomListDisplayMode.PEOPLE,
|
RoomListDisplayMode.PEOPLE,
|
||||||
RoomListDisplayMode.ROOMS -> {
|
RoomListDisplayMode.ROOMS -> {
|
||||||
@ -288,6 +292,12 @@ class RoomListFragment @Inject constructor(
|
|||||||
}
|
}
|
||||||
.isNullOrEmpty()
|
.isNullOrEmpty()
|
||||||
val emptyState = when (roomListParams.displayMode) {
|
val emptyState = when (roomListParams.displayMode) {
|
||||||
|
RoomListDisplayMode.ALL ->
|
||||||
|
StateView.State.Empty(
|
||||||
|
getString(R.string.all_list_rooms_empty_title),
|
||||||
|
ContextCompat.getDrawable(requireContext(), R.drawable.ic_home_bottom_group),
|
||||||
|
getString(R.string.all_list_rooms_empty_body)
|
||||||
|
)
|
||||||
RoomListDisplayMode.NOTIFICATIONS -> {
|
RoomListDisplayMode.NOTIFICATIONS -> {
|
||||||
if (hasNoRoom) {
|
if (hasNoRoom) {
|
||||||
StateView.State.Empty(
|
StateView.State.Empty(
|
||||||
|
@ -37,6 +37,8 @@ class SharedPreferencesUiStateRepository @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getDisplayMode(): RoomListDisplayMode {
|
override fun getDisplayMode(): RoomListDisplayMode {
|
||||||
|
return RoomListDisplayMode.ALL
|
||||||
|
/*
|
||||||
return when (sharedPreferences.getInt(KEY_DISPLAY_MODE, VALUE_DISPLAY_MODE_CATCHUP)) {
|
return when (sharedPreferences.getInt(KEY_DISPLAY_MODE, VALUE_DISPLAY_MODE_CATCHUP)) {
|
||||||
VALUE_DISPLAY_MODE_PEOPLE -> RoomListDisplayMode.PEOPLE
|
VALUE_DISPLAY_MODE_PEOPLE -> RoomListDisplayMode.PEOPLE
|
||||||
VALUE_DISPLAY_MODE_ROOMS -> RoomListDisplayMode.ROOMS
|
VALUE_DISPLAY_MODE_ROOMS -> RoomListDisplayMode.ROOMS
|
||||||
@ -46,6 +48,7 @@ class SharedPreferencesUiStateRepository @Inject constructor(
|
|||||||
RoomListDisplayMode.PEOPLE
|
RoomListDisplayMode.PEOPLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun storeDisplayMode(displayMode: RoomListDisplayMode) {
|
override fun storeDisplayMode(displayMode: RoomListDisplayMode) {
|
||||||
|
@ -12,4 +12,8 @@
|
|||||||
<string name="bubble_style_start">Selbe Seite</string>
|
<string name="bubble_style_start">Selbe Seite</string>
|
||||||
<string name="bubble_style_both">Beide Seiten</string>
|
<string name="bubble_style_both">Beide Seiten</string>
|
||||||
|
|
||||||
|
<string name="bottom_action_all">Übersicht</string>
|
||||||
|
<string name="all_list_rooms_empty_title">SchildiChat</string>
|
||||||
|
<string name="all_list_rooms_empty_body">Konversationen werden hier angezeigt</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -12,4 +12,8 @@
|
|||||||
<string name="bubble_style_start">Same side</string>
|
<string name="bubble_style_start">Same side</string>
|
||||||
<string name="bubble_style_both">Both sides</string>
|
<string name="bubble_style_both">Both sides</string>
|
||||||
|
|
||||||
|
<string name="bottom_action_all">Overview</string>
|
||||||
|
<string name="all_list_rooms_empty_title">SchildiChat</string>
|
||||||
|
<string name="all_list_rooms_empty_body">Chats will be displayed here</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user