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

DROID-2905 Navigation | Enhancement | Misc. object type navigation fixes (#2194) (#2196)

This commit is contained in:
Evgenii Kozlov 2025-03-26 16:12:32 +01:00 committed by GitHub
parent a5124466ed
commit f2d5cb4c65
Signed by: github
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 6 deletions

View file

@ -30,6 +30,7 @@ import com.anytypeio.anytype.presentation.home.OpenObjectNavigation
import com.anytypeio.anytype.presentation.relations.value.`object`.ObjectValueViewModel
import com.anytypeio.anytype.presentation.relations.value.`object`.ObjectValueViewModelFactory
import com.anytypeio.anytype.presentation.relations.value.tagstatus.RelationContext
import com.anytypeio.anytype.ui.base.navigation
import com.anytypeio.anytype.ui.chats.ChatFragment
import com.anytypeio.anytype.ui.date.DateObjectFragment
import com.anytypeio.anytype.ui.editor.EditorFragment
@ -122,8 +123,15 @@ class ObjectValueFragment : BaseBottomSheetComposeFragment() {
)
)
}
OpenObjectNavigation.NonValidObject -> {
toast(getString(R.string.error_non_valid_object))
is OpenObjectNavigation.OpenType -> {
runCatching {
navigation().openObjectType(
objectId = nav.target,
space = nav.space
)
}.onFailure {
Timber.e(it, "Error while opening object type from ")
}
}
is OpenObjectNavigation.OpenDateObject -> {
runCatching {
@ -138,12 +146,12 @@ class ObjectValueFragment : BaseBottomSheetComposeFragment() {
Timber.e(it, "Failed to navigate to date object screen")
}
}
OpenObjectNavigation.NonValidObject -> {
toast(getString(R.string.error_non_valid_object))
}
is OpenObjectNavigation.UnexpectedLayoutError -> {
toast(getString(R.string.error_unexpected_layout))
}
else -> {
// Do nothing.
}
}
}
}

View file

@ -2581,6 +2581,12 @@ fun ObjectType.Layout.navigation(
space = space
)
}
ObjectType.Layout.OBJECT_TYPE -> {
OpenObjectNavigation.OpenType(
target = target,
space = space
)
}
else -> {
OpenObjectNavigation.UnexpectedLayoutError(this)
}

View file

@ -116,7 +116,7 @@ class ObjectValueViewModel(
}
}
private suspend fun getSearchParams(
private fun getSearchParams(
relation: ObjectWrapper.Relation,
query: String,
ids: List<Id>