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

DROID-2731 Vault | Fix | Update main navbar button colors for widgets + fix navigation issues (#1599)

This commit is contained in:
Evgenii Kozlov 2024-09-27 13:50:37 +02:00 committed by GitHub
parent c3765120a3
commit 760d61b6e5
Signed by: github
GPG key ID: B5690EEEBB952194
9 changed files with 47 additions and 21 deletions

View file

@ -822,7 +822,7 @@ fun HomeScreenBottomToolbar(
.width(BottomNavigationDefaults.Width)
.background(
shape = RoundedCornerShape(16.dp),
color = colorResource(id = R.color.shape_tertiary)
color = colorResource(id = R.color.home_screen_button)
)
) {
Box(

View file

@ -164,15 +164,11 @@ class LibraryFragment : BaseComposeFragment() {
}
is LibraryViewModel.Navigation.ExitToVault -> {
runCatching {
findNavController().popBackStack(
R.id.vaultScreen,
true
)
findNavController().navigate(R.id.actionOpenVault)
}.onFailure { e ->
Timber.e(e, "Error while exiting to vault from space library")
}
}
is LibraryViewModel.Navigation.OpenSetOrCollection -> {
findNavController().safeNavigate(
R.id.libraryFragment,

View file

@ -18,6 +18,7 @@ import com.anytypeio.anytype.di.common.componentManager
import com.anytypeio.anytype.presentation.spaces.CreateSpaceViewModel
import com.anytypeio.anytype.ui.settings.typography
import javax.inject.Inject
import timber.log.Timber
class CreateSpaceFragment : BaseBottomSheetComposeFragment() {
@ -51,15 +52,25 @@ class CreateSpaceFragment : BaseBottomSheetComposeFragment() {
LaunchedEffect(Unit) {
vm.isSucceeded.collect { isSucceeded ->
if (isSucceeded) {
findNavController().navigate(R.id.switchSpaceAction)
runCatching {
findNavController().navigate(R.id.exitToVaultAction)
findNavController().navigate(R.id.actionOpenSpaceFromVault)
}.onFailure {
Timber.e(it, "Error while exiting to vault or opening space")
}
}
}
}
LaunchedEffect(Unit) {
vm.exitWithMultiplayerTip.collect { isSucceeded ->
if (isSucceeded) {
findNavController().navigate(R.id.switchSpaceAction)
findNavController().navigate(R.id.multiplayerFeatureDialog)
runCatching {
findNavController().navigate(R.id.exitToVaultAction)
findNavController().navigate(R.id.actionOpenSpaceFromVault)
findNavController().navigate(R.id.multiplayerFeatureDialog)
}.onFailure {
Timber.e(it, "Error while exiting to vault or opening space or opening introduce-multiplayer-feature dialog")
}
}
}
}

View file

@ -20,6 +20,7 @@ import com.anytypeio.anytype.presentation.vault.VaultViewModel.Command
import com.anytypeio.anytype.ui.settings.ProfileSettingsFragment
import com.anytypeio.anytype.ui.settings.typography
import javax.inject.Inject
import timber.log.Timber
class VaultFragment : BaseComposeFragment() {
@ -58,13 +59,17 @@ class VaultFragment : BaseComposeFragment() {
is Command.EnterSpaceHomeScreen -> {
runCatching {
findNavController().navigate(R.id.actionOpenSpaceFromVault)
}.onFailure {
Timber.e(it, "Error while opening space from vault")
}
}
is Command.CreateNewSpace -> {
runCatching {
findNavController().navigate(
R.id.createSpaceScreen
R.id.actionCreateSpaceFromVault
)
}.onFailure {
Timber.e(it, "Error while opening create-space screen from vault")
}
}
is Command.OpenProfileSettings -> {
@ -73,6 +78,8 @@ class VaultFragment : BaseComposeFragment() {
R.id.profileScreen,
bundleOf(ProfileSettingsFragment.SPACE_ID_KEY to command.space.id)
)
}.onFailure {
Timber.e(it, "Error while opening profile settings from vault")
}
}
}

View file

@ -109,10 +109,7 @@ class CollectionFragment : BaseComposeFragment() {
)
is Command.Vault -> {
runCatching {
findNavController().popBackStack(
R.id.vaultScreen,
true
)
findNavController().navigate(R.id.actionOpenVault)
}.onFailure {
Timber.e(it, "Error while exiting to vault")
}

View file

@ -165,7 +165,13 @@
<fragment
android:id="@+id/homeScreenWidgets"
android:name="com.anytypeio.anytype.ui.widgets.collection.CollectionFragment"
android:label="Home screen" />
android:label="Home screen">
<action
android:id="@+id/actionOpenVault"
app:destination="@id/vaultScreen"
app:popUpTo="@id/vaultScreen"
app:popUpToInclusive="true" />
</fragment>
<dialog
android:id="@+id/selectWidgetSourceScreen"
@ -199,16 +205,18 @@
<action
android:id="@+id/actionOpenSpaceFromVault"
app:destination="@id/homeScreen" />
<action
android:id="@+id/actionCreateSpaceFromVault"
app:destination="@id/createSpaceScreen" />
</fragment>
<dialog
android:id="@+id/createSpaceScreen"
android:name="com.anytypeio.anytype.ui.spaces.CreateSpaceFragment">
<action
android:id="@+id/switchSpaceAction"
app:popUpTo="@+id/homeScreen"
app:popUpToInclusive="false"
app:enterAnim="@anim/anim_switch_space_enter" />
android:id="@+id/exitToVaultAction"
app:popUpTo="@+id/vaultScreen"
app:popUpToInclusive="false" />
</dialog>
<dialog
@ -394,6 +402,11 @@
<action
android:id="@+id/openRelationEditingScreen"
app:destination="@id/relationEditingFragment" />
<action
android:id="@+id/actionOpenVault"
app:destination="@id/vaultScreen"
app:popUpTo="@id/vaultScreen"
app:popUpToInclusive="true" />
</fragment>
<dialog
android:id="@+id/typeCreationFragment"

View file

@ -128,4 +128,6 @@
<color name="object_number_background">#393835</color>
<color name="home_screen_button">#F2222222</color>
</resources>

View file

@ -206,7 +206,7 @@
<color name="object_loading_state_gradient_end_color">#F1F0ED</color>
<color name="widget_button">#A6FFFFFF</color>
<color name="home_screen_button">#99FFFFFF</color>
<color name="home_screen_button">#F2F0F0F0</color>
<color name="set_new_btn_text">#FFFFFF</color>
<color name="colorPrimary">#FF5722</color>

View file

@ -812,7 +812,7 @@ class CollectionViewModel(
fun onHomeClicked() {
launch {
analytics.sendScreenHomeEvent()
commands.emit(Command.ToDesktop)
commands.emit(Command.Vault)
}
}