mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 20:06:51 +03:00
Change call to action in filter room when space selected
This commit is contained in:
parent
701b0fbeef
commit
4880df3555
4 changed files with 15 additions and 1 deletions
1
changelog.d/3048.bugfix
Normal file
1
changelog.d/3048.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Room filter no results bad CTA in space mode when a space selected
|
|
@ -17,6 +17,7 @@
|
|||
package im.vector.app.features.home.room.filtered
|
||||
|
||||
import android.widget.Button
|
||||
import androidx.core.view.isVisible
|
||||
import com.airbnb.epoxy.EpoxyAttribute
|
||||
import com.airbnb.epoxy.EpoxyModelClass
|
||||
import im.vector.app.R
|
||||
|
@ -33,11 +34,21 @@ abstract class FilteredRoomFooterItem : VectorEpoxyModel<FilteredRoomFooterItem.
|
|||
@EpoxyAttribute
|
||||
var currentFilter: String = ""
|
||||
|
||||
@EpoxyAttribute
|
||||
var inSpace: Boolean = false
|
||||
|
||||
override fun bind(holder: Holder) {
|
||||
super.bind(holder)
|
||||
holder.createRoomButton.onClick { listener?.createRoom(currentFilter) }
|
||||
holder.createDirectChat.onClick { listener?.createDirectChat() }
|
||||
holder.openRoomDirectory.onClick { listener?.openRoomDirectory(currentFilter) }
|
||||
|
||||
holder.openRoomDirectory.setText(
|
||||
if (inSpace) R.string.space_explore_activity_title else R.string.room_filtering_footer_open_room_directory
|
||||
)
|
||||
|
||||
// The explore space screen will have a shortcut to create
|
||||
holder.createRoomButton.isVisible = !inSpace
|
||||
}
|
||||
|
||||
class Holder : VectorEpoxyHolder() {
|
||||
|
|
|
@ -24,6 +24,7 @@ import im.vector.app.core.resources.UserPreferencesProvider
|
|||
import im.vector.app.features.home.RoomListDisplayMode
|
||||
import im.vector.app.features.home.room.filtered.FilteredRoomFooterItem
|
||||
import im.vector.app.features.home.room.filtered.filteredRoomFooterItem
|
||||
import im.vector.app.space
|
||||
import javax.inject.Inject
|
||||
|
||||
class RoomListFooterController @Inject constructor(
|
||||
|
@ -41,6 +42,7 @@ class RoomListFooterController @Inject constructor(
|
|||
id("filter_footer")
|
||||
listener(host.listener)
|
||||
currentFilter(data.roomFilter)
|
||||
inSpace(data.currentRoomGrouping.invoke()?.space() != null)
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
android:layout_gravity="center"
|
||||
android:layout_marginTop="56dp"
|
||||
android:text="@string/room_filtering_footer_title"
|
||||
android:layout_marginBottom="@dimen/layout_vertical_margin"
|
||||
android:textColor="?vctr_content_secondary" />
|
||||
|
||||
<Button
|
||||
|
@ -20,7 +21,6 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/layout_vertical_margin"
|
||||
android:text="@string/room_filtering_footer_create_new_room" />
|
||||
|
||||
<Button
|
||||
|
|
Loading…
Reference in a new issue