1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 13:57:10 +09:00

DROID-1507 Settings | Fix | Space icon, remove button #201 (#202)

This commit is contained in:
Konstantin Ivanov 2023-07-14 12:12:44 +02:00 committed by uburoiubu
parent 4475ace79b
commit db8fcaefea
No known key found for this signature in database
GPG key ID: C8FB80E0A595FBB6
2 changed files with 11 additions and 6 deletions

View file

@ -139,7 +139,7 @@ class MainSettingFragment : BaseBottomSheetComposeFragment() {
safeNavigate(
R.id.actionOpenImagePickerScreen, bundleOf(
ARG_CONTEXT_ID_KEY to command.id,
ARG_SHOW_REMOVE_BUTTON to true
ARG_SHOW_REMOVE_BUTTON to command.showRemoveButton
)
)
}

View file

@ -103,11 +103,16 @@ class MainSettingsViewModel(
Event.OnDebugClicked -> {
proceedWithSpaceDebug()
}
Event.OnSpaceImageClicked -> commands.emit(
Command.OpenSpaceImageSet(
configStorage.get().workspace
Event.OnSpaceImageClicked -> {
val showRemoveButton =
(workspaceAndAccount.value as? WorkspaceAndAccount.Account)?.space?.icon !is SpaceIconView.Gradient
commands.emit(
Command.OpenSpaceImageSet(
id = configStorage.get().workspace,
showRemoveButton = showRemoveButton
)
)
)
}
Event.OnFilesStorageClicked -> {
commands.emit(Command.OpenFilesStorageScreen)
}
@ -235,7 +240,7 @@ class MainSettingsViewModel(
object OpenProfileScreen : Command()
object OpenPersonalizationScreen : Command()
object OpenDebugScreen : Command()
class OpenSpaceImageSet(val id: Id) : Command()
class OpenSpaceImageSet(val id: Id, val showRemoveButton: Boolean) : Command()
object OpenFilesStorageScreen : Command()
data class Toast(val msg: String, val isLongDuration: Boolean = false) : Command()
data class ShareSpaceDebug(val path: Filepath): Command()