mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3063 App | Tech | Release stabilisation (#1842)
This commit is contained in:
parent
3e0410b563
commit
e84e82ad13
5 changed files with 61 additions and 38 deletions
|
@ -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()
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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]) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue