summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author William Leshner <wleshner@google.com> 2025-02-04 09:49:22 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-02-04 09:49:22 -0800
commitea7438320bcb0985ba67c5112bf40a5521628e00 (patch)
tree0c8a9765cd46a4bdf6ec6d9331d8427bb278e6ca
parentf5b979696e455d0fcd2796dd26568495d34006a2 (diff)
parent81a234938c3584aa14f57effbab7ee88916f08f2 (diff)
Merge "Delay showing hub onboarding bottom sheet." into main
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/section/HubOnboardingSection.kt20
1 files changed, 18 insertions, 2 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/section/HubOnboardingSection.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/section/HubOnboardingSection.kt
index 6943e9b00ed8..6989dcbaa0d5 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/section/HubOnboardingSection.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/section/HubOnboardingSection.kt
@@ -34,6 +34,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
+import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
@@ -52,6 +53,8 @@ import com.android.systemui.statusbar.phone.ComponentSystemUIDialog
import com.android.systemui.statusbar.phone.SystemUIDialogFactory
import com.android.systemui.statusbar.phone.createBottomSheet
import javax.inject.Inject
+import kotlin.time.Duration.Companion.milliseconds
+import kotlinx.coroutines.delay
class HubOnboardingSection
@Inject
@@ -69,10 +72,23 @@ constructor(
return
}
- HubOnboardingBottomSheet(shouldShowBottomSheet = true, dialogFactory = dialogFactory) {
- viewModel.onDismissed()
+ var show by remember { mutableStateOf(false) }
+
+ LaunchedEffect(Unit) {
+ delay(SHOW_BOTTOMSHEET_DELAY_MS)
+ show = true
+ }
+
+ if (show) {
+ HubOnboardingBottomSheet(shouldShowBottomSheet = true, dialogFactory = dialogFactory) {
+ viewModel.onDismissed()
+ }
}
}
+
+ companion object {
+ val SHOW_BOTTOMSHEET_DELAY_MS = 1000.milliseconds
+ }
}
@Composable