Skip to content

Commit

Permalink
Animate in the authorization dialogs to spec (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdlaver authored Nov 27, 2024
1 parent c9df4ee commit 70a118b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion SeedVaultSimulator/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
android:name=".ui.AuthorizeActivity"
android:finishOnCloseSystemDialogs="true"
android:noHistory="true"
android:theme="@style/Theme.SeedVaultImpl.Transparent" />
android:theme="@style/Theme.SeedVaultImpl.NoActionBar.Transparent" />

<!-- NOTE: Order set below that of the privileged alias in case an app holds both
permissions. Apps normally should hold only one of the two permissions, but the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
Expand Down Expand Up @@ -59,6 +61,8 @@ class AuthorizeActivity : ComponentActivity() {
NavHost(
modifier = Modifier.fillMaxSize(),
navController = navController,
enterTransition = { EnterTransition.None },
exitTransition = { ExitTransition.None },
startDestination = "auth"
) {
composable("auth") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ fun NonPrivilegedAuthorizeContents(
testTagsAsResourceId = true
},
sheetState = sheetState,
scrimColor = Color.Transparent, // scrim provided at window level by backgroundDimEnabled in theme
contentWindowInsets = { BottomSheetDefaults.windowInsets.only(WindowInsetsSides.Top) },
onDismissRequest = onCancel
) {
Expand Down
10 changes: 5 additions & 5 deletions SeedVaultSimulator/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
<style name="Theme.SeedVaultImpl.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
</style>

<style name="Theme.SeedVaultImpl.Transparent" parent="android:Theme">
<style name="Theme.SeedVaultImpl.NoActionBar.Transparent">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:backgroundDimEnabled">true</item> <!-- window provides scrim over transparent areas -->
<item name="android:windowAnimationStyle">@null</item> <!-- window contents provide entry/exit animations -->
</style>

</resources>

0 comments on commit 70a118b

Please sign in to comment.