This commit is contained in:
Valere 2021-03-24 15:46:25 +01:00
parent 55083a5602
commit 55745655db
4 changed files with 22 additions and 9 deletions

View File

@ -89,9 +89,11 @@ abstract class GenericItem : VectorEpoxyModel<GenericItem.Holder>() {
holder.titleIcon.isVisible = false
}
when (style) {
STYLE.BIG_TEXT -> holder.titleText.textSize = 18f
STYLE.NORMAL_TEXT -> holder.titleText.textSize = 14f
holder.titleText.textSize = when (style) {
STYLE.BIG_TEXT -> 18f
STYLE.NORMAL_TEXT -> 14f
STYLE.TITLE -> 20f
STYLE.SUBHEADER -> 16f
}
holder.descriptionText.setTextOrHide(description)

View File

@ -56,6 +56,7 @@ import im.vector.app.features.popup.VerificationVectorAlert
import im.vector.app.features.rageshake.VectorUncaughtExceptionHandler
import im.vector.app.features.settings.VectorPreferences
import im.vector.app.features.settings.VectorSettingsActivity
import im.vector.app.features.spaces.ShareSpaceBottomSheet
import im.vector.app.features.spaces.SpaceCreationActivity
import im.vector.app.features.spaces.SpacePreviewActivity
import im.vector.app.features.spaces.SpaceSettingsMenuBottomSheet
@ -168,7 +169,11 @@ class HomeActivity :
is HomeActivitySharedAction.ShowSpaceSettings -> {
// open bottom sheet
SpaceSettingsMenuBottomSheet
.newInstance(sharedAction.spaceId)
.newInstance(sharedAction.spaceId, object : SpaceSettingsMenuBottomSheet.InteractionListener {
override fun onShareSpaceSelected(spaceId: String) {
ShareSpaceBottomSheet.show(supportFragmentManager, spaceId)
}
})
.show(supportFragmentManager, "SPACE_SETTINGS")
}
}.exhaustive

View File

@ -58,6 +58,12 @@ class SpaceSettingsMenuBottomSheet : VectorBaseBottomSheetDialogFragment<BottomS
private val spaceArgs: SpaceBottomSheetSettingsArgs by args()
interface InteractionListener {
fun onShareSpaceSelected(spaceId: String)
}
var interactionListener : InteractionListener? = null
override fun injectWith(injector: ScreenComponent) {
injector.inject(this)
}
@ -89,9 +95,8 @@ class SpaceSettingsMenuBottomSheet : VectorBaseBottomSheetDialogFragment<BottomS
}.disposeOnDestroyView()
views.invitePeople.views.bottomSheetActionClickableZone.debouncedClicks {
// navigator.openInviteUsersToRoom(requireContext(), spaceArgs.spaceId)
dismiss()
ShareSpaceBottomSheet.show(requireFragmentManager(), spaceArgs.spaceId)
interactionListener?.onShareSpaceSelected(spaceArgs.spaceId)
}
views.showMemberList.views.bottomSheetActionClickableZone.debouncedClicks {
@ -128,8 +133,9 @@ class SpaceSettingsMenuBottomSheet : VectorBaseBottomSheetDialogFragment<BottomS
}
companion object {
fun newInstance(spaceId: String): SpaceSettingsMenuBottomSheet {
fun newInstance(spaceId: String, interactionListener: InteractionListener): SpaceSettingsMenuBottomSheet {
return SpaceSettingsMenuBottomSheet().apply {
this.interactionListener = interactionListener
setArguments(SpaceBottomSheetSettingsArgs(spaceId))
}
}

View File

@ -138,12 +138,12 @@ class SpaceSummaryController @Inject constructor(
// it's expanded
subSpaces?.forEach { child ->
summaries.firstOrNull { it.roomId == child.childRoomId }?.let { childSum ->
val isSelected = childSum.roomId == selected?.roomId
val isChildSelected = childSum.roomId == selected?.roomId
spaceSummaryItem {
avatarRenderer(avatarRenderer)
id(child.childRoomId)
hasChildren(false)
selected(isSelected)
selected(isChildSelected)
matrixItem(MatrixItem.RoomItem(child.childRoomId, child.name, child.avatarUrl))
listener { callback?.onSpaceSelected(childSum) }
indent(1)