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

DROID-3063 App | Tech | Release stabilisation (#1842)

This commit is contained in:
Evgenii Kozlov 2024-11-25 19:15:52 +01:00 committed by GitHub
parent 37818be627
commit c194c057ad
Signed by: github
GPG key ID: B5690EEEBB952194
5 changed files with 61 additions and 38 deletions

View file

@ -1048,14 +1048,18 @@ open class EditorFragment : NavigationFragment<FragmentEditorBinding>(R.layout.f
}
is Command.OpenObjectRelationScreen.Value.Text -> {
hideKeyboard()
val fr = RelationTextValueFragment.new(
ctx = command.ctx,
relationKey = command.relationKey,
objectId = command.target,
isLocked = command.isReadOnlyValue,
space = command.space
)
fr.showChildFragment()
runCatching {
val fr = RelationTextValueFragment.new(
ctx = command.ctx,
relationKey = command.relationKey,
objectId = command.target,
isLocked = command.isReadOnlyValue,
space = command.space
)
fr.showChildFragment()
}.onFailure {
Timber.e(it, "Error while opening relation text value from editor")
}
}
is Command.OpenObjectRelationScreen.Value.Date -> {
hideKeyboard()

View file

@ -41,6 +41,7 @@ import com.anytypeio.anytype.ui.relations.value.TagOrStatusValueFragment
import javax.inject.Inject
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.onStart
import timber.log.Timber
open class ObjectRelationListFragment : BaseBottomSheetFragment<FragmentRelationListBinding>(),
RelationTextValueFragment.TextValueEditReceiver,
@ -118,18 +119,22 @@ open class ObjectRelationListFragment : BaseBottomSheetFragment<FragmentRelation
private fun execute(command: Command) {
when (command) {
is Command.EditTextRelationValue -> {
val fr = RelationTextValueFragment.new(
ctx = ctx,
relationKey = command.relationKey,
objectId = command.target,
isLocked = command.isLocked,
flow = if (isSetFlow)
RelationTextValueFragment.FLOW_DATAVIEW
else
RelationTextValueFragment.FLOW_DEFAULT,
space = space
)
fr.showChildFragment()
runCatching {
val fr = RelationTextValueFragment.new(
ctx = ctx,
relationKey = command.relationKey,
objectId = command.target,
isLocked = command.isLocked,
flow = if (isSetFlow)
RelationTextValueFragment.FLOW_DATAVIEW
else
RelationTextValueFragment.FLOW_DEFAULT,
space = space
)
fr.showChildFragment()
}.onFailure {
Timber.e(it, "Error while opening relation text value from relation list")
}
}
is Command.EditDateRelationValue -> {
val fr = RelationDateValueFragment.new(

View file

@ -1005,24 +1005,32 @@ open class ObjectSetFragment :
)
}
is ObjectSetCommand.Modal.EditGridTextCell -> {
val fr = RelationTextValueFragment.new(
ctx = ctx,
objectId = command.recordId,
flow = RelationTextValueFragment.FLOW_DATAVIEW,
relationKey = command.relationKey,
space = command.space
)
fr.showChildFragment(EMPTY_TAG)
runCatching {
val fr = RelationTextValueFragment.new(
ctx = ctx,
objectId = command.recordId,
flow = RelationTextValueFragment.FLOW_DATAVIEW,
relationKey = command.relationKey,
space = command.space
)
fr.showChildFragment(EMPTY_TAG)
}.onFailure {
Timber.e(it, "Error while opening relation text value for grid cell")
}
}
is ObjectSetCommand.Modal.EditIntrinsicTextRelation -> {
val fr = RelationTextValueFragment.new(
ctx = ctx,
objectId = ctx,
flow = RelationTextValueFragment.FLOW_SET_OR_COLLECTION,
relationKey = command.relation,
space = command.space
)
fr.showChildFragment(EMPTY_TAG)
runCatching {
val fr = RelationTextValueFragment.new(
ctx = ctx,
objectId = ctx,
flow = RelationTextValueFragment.FLOW_SET_OR_COLLECTION,
relationKey = command.relation,
space = command.space
)
fr.showChildFragment(EMPTY_TAG)
}.onFailure {
Timber.e(it, "Error while opening relation text value in set")
}
}
is ObjectSetCommand.Modal.EditObjectRelationValue -> {
findNavController().safeNavigate(

View file

@ -31,7 +31,7 @@ sealed class ObjectWrapper {
val iconImage: String? = getSingleValue(Relations.ICON_IMAGE)
val iconOption: Double? by default
val coverId: String? by default
val coverId: String? = getSingleValue(Relations.COVER_ID)
val coverType: CoverType
get() = when (val value = map[Relations.COVER_TYPE]) {

View file

@ -194,7 +194,13 @@ class CollectionViewModel(
filters = ObjectSearchConstants.filterTypes(),
keys = ObjectSearchConstants.defaultKeysObjectType
)
return getObjectTypes.asFlow(params).stateIn(viewModelScope)
return getObjectTypes
.asFlow(params)
.catch { e ->
Timber.e(e, "Error while getting object types for fullscreen widgets")
emit(emptyList())
}
.stateIn(viewModelScope)
}
@FlowPreview