Update plugin ktlint to v12.1.0 (#2200)
* Update plugin ktlint to v12.1.0 * Run `./gradlew ktlintFormat` and fix some issues manually. * Fix other issues reproted by Ktlint * Limit false positives, KtLint removes unnecessary curly brace in String templates. * Remove useless Unit * Minor improvements over ktlint changes * Restore `AlertDialogContent` behaviour * Update screenshots --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Benoit Marty <benoit@matrix.org> Co-authored-by: Jorge Martín <jorgem@element.io> Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
parent
675cc525cf
commit
7e9cda3aa9
442 changed files with 1091 additions and 1081 deletions
|
|
@ -50,5 +50,6 @@ fun MigrationScreenView(
|
|||
internal fun MigrationViewPreview() = ElementPreview {
|
||||
MigrationScreenView(
|
||||
migrationState = MigrationScreenState(isMigrating = true),
|
||||
onMigrationFinished = {})
|
||||
onMigrationFinished = {}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,4 +58,3 @@ class SharedPrefsMigrationScreenStore @Inject constructor(
|
|||
private const val IS_MIGRATION_SCREEN_SHOWN_PREFIX = "is_migration_screen_shown_"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ class NotificationsOptInPresenter @AssistedInject constructor(
|
|||
}
|
||||
|
||||
LaunchedEffect(notificationsPermissionsState) {
|
||||
if (notificationsPermissionsState.permissionGranted
|
||||
|| notificationsPermissionsState.permissionAlreadyDenied) {
|
||||
if (notificationsPermissionsState.permissionGranted ||
|
||||
notificationsPermissionsState.permissionAlreadyDenied) {
|
||||
callback.onNotificationsOptInFinished()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import javax.inject.Inject
|
|||
@ContributesBinding(SessionScope::class)
|
||||
class DefaultFtueState @Inject constructor(
|
||||
private val sdkVersionProvider: BuildVersionSdkIntProvider,
|
||||
private val coroutineScope: CoroutineScope,
|
||||
coroutineScope: CoroutineScope,
|
||||
private val analyticsService: AnalyticsService,
|
||||
private val welcomeScreenState: WelcomeScreenState,
|
||||
private val migrationScreenStore: MigrationScreenStore,
|
||||
|
|
@ -68,21 +68,31 @@ class DefaultFtueState @Inject constructor(
|
|||
|
||||
fun getNextStep(currentStep: FtueStep? = null): FtueStep? =
|
||||
when (currentStep) {
|
||||
null -> if (shouldDisplayMigrationScreen()) FtueStep.MigrationScreen else getNextStep(
|
||||
null -> if (shouldDisplayMigrationScreen()) {
|
||||
FtueStep.MigrationScreen
|
||||
)
|
||||
FtueStep.MigrationScreen -> if (shouldDisplayWelcomeScreen()) FtueStep.WelcomeScreen else getNextStep(
|
||||
} else {
|
||||
getNextStep(FtueStep.MigrationScreen)
|
||||
}
|
||||
FtueStep.MigrationScreen -> if (shouldDisplayWelcomeScreen()) {
|
||||
FtueStep.WelcomeScreen
|
||||
)
|
||||
FtueStep.WelcomeScreen -> if (shouldAskNotificationPermissions()) FtueStep.NotificationsOptIn else getNextStep(
|
||||
} else {
|
||||
getNextStep(FtueStep.WelcomeScreen)
|
||||
}
|
||||
FtueStep.WelcomeScreen -> if (shouldAskNotificationPermissions()) {
|
||||
FtueStep.NotificationsOptIn
|
||||
)
|
||||
FtueStep.NotificationsOptIn -> if (shouldDisplayLockscreenSetup()) FtueStep.LockscreenSetup else getNextStep(
|
||||
} else {
|
||||
getNextStep(FtueStep.NotificationsOptIn)
|
||||
}
|
||||
FtueStep.NotificationsOptIn -> if (shouldDisplayLockscreenSetup()) {
|
||||
FtueStep.LockscreenSetup
|
||||
)
|
||||
FtueStep.LockscreenSetup -> if (needsAnalyticsOptIn()) FtueStep.AnalyticsOptIn else getNextStep(
|
||||
} else {
|
||||
getNextStep(FtueStep.LockscreenSetup)
|
||||
}
|
||||
FtueStep.LockscreenSetup -> if (needsAnalyticsOptIn()) {
|
||||
FtueStep.AnalyticsOptIn
|
||||
)
|
||||
} else {
|
||||
getNextStep(FtueStep.AnalyticsOptIn)
|
||||
}
|
||||
FtueStep.AnalyticsOptIn -> null
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +125,9 @@ class DefaultFtueState @Inject constructor(
|
|||
val isPermissionDenied = runBlocking { permissionStateProvider.isPermissionDenied(permission).first() }
|
||||
val isPermissionGranted = permissionStateProvider.isPermissionGranted(permission)
|
||||
!isPermissionGranted && !isPermissionDenied
|
||||
} else false
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
private fun shouldDisplayLockscreenSetup(): Boolean {
|
||||
|
|
|
|||
|
|
@ -50,5 +50,4 @@ class WelcomeNode @AssistedInject constructor(
|
|||
modifier = modifier
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue