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

DROID-1470 Onboarding | Fix | Do not show video with animated background circle on Android prior to R (#137)

This commit is contained in:
Evgenii Kozlov 2023-07-06 20:07:28 +02:00 committed by GitHub
parent 587b14564f
commit 1fb130996a
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 8 deletions

View file

@ -105,7 +105,9 @@ class OnboardingFragment : Fragment() {
.background(Color.Black)
) {
val currentPage = remember { mutableStateOf(OnboardingPage.AUTH) }
BackgroundCircle()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
BackgroundCircle()
}
Onboarding(currentPage, navController)
PagerIndicator(
pageCount = OnboardingPage.values().filter { it.visible }.size,
@ -126,7 +128,7 @@ class OnboardingFragment : Fragment() {
}
private fun onApplyWindowRootInsets(view: View) {
if (com.anytypeio.anytype.core_utils.BuildConfig.USE_NEW_WINDOW_INSET_API && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
val deferringInsetsListener = RootViewDeferringInsetsCallback(
persistentInsetTypes = WindowInsetsCompat.Type.systemBars(),
deferredInsetTypes = 0
@ -232,7 +234,13 @@ class OnboardingFragment : Fragment() {
}
) {
currentPage.value = OnboardingPage.SOUL_CREATION
CreateSoul(navController, ContentPaddingTop())
CreateSoul(
navController = navController,
contentPaddingTop = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
LocalConfiguration.current.screenHeightDp / 6
else
ContentPaddingTop()
)
}
composable(
route = OnboardingNavigation.createSoulAnim,
@ -381,11 +389,12 @@ class OnboardingFragment : Fragment() {
state = Lifecycle.State.DESTROYED
)
val vm = daggerViewModel { component.get().getViewModel() }
CreateSoulWrapper(vm, contentPaddingTop)
val navigationCommands =
vm.navigationFlow.collectAsState(
val navigationCommands = vm.navigationFlow.collectAsState(
initial = OnboardingSoulCreationViewModel.Navigation.Idle
)
)
LaunchedEffect(key1 = navigationCommands.value) {
when (navigationCommands.value) {
is OnboardingSoulCreationViewModel.Navigation.OpenSoulCreationAnim -> {

View file

@ -147,7 +147,7 @@ fun RecoveryScreen(
size = ButtonSize.Large,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 18.dp)
.padding(start = 18.dp, end = 18.dp, bottom = 24.dp)
)
}
}

View file

@ -67,7 +67,7 @@ private fun CreateSoulScreen(
) {
LazyColumn(
modifier = Modifier
.fillMaxWidth()
.fillMaxSize()
) {
item {
Spacer(