Merge pull request #2207 from element-hq/feature/bma/ktlint_plugin
Upgrade ktlint version to 1.1.1
This commit is contained in:
commit
ec6ef6fc8f
653 changed files with 303 additions and 869 deletions
|
|
@ -14,10 +14,19 @@ ij_smart_tabs = false
|
||||||
ij_visual_guides = none
|
ij_visual_guides = none
|
||||||
ij_wrap_on_typing = false
|
ij_wrap_on_typing = false
|
||||||
|
|
||||||
# Ktlint rule, for more information see https://pinterest.github.io/ktlint/faq/#why-is-editorconfig-property-disabled_rules-deprecated-and-how-do-i-resolve-this
|
# Ktlint rule, for more information see https://pinterest.github.io/ktlint/1.1.1/faq/#how-do-i-enable-or-disable-a-rule
|
||||||
ktlint_standard_wrapping = disabled
|
ktlint_standard_wrapping = disabled
|
||||||
ktlint_standard_trailing-comma-on-call-site = disabled
|
ktlint_standard_trailing-comma-on-call-site = disabled
|
||||||
|
ktlint_standard_trailing-comma-on-declaration-site = disabled
|
||||||
|
ktlint_standard_multiline-expression-wrapping = disabled
|
||||||
|
ktlint_standard_string-template-indent = disabled
|
||||||
ktlint_standard_spacing-between-declarations-with-annotations = disabled
|
ktlint_standard_spacing-between-declarations-with-annotations = disabled
|
||||||
|
ktlint_standard_function-signature = disabled
|
||||||
|
ktlint_standard_annotation = disabled
|
||||||
|
ktlint_standard_parameter-list-wrapping = disabled
|
||||||
|
ktlint_standard_indent = disabled
|
||||||
|
ktlint_standard_blank-line-before-declaration = disabled
|
||||||
|
ktlint_function_naming_ignore_when_annotated_with=Composable
|
||||||
|
|
||||||
[*.java]
|
[*.java]
|
||||||
ij_java_align_consecutive_assignments = false
|
ij_java_align_consecutive_assignments = false
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,6 @@ import java.io.File
|
||||||
*/
|
*/
|
||||||
@AutoService(CodeGenerator::class)
|
@AutoService(CodeGenerator::class)
|
||||||
class ContributesNodeCodeGenerator : CodeGenerator {
|
class ContributesNodeCodeGenerator : CodeGenerator {
|
||||||
|
|
||||||
override fun isApplicable(context: AnvilContext): Boolean = true
|
override fun isApplicable(context: AnvilContext): Boolean = true
|
||||||
|
|
||||||
override fun generateCode(codeGenDir: File, module: ModuleDescriptor, projectFiles: Collection<KtFile>): Collection<GeneratedFile> {
|
override fun generateCode(codeGenDir: File, module: ModuleDescriptor, projectFiles: Collection<KtFile>): Collection<GeneratedFile> {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ import io.element.android.x.initializer.CrashInitializer
|
||||||
import io.element.android.x.initializer.TracingInitializer
|
import io.element.android.x.initializer.TracingInitializer
|
||||||
|
|
||||||
class ElementXApplication : Application(), DaggerComponentOwner {
|
class ElementXApplication : Application(), DaggerComponentOwner {
|
||||||
|
|
||||||
override val daggerComponent: AppComponent = DaggerAppComponent.factory().create(this)
|
override val daggerComponent: AppComponent = DaggerAppComponent.factory().create(this)
|
||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ import timber.log.Timber
|
||||||
private val loggerTag = LoggerTag("MainActivity")
|
private val loggerTag = LoggerTag("MainActivity")
|
||||||
|
|
||||||
class MainActivity : NodeActivity() {
|
class MainActivity : NodeActivity() {
|
||||||
|
|
||||||
private lateinit var mainNode: MainNode
|
private lateinit var mainNode: MainNode
|
||||||
private lateinit var appBindings: AppBindings
|
private lateinit var appBindings: AppBindings
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ class MainNode(
|
||||||
plugins = plugins,
|
plugins = plugins,
|
||||||
),
|
),
|
||||||
DaggerComponentOwner {
|
DaggerComponentOwner {
|
||||||
|
|
||||||
override val daggerComponent = (context as DaggerComponentOwner).daggerComponent
|
override val daggerComponent = (context as DaggerComponentOwner).daggerComponent
|
||||||
|
|
||||||
override fun resolve(navTarget: RootNavTarget, buildContext: BuildContext): Node {
|
override fun resolve(navTarget: RootNavTarget, buildContext: BuildContext): Node {
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,12 @@ import io.element.android.libraries.matrix.api.tracing.TracingService
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
interface AppBindings {
|
interface AppBindings {
|
||||||
fun snackbarDispatcher(): SnackbarDispatcher
|
fun snackbarDispatcher(): SnackbarDispatcher
|
||||||
|
|
||||||
fun tracingService(): TracingService
|
fun tracingService(): TracingService
|
||||||
|
|
||||||
fun bugReporter(): BugReporter
|
fun bugReporter(): BugReporter
|
||||||
|
|
||||||
fun lockScreenService(): LockScreenService
|
fun lockScreenService(): LockScreenService
|
||||||
|
|
||||||
fun preferencesStore(): PreferencesStore
|
fun preferencesStore(): PreferencesStore
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ import io.element.android.libraries.di.SingleIn
|
||||||
@SingleIn(AppScope::class)
|
@SingleIn(AppScope::class)
|
||||||
@MergeComponent(AppScope::class)
|
@MergeComponent(AppScope::class)
|
||||||
interface AppComponent : NodeFactoriesBindings {
|
interface AppComponent : NodeFactoriesBindings {
|
||||||
|
|
||||||
@Component.Factory
|
@Component.Factory
|
||||||
interface Factory {
|
interface Factory {
|
||||||
fun create(
|
fun create(
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@ import java.io.File
|
||||||
@Module
|
@Module
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
object AppModule {
|
object AppModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
fun providesBaseDirectory(@ApplicationContext context: Context): File {
|
fun providesBaseDirectory(@ApplicationContext context: Context): File {
|
||||||
return File(context.filesDir, "sessions")
|
return File(context.filesDir, "sessions")
|
||||||
|
|
@ -82,14 +81,20 @@ object AppModule {
|
||||||
buildType = buildType,
|
buildType = buildType,
|
||||||
applicationName = context.getString(R.string.app_name),
|
applicationName = context.getString(R.string.app_name),
|
||||||
applicationId = BuildConfig.APPLICATION_ID,
|
applicationId = BuildConfig.APPLICATION_ID,
|
||||||
lowPrivacyLoggingEnabled = false, // TODO EAx Config.LOW_PRIVACY_LOG_ENABLE,
|
// TODO EAx Config.LOW_PRIVACY_LOG_ENABLE,
|
||||||
|
lowPrivacyLoggingEnabled = false,
|
||||||
versionName = BuildConfig.VERSION_NAME,
|
versionName = BuildConfig.VERSION_NAME,
|
||||||
versionCode = BuildConfig.VERSION_CODE,
|
versionCode = BuildConfig.VERSION_CODE,
|
||||||
gitRevision = "TODO", // BuildConfig.GIT_REVISION,
|
// BuildConfig.GIT_REVISION,
|
||||||
gitRevisionDate = "TODO", // BuildConfig.GIT_REVISION_DATE,
|
gitRevision = "TODO",
|
||||||
gitBranchName = "TODO", // BuildConfig.GIT_BRANCH_NAME,
|
// BuildConfig.GIT_REVISION_DATE,
|
||||||
flavorDescription = "TODO", // BuildConfig.FLAVOR_DESCRIPTION,
|
gitRevisionDate = "TODO",
|
||||||
flavorShortDescription = "TODO", // BuildConfig.SHORT_FLAVOR_DESCRIPTION,
|
// BuildConfig.GIT_BRANCH_NAME,
|
||||||
|
gitBranchName = "TODO",
|
||||||
|
// BuildConfig.FLAVOR_DESCRIPTION,
|
||||||
|
flavorDescription = "TODO",
|
||||||
|
// BuildConfig.SHORT_FLAVOR_DESCRIPTION,
|
||||||
|
flavorShortDescription = "TODO",
|
||||||
)
|
)
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ import javax.inject.Inject
|
||||||
class DefaultRoomComponentFactory @Inject constructor(
|
class DefaultRoomComponentFactory @Inject constructor(
|
||||||
private val roomComponentBuilder: RoomComponent.Builder
|
private val roomComponentBuilder: RoomComponent.Builder
|
||||||
) : RoomComponentFactory {
|
) : RoomComponentFactory {
|
||||||
|
|
||||||
override fun create(room: MatrixRoom): Any {
|
override fun create(room: MatrixRoom): Any {
|
||||||
return roomComponentBuilder.room(room).build()
|
return roomComponentBuilder.room(room).build()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ import javax.inject.Inject
|
||||||
class DefaultSessionComponentFactory @Inject constructor(
|
class DefaultSessionComponentFactory @Inject constructor(
|
||||||
private val sessionComponentBuilder: SessionComponent.Builder
|
private val sessionComponentBuilder: SessionComponent.Builder
|
||||||
) : SessionComponentFactory {
|
) : SessionComponentFactory {
|
||||||
|
|
||||||
override fun create(client: MatrixClient): Any {
|
override fun create(client: MatrixClient): Any {
|
||||||
return sessionComponentBuilder.client(client).build()
|
return sessionComponentBuilder.client(client).build()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import io.element.android.libraries.matrix.api.room.MatrixRoom
|
||||||
@SingleIn(RoomScope::class)
|
@SingleIn(RoomScope::class)
|
||||||
@MergeSubcomponent(RoomScope::class)
|
@MergeSubcomponent(RoomScope::class)
|
||||||
interface RoomComponent : NodeFactoriesBindings {
|
interface RoomComponent : NodeFactoriesBindings {
|
||||||
|
|
||||||
@Subcomponent.Builder
|
@Subcomponent.Builder
|
||||||
interface Builder {
|
interface Builder {
|
||||||
@BindsInstance
|
@BindsInstance
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import io.element.android.libraries.matrix.api.MatrixClient
|
||||||
@SingleIn(SessionScope::class)
|
@SingleIn(SessionScope::class)
|
||||||
@MergeSubcomponent(SessionScope::class)
|
@MergeSubcomponent(SessionScope::class)
|
||||||
interface SessionComponent : NodeFactoriesBindings {
|
interface SessionComponent : NodeFactoriesBindings {
|
||||||
|
|
||||||
@Subcomponent.Builder
|
@Subcomponent.Builder
|
||||||
interface Builder {
|
interface Builder {
|
||||||
@BindsInstance
|
@BindsInstance
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import androidx.startup.Initializer
|
||||||
import io.element.android.features.rageshake.impl.crash.VectorUncaughtExceptionHandler
|
import io.element.android.features.rageshake.impl.crash.VectorUncaughtExceptionHandler
|
||||||
|
|
||||||
class CrashInitializer : Initializer<Unit> {
|
class CrashInitializer : Initializer<Unit> {
|
||||||
|
|
||||||
override fun create(context: Context) {
|
override fun create(context: Context) {
|
||||||
VectorUncaughtExceptionHandler(context).activate()
|
VectorUncaughtExceptionHandler(context).activate()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import io.element.android.x.di.AppBindings
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
class TracingInitializer : Initializer<Unit> {
|
class TracingInitializer : Initializer<Unit> {
|
||||||
|
|
||||||
override fun create(context: Context) {
|
override fun create(context: Context) {
|
||||||
val appBindings = context.bindings<AppBindings>()
|
val appBindings = context.bindings<AppBindings>()
|
||||||
val tracingService = appBindings.tracingService()
|
val tracingService = appBindings.tracingService()
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import org.robolectric.RuntimeEnvironment
|
||||||
|
|
||||||
@RunWith(RobolectricTestRunner::class)
|
@RunWith(RobolectricTestRunner::class)
|
||||||
class IntentProviderImplTest {
|
class IntentProviderImplTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `test getViewRoomIntent with Session`() {
|
fun `test getViewRoomIntent with Session`() {
|
||||||
val sut = createIntentProviderImpl()
|
val sut = createIntentProviderImpl()
|
||||||
|
|
|
||||||
|
|
@ -25,48 +25,27 @@ import kotlin.time.Duration.Companion.seconds
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration for the lock screen feature.
|
* Configuration for the lock screen feature.
|
||||||
|
* @property isPinMandatory Whether the PIN is mandatory or not.
|
||||||
|
* @property pinBlacklist Some PINs are forbidden.
|
||||||
|
* @property pinSize The size of the PIN.
|
||||||
|
* @property maxPinCodeAttemptsBeforeLogout Number of attempts before the user is logged out.
|
||||||
|
* @property gracePeriod Time period before locking the app once backgrounded.
|
||||||
|
* @property isStrongBiometricsEnabled Authentication with strong methods (fingerprint, some face/iris unlock implementations) is supported.
|
||||||
|
* @property isWeakBiometricsEnabled Authentication with weak methods (most face/iris unlock implementations) is supported.
|
||||||
*/
|
*/
|
||||||
data class LockScreenConfig(
|
data class LockScreenConfig(
|
||||||
/**
|
|
||||||
* Whether the PIN is mandatory or not.
|
|
||||||
*/
|
|
||||||
val isPinMandatory: Boolean,
|
val isPinMandatory: Boolean,
|
||||||
|
|
||||||
/**
|
|
||||||
* Some PINs are forbidden.
|
|
||||||
*/
|
|
||||||
val pinBlacklist: Set<String>,
|
val pinBlacklist: Set<String>,
|
||||||
|
|
||||||
/**
|
|
||||||
* The size of the PIN.
|
|
||||||
*/
|
|
||||||
val pinSize: Int,
|
val pinSize: Int,
|
||||||
|
|
||||||
/**
|
|
||||||
* Number of attempts before the user is logged out.
|
|
||||||
*/
|
|
||||||
val maxPinCodeAttemptsBeforeLogout: Int,
|
val maxPinCodeAttemptsBeforeLogout: Int,
|
||||||
|
|
||||||
/**
|
|
||||||
* Time period before locking the app once backgrounded.
|
|
||||||
*/
|
|
||||||
val gracePeriod: Duration,
|
val gracePeriod: Duration,
|
||||||
|
|
||||||
/**
|
|
||||||
* Authentication with strong methods (fingerprint, some face/iris unlock implementations) is supported.
|
|
||||||
*/
|
|
||||||
val isStrongBiometricsEnabled: Boolean,
|
val isStrongBiometricsEnabled: Boolean,
|
||||||
|
|
||||||
/**
|
|
||||||
* Authentication with weak methods (most face/iris unlock implementations) is supported.
|
|
||||||
*/
|
|
||||||
val isWeakBiometricsEnabled: Boolean,
|
val isWeakBiometricsEnabled: Boolean,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
@Module
|
@Module
|
||||||
object LockScreenConfigModule {
|
object LockScreenConfigModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
fun providesLockScreenConfig(): LockScreenConfig = LockScreenConfig(
|
fun providesLockScreenConfig(): LockScreenConfig = LockScreenConfig(
|
||||||
isPinMandatory = false,
|
isPinMandatory = false,
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,6 @@
|
||||||
package io.element.android.appconfig
|
package io.element.android.appconfig
|
||||||
|
|
||||||
object MatrixConfiguration {
|
object MatrixConfiguration {
|
||||||
const val matrixToPermalinkBaseUrl: String = "https://matrix.to/#/"
|
const val MATRIX_TO_PERMALINK_BASE_URL: String = "https://matrix.to/#/"
|
||||||
val clientPermalinkBaseUrl: String? = null
|
val clientPermalinkBaseUrl: String? = null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ package io.element.android.appconfig
|
||||||
|
|
||||||
object NotificationConfig {
|
object NotificationConfig {
|
||||||
// TODO EAx Implement and set to true at some point
|
// TODO EAx Implement and set to true at some point
|
||||||
const val supportMarkAsReadAction = false
|
const val SUPPORT_MARK_AS_READ_ACTION = false
|
||||||
|
|
||||||
// TODO EAx Implement and set to true at some point
|
// TODO EAx Implement and set to true at some point
|
||||||
const val supportQuickReplyAction = false
|
const val SUPPORT_QUICK_REPLY_ACTION = false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,5 +20,5 @@ object PushConfig {
|
||||||
/**
|
/**
|
||||||
* Note: pusher_app_id cannot exceed 64 chars.
|
* Note: pusher_app_id cannot exceed 64 chars.
|
||||||
*/
|
*/
|
||||||
const val pusher_app_id: String = "im.vector.app.android"
|
const val PUSHER_APP_ID: String = "im.vector.app.android"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@
|
||||||
package io.element.android.appconfig
|
package io.element.android.appconfig
|
||||||
|
|
||||||
object RoomListConfig {
|
object RoomListConfig {
|
||||||
const val showInviteMenuItem = false
|
const val SHOW_INVITE_MENU_ITEM = false
|
||||||
const val showReportProblemMenuItem = false
|
const val SHOW_REPORT_PROBLEM_MENU_ITEM = false
|
||||||
|
|
||||||
const val hasDropdownMenu = showInviteMenuItem || showReportProblemMenuItem
|
const val HAS_DROP_DOWN_MENU = SHOW_INVITE_MENU_ITEM || SHOW_REPORT_PROBLEM_MENU_ITEM
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,5 +17,5 @@
|
||||||
package io.element.android.appconfig
|
package io.element.android.appconfig
|
||||||
|
|
||||||
object SecureBackupConfig {
|
object SecureBackupConfig {
|
||||||
const val LearnMoreUrl: String = "https://element.io/help#encryption5"
|
const val LEARN_MORE_URL: String = "https://element.io/help#encryption5"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,5 +17,5 @@
|
||||||
package io.element.android.appconfig
|
package io.element.android.appconfig
|
||||||
|
|
||||||
object TimelineConfig {
|
object TimelineConfig {
|
||||||
const val maxReadReceiptToDisplay = 3
|
const val MAX_READ_RECEIPT_TO_DISPLAY = 3
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ class LoggedInEventProcessor @Inject constructor(
|
||||||
roomMembershipObserver: RoomMembershipObserver,
|
roomMembershipObserver: RoomMembershipObserver,
|
||||||
sessionVerificationService: SessionVerificationService,
|
sessionVerificationService: SessionVerificationService,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private var observingJob: Job? = null
|
private var observingJob: Job? = null
|
||||||
|
|
||||||
private val displayLeftRoomMessage = roomMembershipObserver.updates
|
private val displayLeftRoomMessage = roomMembershipObserver.updates
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,6 @@ class LoggedInFlowNode @AssistedInject constructor(
|
||||||
buildContext = buildContext,
|
buildContext = buildContext,
|
||||||
plugins = plugins
|
plugins = plugins
|
||||||
) {
|
) {
|
||||||
|
|
||||||
interface Callback : Plugin {
|
interface Callback : Plugin {
|
||||||
fun onOpenBugReport()
|
fun onOpenBugReport()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,6 @@ class RootFlowNode @AssistedInject constructor(
|
||||||
buildContext = buildContext,
|
buildContext = buildContext,
|
||||||
plugins = plugins
|
plugins = plugins
|
||||||
) {
|
) {
|
||||||
|
|
||||||
override fun onBuilt() {
|
override fun onBuilt() {
|
||||||
matrixClientsHolder.restoreWithSavedState(buildContext.savedStateMap)
|
matrixClientsHolder.restoreWithSavedState(buildContext.savedStateMap)
|
||||||
super.onBuilt()
|
super.onBuilt()
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ private const val SAVE_INSTANCE_KEY = "io.element.android.x.di.MatrixClientsHold
|
||||||
@SingleIn(AppScope::class)
|
@SingleIn(AppScope::class)
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
class MatrixClientsHolder @Inject constructor(private val authenticationService: MatrixAuthenticationService) : MatrixClientProvider {
|
class MatrixClientsHolder @Inject constructor(private val authenticationService: MatrixAuthenticationService) : MatrixClientProvider {
|
||||||
|
|
||||||
private val sessionIdsToMatrixClient = ConcurrentHashMap<SessionId, MatrixClient>()
|
private val sessionIdsToMatrixClient = ConcurrentHashMap<SessionId, MatrixClient>()
|
||||||
private val restoreMutex = Mutex()
|
private val restoreMutex = Mutex()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 New Vector Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package io.element.android.appnav.loggedin
|
|
||||||
|
|
||||||
// sealed interface LoggedInEvents {
|
|
||||||
// data object MyEvent : LoggedInEvents
|
|
||||||
// }
|
|
||||||
|
|
@ -35,7 +35,6 @@ class LoggedInNode @AssistedInject constructor(
|
||||||
buildContext = buildContext,
|
buildContext = buildContext,
|
||||||
plugins = plugins
|
plugins = plugins
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun View(modifier: Modifier) {
|
override fun View(modifier: Modifier) {
|
||||||
val loggedInState = loggedInPresenter.present()
|
val loggedInState = loggedInPresenter.present()
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ class LoggedInPresenter @Inject constructor(
|
||||||
private val networkMonitor: NetworkMonitor,
|
private val networkMonitor: NetworkMonitor,
|
||||||
private val pushService: PushService,
|
private val pushService: PushService,
|
||||||
) : Presenter<LoggedInState> {
|
) : Presenter<LoggedInState> {
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun present(): LoggedInState {
|
override fun present(): LoggedInState {
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ open class LoadingRoomStateProvider : PreviewParameterProvider<LoadingRoomState>
|
||||||
|
|
||||||
@SingleIn(SessionScope::class)
|
@SingleIn(SessionScope::class)
|
||||||
class LoadingRoomStateFlowFactory @Inject constructor(private val matrixClient: MatrixClient) {
|
class LoadingRoomStateFlowFactory @Inject constructor(private val matrixClient: MatrixClient) {
|
||||||
|
|
||||||
fun create(lifecycleScope: CoroutineScope, roomId: RoomId): StateFlow<LoadingRoomState> =
|
fun create(lifecycleScope: CoroutineScope, roomId: RoomId): StateFlow<LoadingRoomState> =
|
||||||
getRoomFlow(roomId)
|
getRoomFlow(roomId)
|
||||||
.map { room ->
|
.map { room ->
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,6 @@ class RoomFlowNode @AssistedInject constructor(
|
||||||
buildContext = buildContext,
|
buildContext = buildContext,
|
||||||
plugins = plugins
|
plugins = plugins
|
||||||
) {
|
) {
|
||||||
|
|
||||||
data class Inputs(
|
data class Inputs(
|
||||||
val roomId: RoomId,
|
val roomId: RoomId,
|
||||||
val initialElement: RoomLoadedFlowNode.NavTarget = RoomLoadedFlowNode.NavTarget.Messages,
|
val initialElement: RoomLoadedFlowNode.NavTarget = RoomLoadedFlowNode.NavTarget.Messages,
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@ class RoomLoadedFlowNode @AssistedInject constructor(
|
||||||
buildContext = buildContext,
|
buildContext = buildContext,
|
||||||
plugins = plugins,
|
plugins = plugins,
|
||||||
), DaggerComponentOwner {
|
), DaggerComponentOwner {
|
||||||
|
|
||||||
interface Callback : Plugin {
|
interface Callback : Plugin {
|
||||||
fun onOpenRoom(roomId: RoomId)
|
fun onOpenRoom(roomId: RoomId)
|
||||||
fun onForwardedToSingleRoom(roomId: RoomId)
|
fun onForwardedToSingleRoom(roomId: RoomId)
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ class RootNavStateFlowFactory @Inject constructor(
|
||||||
private val matrixClientsHolder: MatrixClientsHolder,
|
private val matrixClientsHolder: MatrixClientsHolder,
|
||||||
private val loginUserStory: LoginUserStory,
|
private val loginUserStory: LoginUserStory,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private var currentCacheIndex = 0
|
private var currentCacheIndex = 0
|
||||||
|
|
||||||
fun create(savedStateMap: SavedStateMap?): Flow<RootNavState> {
|
fun create(savedStateMap: SavedStateMap?): Flow<RootNavState> {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ class RootPresenter @Inject constructor(
|
||||||
private val rageshakeDetectionPresenter: RageshakeDetectionPresenter,
|
private val rageshakeDetectionPresenter: RageshakeDetectionPresenter,
|
||||||
private val appErrorStateService: AppErrorStateService,
|
private val appErrorStateService: AppErrorStateService,
|
||||||
) : Presenter<RootState> {
|
) : Presenter<RootState> {
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun present(): RootState {
|
override fun present(): RootState {
|
||||||
val rageshakeDetectionState = rageshakeDetectionPresenter.present()
|
val rageshakeDetectionState = rageshakeDetectionPresenter.present()
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class RoomFlowNodeTest {
|
class RoomFlowNodeTest {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val instantTaskExecutorRule = InstantTaskExecutorRule()
|
val instantTaskExecutorRule = InstantTaskExecutorRule()
|
||||||
|
|
||||||
|
|
@ -49,7 +48,6 @@ class RoomFlowNodeTest {
|
||||||
val mainDispatcherRule = MainDispatcherRule()
|
val mainDispatcherRule = MainDispatcherRule()
|
||||||
|
|
||||||
private class FakeMessagesEntryPoint : MessagesEntryPoint {
|
private class FakeMessagesEntryPoint : MessagesEntryPoint {
|
||||||
|
|
||||||
var nodeId: String? = null
|
var nodeId: String? = null
|
||||||
var callback: MessagesEntryPoint.Callback? = null
|
var callback: MessagesEntryPoint.Callback? = null
|
||||||
|
|
||||||
|
|
@ -68,12 +66,10 @@ class RoomFlowNodeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private class FakeRoomDetailsEntryPoint : RoomDetailsEntryPoint {
|
private class FakeRoomDetailsEntryPoint : RoomDetailsEntryPoint {
|
||||||
|
|
||||||
var nodeId: String? = null
|
var nodeId: String? = null
|
||||||
|
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): RoomDetailsEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): RoomDetailsEntryPoint.NodeBuilder {
|
||||||
return object : RoomDetailsEntryPoint.NodeBuilder {
|
return object : RoomDetailsEntryPoint.NodeBuilder {
|
||||||
|
|
||||||
override fun params(params: RoomDetailsEntryPoint.Params): RoomDetailsEntryPoint.NodeBuilder {
|
override fun params(params: RoomDetailsEntryPoint.Params): RoomDetailsEntryPoint.NodeBuilder {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class LoggedInPresenterTest {
|
class LoggedInPresenterTest {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class LoadingRoomStateFlowFactoryTest {
|
class LoadingRoomStateFlowFactoryTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `flow should emit Loading and then Loaded when there is a room in cache`() = runTest {
|
fun `flow should emit Loading and then Loaded when there is a room in cache`() = runTest {
|
||||||
val room = FakeMatrixRoom(sessionId = A_SESSION_ID, roomId = A_ROOM_ID)
|
val room = FakeMatrixRoom(sessionId = A_SESSION_ID, roomId = A_ROOM_ID)
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ allprojects {
|
||||||
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
|
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
|
||||||
// See https://github.com/pinterest/ktlint/releases/
|
// See https://github.com/pinterest/ktlint/releases/
|
||||||
// TODO Regularly check for new version here ^
|
// TODO Regularly check for new version here ^
|
||||||
version.set("0.48.2")
|
version.set("1.1.1")
|
||||||
android.set(true)
|
android.set(true)
|
||||||
ignoreFailures.set(false)
|
ignoreFailures.set(false)
|
||||||
enableExperimentalRules.set(true)
|
enableExperimentalRules.set(true)
|
||||||
|
|
@ -100,8 +100,8 @@ allprojects {
|
||||||
kotlinOptions.allWarningsAsErrors = project.properties["allWarningsAsErrors"] == "true"
|
kotlinOptions.allWarningsAsErrors = project.properties["allWarningsAsErrors"] == "true"
|
||||||
|
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
// Uncomment to suppress Compose Kotlin compiler compatibility warning
|
|
||||||
/*
|
/*
|
||||||
|
// Uncomment to suppress Compose Kotlin compiler compatibility warning
|
||||||
freeCompilerArgs += listOf(
|
freeCompilerArgs += listOf(
|
||||||
"-P",
|
"-P",
|
||||||
"plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"
|
"plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"
|
||||||
|
|
@ -194,7 +194,7 @@ subprojects {
|
||||||
|
|
||||||
// Workaround for https://github.com/airbnb/Showkase/issues/335
|
// Workaround for https://github.com/airbnb/Showkase/issues/335
|
||||||
subprojects {
|
subprojects {
|
||||||
tasks.withType<KspTask>() {
|
tasks.withType<KspTask> {
|
||||||
doLast {
|
doLast {
|
||||||
fileTree(layout.buildDirectory).apply { include("**/*ShowkaseExtension*.kt") }.files.forEach { file ->
|
fileTree(layout.buildDirectory).apply { include("**/*ShowkaseExtension*.kt") }.files.forEach { file ->
|
||||||
ReplaceRegExp().apply {
|
ReplaceRegExp().apply {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ class AnalyticsOptInNode @AssistedInject constructor(
|
||||||
@Assisted plugins: List<Plugin>,
|
@Assisted plugins: List<Plugin>,
|
||||||
private val presenter: AnalyticsOptInPresenter,
|
private val presenter: AnalyticsOptInPresenter,
|
||||||
) : Node(buildContext, plugins = plugins) {
|
) : Node(buildContext, plugins = plugins) {
|
||||||
|
|
||||||
private fun onClickTerms(activity: Activity, darkTheme: Boolean) {
|
private fun onClickTerms(activity: Activity, darkTheme: Boolean) {
|
||||||
activity.openUrlInChromeCustomTab(null, darkTheme, AnalyticsConfig.POLICY_LINK)
|
activity.openUrlInChromeCustomTab(null, darkTheme, AnalyticsConfig.POLICY_LINK)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ class AnalyticsOptInPresenter @Inject constructor(
|
||||||
private val buildMeta: BuildMeta,
|
private val buildMeta: BuildMeta,
|
||||||
private val analyticsService: AnalyticsService,
|
private val analyticsService: AnalyticsService,
|
||||||
) : Presenter<AnalyticsOptInState> {
|
) : Presenter<AnalyticsOptInState> {
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun present(): AnalyticsOptInState {
|
override fun present(): AnalyticsOptInState {
|
||||||
val localCoroutineScope = rememberCoroutineScope()
|
val localCoroutineScope = rememberCoroutineScope()
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ class DefaultAnalyticsPreferencesPresenter @Inject constructor(
|
||||||
private val analyticsService: AnalyticsService,
|
private val analyticsService: AnalyticsService,
|
||||||
private val buildMeta: BuildMeta,
|
private val buildMeta: BuildMeta,
|
||||||
) : AnalyticsPreferencesPresenter {
|
) : AnalyticsPreferencesPresenter {
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun present(): AnalyticsPreferencesState {
|
override fun present(): AnalyticsPreferencesState {
|
||||||
val localCoroutineScope = rememberCoroutineScope()
|
val localCoroutineScope = rememberCoroutineScope()
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class AnalyticsOptInPresenterTest {
|
class AnalyticsOptInPresenterTest {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class AnalyticsPreferencesPresenterTest {
|
class AnalyticsPreferencesPresenterTest {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ import io.element.android.features.call.ui.ElementCallActivity
|
||||||
import io.element.android.libraries.designsystem.utils.CommonDrawables
|
import io.element.android.libraries.designsystem.utils.CommonDrawables
|
||||||
|
|
||||||
class CallForegroundService : Service() {
|
class CallForegroundService : Service() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun start(context: Context) {
|
fun start(context: Context) {
|
||||||
val intent = Intent(context, CallForegroundService::class.java)
|
val intent = Intent(context, CallForegroundService::class.java)
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ data class WidgetMessage(
|
||||||
@SerialName("action") val action: Action,
|
@SerialName("action") val action: Action,
|
||||||
@SerialName("data") val data: JsonElement? = null,
|
@SerialName("data") val data: JsonElement? = null,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
enum class Direction {
|
enum class Direction {
|
||||||
@SerialName("fromWidget")
|
@SerialName("fromWidget")
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ class CallScreenPresenter @AssistedInject constructor(
|
||||||
private val matrixClientsProvider: MatrixClientProvider,
|
private val matrixClientsProvider: MatrixClientProvider,
|
||||||
private val appCoroutineScope: CoroutineScope,
|
private val appCoroutineScope: CoroutineScope,
|
||||||
) : Presenter<CallScreenState> {
|
) : Presenter<CallScreenState> {
|
||||||
|
|
||||||
@AssistedFactory
|
@AssistedFactory
|
||||||
interface Factory {
|
interface Factory {
|
||||||
fun create(callType: CallType, navigator: CallScreenNavigator): CallScreenPresenter
|
fun create(callType: CallType, navigator: CallScreenNavigator): CallScreenPresenter
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ import android.net.Uri
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class CallIntentDataParser @Inject constructor() {
|
class CallIntentDataParser @Inject constructor() {
|
||||||
|
|
||||||
private val validHttpSchemes = sequenceOf("https")
|
private val validHttpSchemes = sequenceOf("https")
|
||||||
|
|
||||||
fun parse(data: String?): String? {
|
fun parse(data: String?): String? {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ import kotlinx.coroutines.flow.MutableSharedFlow
|
||||||
class WebViewWidgetMessageInterceptor(
|
class WebViewWidgetMessageInterceptor(
|
||||||
private val webView: WebView,
|
private val webView: WebView,
|
||||||
) : WidgetMessageInterceptor {
|
) : WidgetMessageInterceptor {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
// We call both the WebMessageListener and the JavascriptInterface objects in JS with this
|
// We call both the WebMessageListener and the JavascriptInterface objects in JS with this
|
||||||
// 'listenerName' so they can both receive the data from the WebView when
|
// 'listenerName' so they can both receive the data from the WebView when
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ import io.element.android.features.call.data.WidgetMessage
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
|
||||||
object WidgetMessageSerializer {
|
object WidgetMessageSerializer {
|
||||||
|
|
||||||
private val coder = Json { ignoreUnknownKeys = true }
|
private val coder = Json { ignoreUnknownKeys = true }
|
||||||
|
|
||||||
fun deserialize(message: String): Result<WidgetMessage> {
|
fun deserialize(message: String): Result<WidgetMessage> {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ import io.element.android.features.call.ui.mapWebkitPermissions
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class MapWebkitPermissionsTest {
|
class MapWebkitPermissionsTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `given Webkit's RESOURCE_AUDIO_CAPTURE returns Android's RECORD_AUDIO permission`() {
|
fun `given Webkit's RESOURCE_AUDIO_CAPTURE returns Android's RECORD_AUDIO permission`() {
|
||||||
val permission = mapWebkitPermissions(arrayOf(PermissionRequest.RESOURCE_AUDIO_CAPTURE))
|
val permission = mapWebkitPermissions(arrayOf(PermissionRequest.RESOURCE_AUDIO_CAPTURE))
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class CallScreenPresenterTest {
|
class CallScreenPresenterTest {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ import java.net.URLEncoder
|
||||||
|
|
||||||
@RunWith(RobolectricTestRunner::class)
|
@RunWith(RobolectricTestRunner::class)
|
||||||
class CallIntentDataParserTest {
|
class CallIntentDataParserTest {
|
||||||
|
|
||||||
private val callIntentDataParser = CallIntentDataParser()
|
private val callIntentDataParser = CallIntentDataParser()
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class DefaultCallWidgetProviderTest {
|
class DefaultCallWidgetProviderTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `getWidget - fails if the session does not exist`() = runTest {
|
fun `getWidget - fails if the session does not exist`() = runTest {
|
||||||
val provider = createProvider(matrixClientProvider = FakeMatrixClientProvider { Result.failure(Exception("Session not found")) })
|
val provider = createProvider(matrixClientProvider = FakeMatrixClientProvider { Result.failure(Exception("Session not found")) })
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ class FakeCallWidgetProvider(
|
||||||
private val widgetDriver: FakeWidgetDriver = FakeWidgetDriver(),
|
private val widgetDriver: FakeWidgetDriver = FakeWidgetDriver(),
|
||||||
private val url: String = "https://call.element.io",
|
private val url: String = "https://call.element.io",
|
||||||
) : CallWidgetProvider {
|
) : CallWidgetProvider {
|
||||||
|
|
||||||
var getWidgetCalled = false
|
var getWidgetCalled = false
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ import io.element.android.libraries.architecture.FeatureEntryPoint
|
||||||
import io.element.android.libraries.matrix.api.core.RoomId
|
import io.element.android.libraries.matrix.api.core.RoomId
|
||||||
|
|
||||||
interface CreateRoomEntryPoint : FeatureEntryPoint {
|
interface CreateRoomEntryPoint : FeatureEntryPoint {
|
||||||
|
|
||||||
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
|
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
|
||||||
interface NodeBuilder {
|
interface NodeBuilder {
|
||||||
fun callback(callback: Callback): NodeBuilder
|
fun callback(callback: Callback): NodeBuilder
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ class ConfigureRoomFlowNode @AssistedInject constructor(
|
||||||
buildContext = buildContext,
|
buildContext = buildContext,
|
||||||
plugins = plugins
|
plugins = plugins
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private val component by lazy {
|
private val component by lazy {
|
||||||
parent!!.bindings<CreateRoomComponent.ParentBindings>().createRoomComponentBuilder().build()
|
parent!!.bindings<CreateRoomComponent.ParentBindings>().createRoomComponentBuilder().build()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ import javax.inject.Inject
|
||||||
class CreateRoomDataStore @Inject constructor(
|
class CreateRoomDataStore @Inject constructor(
|
||||||
val selectedUserListDataStore: UserListDataStore,
|
val selectedUserListDataStore: UserListDataStore,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private val createRoomConfigFlow: MutableStateFlow<CreateRoomConfig> = MutableStateFlow(CreateRoomConfig())
|
private val createRoomConfigFlow: MutableStateFlow<CreateRoomConfig> = MutableStateFlow(CreateRoomConfig())
|
||||||
private var cachedAvatarUri: Uri? = null
|
private var cachedAvatarUri: Uri? = null
|
||||||
set(value) {
|
set(value) {
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@ class CreateRoomFlowNode @AssistedInject constructor(
|
||||||
buildContext = buildContext,
|
buildContext = buildContext,
|
||||||
plugins = plugins
|
plugins = plugins
|
||||||
) {
|
) {
|
||||||
|
|
||||||
sealed interface NavTarget : Parcelable {
|
sealed interface NavTarget : Parcelable {
|
||||||
@Parcelize
|
@Parcelize
|
||||||
data object Root : NavTarget
|
data object Root : NavTarget
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,10 @@ import javax.inject.Inject
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
class DefaultCreateRoomEntryPoint @Inject constructor() : CreateRoomEntryPoint {
|
class DefaultCreateRoomEntryPoint @Inject constructor() : CreateRoomEntryPoint {
|
||||||
|
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): CreateRoomEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): CreateRoomEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
return object : CreateRoomEntryPoint.NodeBuilder {
|
return object : CreateRoomEntryPoint.NodeBuilder {
|
||||||
|
|
||||||
override fun callback(callback: CreateRoomEntryPoint.Callback): CreateRoomEntryPoint.NodeBuilder {
|
override fun callback(callback: CreateRoomEntryPoint.Callback): CreateRoomEntryPoint.NodeBuilder {
|
||||||
plugins += callback
|
plugins += callback
|
||||||
return this
|
return this
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ class DefaultStartDMAction @Inject constructor(
|
||||||
private val matrixClient: MatrixClient,
|
private val matrixClient: MatrixClient,
|
||||||
private val analyticsService: AnalyticsService,
|
private val analyticsService: AnalyticsService,
|
||||||
) : StartDMAction {
|
) : StartDMAction {
|
||||||
|
|
||||||
override suspend fun execute(userId: UserId, actionState: MutableState<AsyncAction<RoomId>>) {
|
override suspend fun execute(userId: UserId, actionState: MutableState<AsyncAction<RoomId>>) {
|
||||||
actionState.value = AsyncAction.Loading
|
actionState.value = AsyncAction.Loading
|
||||||
when (val result = matrixClient.startDM(userId)) {
|
when (val result = matrixClient.startDM(userId)) {
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ class AddPeopleNode @AssistedInject constructor(
|
||||||
@Assisted plugins: List<Plugin>,
|
@Assisted plugins: List<Plugin>,
|
||||||
private val presenter: AddPeoplePresenter,
|
private val presenter: AddPeoplePresenter,
|
||||||
) : Node(buildContext, plugins = plugins) {
|
) : Node(buildContext, plugins = plugins) {
|
||||||
|
|
||||||
interface Callback : Plugin {
|
interface Callback : Plugin {
|
||||||
fun onContinue()
|
fun onContinue()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ class AddPeoplePresenter @Inject constructor(
|
||||||
userRepository: UserRepository,
|
userRepository: UserRepository,
|
||||||
dataStore: CreateRoomDataStore,
|
dataStore: CreateRoomDataStore,
|
||||||
) : Presenter<UserListState> {
|
) : Presenter<UserListState> {
|
||||||
|
|
||||||
private val userListPresenter = userListPresenterFactory.create(
|
private val userListPresenter = userListPresenterFactory.create(
|
||||||
UserListPresenterArgs(
|
UserListPresenterArgs(
|
||||||
selectionMode = SelectionMode.Multiple,
|
selectionMode = SelectionMode.Multiple,
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,8 @@ fun RoomPrivacyOption(
|
||||||
.align(Alignment.CenterVertically)
|
.align(Alignment.CenterVertically)
|
||||||
.size(48.dp),
|
.size(48.dp),
|
||||||
selected = isSelected,
|
selected = isSelected,
|
||||||
onClick = null // null recommended for accessibility with screenreaders
|
// null recommended for accessibility with screenreaders
|
||||||
|
onClick = null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ class ConfigureRoomNode @AssistedInject constructor(
|
||||||
private val presenter: ConfigureRoomPresenter,
|
private val presenter: ConfigureRoomPresenter,
|
||||||
private val analyticsService: AnalyticsService,
|
private val analyticsService: AnalyticsService,
|
||||||
) : Node(buildContext, plugins = plugins) {
|
) : Node(buildContext, plugins = plugins) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
lifecycle.subscribe(
|
lifecycle.subscribe(
|
||||||
onResume = {
|
onResume = {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ class ConfigureRoomPresenter @Inject constructor(
|
||||||
private val analyticsService: AnalyticsService,
|
private val analyticsService: AnalyticsService,
|
||||||
permissionsPresenterFactory: PermissionsPresenter.Factory,
|
permissionsPresenterFactory: PermissionsPresenter.Factory,
|
||||||
) : Presenter<ConfigureRoomState> {
|
) : Presenter<ConfigureRoomState> {
|
||||||
|
|
||||||
private val cameraPermissionPresenter: PermissionsPresenter = permissionsPresenterFactory.create(android.Manifest.permission.CAMERA)
|
private val cameraPermissionPresenter: PermissionsPresenter = permissionsPresenterFactory.create(android.Manifest.permission.CAMERA)
|
||||||
private var pendingPermissionRequest = false
|
private var pendingPermissionRequest = false
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ import io.element.android.libraries.di.SingleIn
|
||||||
@SingleIn(CreateRoomScope::class)
|
@SingleIn(CreateRoomScope::class)
|
||||||
@MergeSubcomponent(CreateRoomScope::class)
|
@MergeSubcomponent(CreateRoomScope::class)
|
||||||
interface CreateRoomComponent : NodeFactoriesBindings {
|
interface CreateRoomComponent : NodeFactoriesBindings {
|
||||||
|
|
||||||
@Subcomponent.Builder
|
@Subcomponent.Builder
|
||||||
interface Builder {
|
interface Builder {
|
||||||
fun build(): CreateRoomComponent
|
fun build(): CreateRoomComponent
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ class CreateRoomRootNode @AssistedInject constructor(
|
||||||
private val analyticsService: AnalyticsService,
|
private val analyticsService: AnalyticsService,
|
||||||
private val inviteFriendsUseCase: InviteFriendsUseCase,
|
private val inviteFriendsUseCase: InviteFriendsUseCase,
|
||||||
) : Node(buildContext, plugins = plugins) {
|
) : Node(buildContext, plugins = plugins) {
|
||||||
|
|
||||||
interface Callback : Plugin {
|
interface Callback : Plugin {
|
||||||
fun onCreateNewRoom()
|
fun onCreateNewRoom()
|
||||||
fun onStartChatSuccess(roomId: RoomId)
|
fun onStartChatSuccess(roomId: RoomId)
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ class CreateRoomRootPresenter @Inject constructor(
|
||||||
private val startDMAction: StartDMAction,
|
private val startDMAction: StartDMAction,
|
||||||
private val buildMeta: BuildMeta,
|
private val buildMeta: BuildMeta,
|
||||||
) : Presenter<CreateRoomRootState> {
|
) : Presenter<CreateRoomRootState> {
|
||||||
|
|
||||||
private val presenter = presenterFactory.create(
|
private val presenter = presenterFactory.create(
|
||||||
UserListPresenterArgs(
|
UserListPresenterArgs(
|
||||||
selectionMode = SelectionMode.Single,
|
selectionMode = SelectionMode.Single,
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ class DefaultUserListPresenter @AssistedInject constructor(
|
||||||
@Assisted val userRepository: UserRepository,
|
@Assisted val userRepository: UserRepository,
|
||||||
@Assisted val userListDataStore: UserListDataStore,
|
@Assisted val userListDataStore: UserListDataStore,
|
||||||
) : UserListPresenter {
|
) : UserListPresenter {
|
||||||
|
|
||||||
@AssistedFactory
|
@AssistedFactory
|
||||||
@ContributesBinding(SessionScope::class)
|
@ContributesBinding(SessionScope::class)
|
||||||
interface DefaultUserListFactory : UserListPresenter.Factory {
|
interface DefaultUserListFactory : UserListPresenter.Factory {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class UserListDataStore @Inject constructor() {
|
class UserListDataStore @Inject constructor() {
|
||||||
|
|
||||||
private val selectedUsers: MutableStateFlow<List<MatrixUser>> = MutableStateFlow(emptyList())
|
private val selectedUsers: MutableStateFlow<List<MatrixUser>> = MutableStateFlow(emptyList())
|
||||||
|
|
||||||
fun selectUser(user: MatrixUser) {
|
fun selectUser(user: MatrixUser) {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ import io.element.android.libraries.architecture.Presenter
|
||||||
import io.element.android.libraries.usersearch.api.UserRepository
|
import io.element.android.libraries.usersearch.api.UserRepository
|
||||||
|
|
||||||
interface UserListPresenter : Presenter<UserListState> {
|
interface UserListPresenter : Presenter<UserListState> {
|
||||||
|
|
||||||
interface Factory {
|
interface Factory {
|
||||||
fun create(
|
fun create(
|
||||||
args: UserListPresenterArgs,
|
args: UserListPresenterArgs,
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class DefaultStartDMActionTests {
|
class DefaultStartDMActionTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `when dm is found, assert state is updated with given room id`() = runTest {
|
fun `when dm is found, assert state is updated with given room id`() = runTest {
|
||||||
val matrixClient = FakeMatrixClient().apply {
|
val matrixClient = FakeMatrixClient().apply {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class AddPeoplePresenterTests {
|
class AddPeoplePresenterTests {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,6 @@ private const val AN_URI_FROM_GALLERY = "content://uri_from_gallery"
|
||||||
|
|
||||||
@RunWith(RobolectricTestRunner::class)
|
@RunWith(RobolectricTestRunner::class)
|
||||||
class ConfigureRoomPresenterTests {
|
class ConfigureRoomPresenterTests {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class CreateRoomRootPresenterTests {
|
class CreateRoomRootPresenterTests {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class DefaultUserListPresenterTests {
|
class DefaultUserListPresenterTests {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ package io.element.android.features.createroom.impl.userlist
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
|
||||||
class FakeUserListPresenter : UserListPresenter {
|
class FakeUserListPresenter : UserListPresenter {
|
||||||
|
|
||||||
private var state = aUserListState()
|
private var state = aUserListState()
|
||||||
|
|
||||||
fun givenState(state: UserListState) {
|
fun givenState(state: UserListState) {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import io.element.android.libraries.usersearch.api.UserRepository
|
||||||
class FakeUserListPresenterFactory(
|
class FakeUserListPresenterFactory(
|
||||||
private val fakeUserListPresenter: FakeUserListPresenter = FakeUserListPresenter()
|
private val fakeUserListPresenter: FakeUserListPresenter = FakeUserListPresenter()
|
||||||
) : UserListPresenter.Factory {
|
) : UserListPresenter.Factory {
|
||||||
|
|
||||||
override fun create(
|
override fun create(
|
||||||
args: UserListPresenterArgs,
|
args: UserListPresenterArgs,
|
||||||
userRepository: UserRepository,
|
userRepository: UserRepository,
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ import io.element.android.libraries.matrix.test.A_ROOM_ID
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
|
|
||||||
class FakeStartDMAction : StartDMAction {
|
class FakeStartDMAction : StartDMAction {
|
||||||
|
|
||||||
private var executeResult: AsyncAction<RoomId> = AsyncAction.Success(A_ROOM_ID)
|
private var executeResult: AsyncAction<RoomId> = AsyncAction.Success(A_ROOM_ID)
|
||||||
|
|
||||||
fun givenExecuteResult(result: AsyncAction<RoomId>) {
|
fun givenExecuteResult(result: AsyncAction<RoomId>) {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ import com.bumble.appyx.core.plugin.Plugin
|
||||||
import io.element.android.libraries.architecture.FeatureEntryPoint
|
import io.element.android.libraries.architecture.FeatureEntryPoint
|
||||||
|
|
||||||
interface FtueEntryPoint : FeatureEntryPoint {
|
interface FtueEntryPoint : FeatureEntryPoint {
|
||||||
|
|
||||||
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
|
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
|
||||||
|
|
||||||
interface NodeBuilder {
|
interface NodeBuilder {
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,10 @@ import javax.inject.Inject
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
class DefaultFtueEntryPoint @Inject constructor() : FtueEntryPoint {
|
class DefaultFtueEntryPoint @Inject constructor() : FtueEntryPoint {
|
||||||
|
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): FtueEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): FtueEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
return object : FtueEntryPoint.NodeBuilder {
|
return object : FtueEntryPoint.NodeBuilder {
|
||||||
|
|
||||||
override fun callback(callback: FtueEntryPoint.Callback): FtueEntryPoint.NodeBuilder {
|
override fun callback(callback: FtueEntryPoint.Callback): FtueEntryPoint.NodeBuilder {
|
||||||
plugins += callback
|
plugins += callback
|
||||||
return this
|
return this
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,6 @@ class FtueFlowNode @AssistedInject constructor(
|
||||||
buildContext = buildContext,
|
buildContext = buildContext,
|
||||||
plugins = plugins,
|
plugins = plugins,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
sealed interface NavTarget : Parcelable {
|
sealed interface NavTarget : Parcelable {
|
||||||
@Parcelize
|
@Parcelize
|
||||||
data object Placeholder : NavTarget
|
data object Placeholder : NavTarget
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ class MigrationScreenNode @AssistedInject constructor(
|
||||||
@Assisted plugins: List<Plugin>,
|
@Assisted plugins: List<Plugin>,
|
||||||
private val presenter: MigrationScreenPresenter,
|
private val presenter: MigrationScreenPresenter,
|
||||||
) : Node(buildContext, plugins = plugins) {
|
) : Node(buildContext, plugins = plugins) {
|
||||||
|
|
||||||
interface Callback : Plugin {
|
interface Callback : Plugin {
|
||||||
fun onMigrationFinished()
|
fun onMigrationFinished()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import javax.inject.Inject
|
||||||
class SharedPrefsMigrationScreenStore @Inject constructor(
|
class SharedPrefsMigrationScreenStore @Inject constructor(
|
||||||
@DefaultPreferences private val sharedPreferences: SharedPreferences,
|
@DefaultPreferences private val sharedPreferences: SharedPreferences,
|
||||||
) : MigrationScreenStore {
|
) : MigrationScreenStore {
|
||||||
|
|
||||||
override fun isMigrationScreenNeeded(sessionId: SessionId): Boolean {
|
override fun isMigrationScreenNeeded(sessionId: SessionId): Boolean {
|
||||||
return sharedPreferences.getBoolean(sessionId.toKey(), false).not()
|
return sharedPreferences.getBoolean(sessionId.toKey(), false).not()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ class NotificationsOptInNode @AssistedInject constructor(
|
||||||
@Assisted plugins: List<Plugin>,
|
@Assisted plugins: List<Plugin>,
|
||||||
presenterFactory: NotificationsOptInPresenter.Factory,
|
presenterFactory: NotificationsOptInPresenter.Factory,
|
||||||
) : Node(buildContext, plugins = plugins) {
|
) : Node(buildContext, plugins = plugins) {
|
||||||
|
|
||||||
interface Callback : NodeInputs {
|
interface Callback : NodeInputs {
|
||||||
fun onNotificationsOptInFinished()
|
fun onNotificationsOptInFinished()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ class NotificationsOptInPresenter @AssistedInject constructor(
|
||||||
private val permissionStateProvider: PermissionStateProvider,
|
private val permissionStateProvider: PermissionStateProvider,
|
||||||
private val buildVersionSdkIntProvider: BuildVersionSdkIntProvider,
|
private val buildVersionSdkIntProvider: BuildVersionSdkIntProvider,
|
||||||
) : Presenter<NotificationsOptInState> {
|
) : Presenter<NotificationsOptInState> {
|
||||||
|
|
||||||
@AssistedFactory
|
@AssistedFactory
|
||||||
interface Factory {
|
interface Factory {
|
||||||
fun create(callback: NotificationsOptInNode.Callback): NotificationsOptInPresenter
|
fun create(callback: NotificationsOptInNode.Callback): NotificationsOptInPresenter
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ class DefaultFtueState @Inject constructor(
|
||||||
private val lockScreenService: LockScreenService,
|
private val lockScreenService: LockScreenService,
|
||||||
private val matrixClient: MatrixClient,
|
private val matrixClient: MatrixClient,
|
||||||
) : FtueState {
|
) : FtueState {
|
||||||
|
|
||||||
override val shouldDisplayFlow = MutableStateFlow(isAnyStepIncomplete())
|
override val shouldDisplayFlow = MutableStateFlow(isAnyStepIncomplete())
|
||||||
|
|
||||||
override suspend fun reset() {
|
override suspend fun reset() {
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ class WelcomeNode @AssistedInject constructor(
|
||||||
@Assisted plugins: List<Plugin>,
|
@Assisted plugins: List<Plugin>,
|
||||||
private val buildMeta: BuildMeta,
|
private val buildMeta: BuildMeta,
|
||||||
) : Node(buildContext, plugins = plugins) {
|
) : Node(buildContext, plugins = plugins) {
|
||||||
|
|
||||||
interface Callback : Plugin {
|
interface Callback : Plugin {
|
||||||
fun onContinueClicked()
|
fun onContinueClicked()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import javax.inject.Inject
|
||||||
class AndroidWelcomeScreenState @Inject constructor(
|
class AndroidWelcomeScreenState @Inject constructor(
|
||||||
@DefaultPreferences private val sharedPreferences: SharedPreferences,
|
@DefaultPreferences private val sharedPreferences: SharedPreferences,
|
||||||
) : WelcomeScreenState {
|
) : WelcomeScreenState {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val IS_WELCOME_SCREEN_SHOWN = "is_welcome_screen_shown"
|
private const val IS_WELCOME_SCREEN_SHOWN = "is_welcome_screen_shown"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class DefaultFtueStateTests {
|
class DefaultFtueStateTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `given any check being false, should display flow is true`() = runTest {
|
fun `given any check being false, should display flow is true`() = runTest {
|
||||||
val coroutineScope = CoroutineScope(coroutineContext + SupervisorJob())
|
val coroutineScope = CoroutineScope(coroutineContext + SupervisorJob())
|
||||||
|
|
@ -130,7 +129,8 @@ class DefaultFtueStateTests {
|
||||||
FtueStep.NotificationsOptIn,
|
FtueStep.NotificationsOptIn,
|
||||||
FtueStep.LockscreenSetup,
|
FtueStep.LockscreenSetup,
|
||||||
FtueStep.AnalyticsOptIn,
|
FtueStep.AnalyticsOptIn,
|
||||||
null, // Final state
|
// Final state
|
||||||
|
null,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
|
|
@ -204,7 +204,8 @@ class DefaultFtueStateTests {
|
||||||
permissionStateProvider: FakePermissionStateProvider = FakePermissionStateProvider(permissionGranted = false),
|
permissionStateProvider: FakePermissionStateProvider = FakePermissionStateProvider(permissionGranted = false),
|
||||||
matrixClient: MatrixClient = FakeMatrixClient(),
|
matrixClient: MatrixClient = FakeMatrixClient(),
|
||||||
lockScreenService: LockScreenService = FakeLockScreenService(),
|
lockScreenService: LockScreenService = FakeLockScreenService(),
|
||||||
sdkIntVersion: Int = Build.VERSION_CODES.TIRAMISU, // First version where notification permission is required
|
// First version where notification permission is required
|
||||||
|
sdkIntVersion: Int = Build.VERSION_CODES.TIRAMISU,
|
||||||
) = DefaultFtueState(
|
) = DefaultFtueState(
|
||||||
sdkVersionProvider = FakeBuildVersionSdkIntProvider(sdkIntVersion),
|
sdkVersionProvider = FakeBuildVersionSdkIntProvider(sdkIntVersion),
|
||||||
coroutineScope = coroutineScope,
|
coroutineScope = coroutineScope,
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class MigrationScreenPresenterTest {
|
class MigrationScreenPresenterTest {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class NotificationsOptInPresenterTests {
|
class NotificationsOptInPresenterTests {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
package io.element.android.features.ftue.impl.welcome.state
|
package io.element.android.features.ftue.impl.welcome.state
|
||||||
|
|
||||||
class FakeWelcomeState : WelcomeScreenState {
|
class FakeWelcomeState : WelcomeScreenState {
|
||||||
|
|
||||||
private var isWelcomeScreenNeeded = true
|
private var isWelcomeScreenNeeded = true
|
||||||
|
|
||||||
override fun isWelcomeScreenNeeded(): Boolean {
|
override fun isWelcomeScreenNeeded(): Boolean {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ import io.element.android.libraries.architecture.FeatureEntryPoint
|
||||||
import io.element.android.libraries.matrix.api.core.RoomId
|
import io.element.android.libraries.matrix.api.core.RoomId
|
||||||
|
|
||||||
interface InviteListEntryPoint : FeatureEntryPoint {
|
interface InviteListEntryPoint : FeatureEntryPoint {
|
||||||
|
|
||||||
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
|
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
|
||||||
|
|
||||||
interface NodeBuilder {
|
interface NodeBuilder {
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,10 @@ import javax.inject.Inject
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
class DefaultInviteListEntryPoint @Inject constructor() : InviteListEntryPoint {
|
class DefaultInviteListEntryPoint @Inject constructor() : InviteListEntryPoint {
|
||||||
|
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): InviteListEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): InviteListEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
return object : InviteListEntryPoint.NodeBuilder {
|
return object : InviteListEntryPoint.NodeBuilder {
|
||||||
|
|
||||||
override fun callback(callback: InviteListEntryPoint.Callback): InviteListEntryPoint.NodeBuilder {
|
override fun callback(callback: InviteListEntryPoint.Callback): InviteListEntryPoint.NodeBuilder {
|
||||||
plugins += callback
|
plugins += callback
|
||||||
return this
|
return this
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ private val seenInvitesKey = stringSetPreferencesKey("seenInvites")
|
||||||
class DefaultSeenInvitesStore @Inject constructor(
|
class DefaultSeenInvitesStore @Inject constructor(
|
||||||
@ApplicationContext context: Context
|
@ApplicationContext context: Context
|
||||||
) : SeenInvitesStore {
|
) : SeenInvitesStore {
|
||||||
|
|
||||||
private val store = context.dataStore
|
private val store = context.dataStore
|
||||||
|
|
||||||
override fun seenRoomIds(): Flow<Set<RoomId>> =
|
override fun seenRoomIds(): Flow<Set<RoomId>> =
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ class InviteListNode @AssistedInject constructor(
|
||||||
@Assisted plugins: List<Plugin>,
|
@Assisted plugins: List<Plugin>,
|
||||||
private val presenter: InviteListPresenter,
|
private val presenter: InviteListPresenter,
|
||||||
) : Node(buildContext, plugins = plugins) {
|
) : Node(buildContext, plugins = plugins) {
|
||||||
|
|
||||||
private fun onBackClicked() {
|
private fun onBackClicked() {
|
||||||
plugins<InviteListEntryPoint.Callback>().forEach { it.onBackClicked() }
|
plugins<InviteListEntryPoint.Callback>().forEach { it.onBackClicked() }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ class InviteListPresenter @Inject constructor(
|
||||||
private val analyticsService: AnalyticsService,
|
private val analyticsService: AnalyticsService,
|
||||||
private val notificationDrawerManager: NotificationDrawerManager,
|
private val notificationDrawerManager: NotificationDrawerManager,
|
||||||
) : Presenter<InviteListState> {
|
) : Presenter<InviteListState> {
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun present(): InviteListState {
|
override fun present(): InviteListState {
|
||||||
val invites by client
|
val invites by client
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
|
|
||||||
class FakeSeenInvitesStore : SeenInvitesStore {
|
class FakeSeenInvitesStore : SeenInvitesStore {
|
||||||
|
|
||||||
private val existing = MutableStateFlow(emptySet<RoomId>())
|
private val existing = MutableStateFlow(emptySet<RoomId>())
|
||||||
private var provided: Set<RoomId>? = null
|
private var provided: Set<RoomId>? = null
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class LeaveRoomPresenterImplTest {
|
class LeaveRoomPresenterImplTest {
|
||||||
|
|
||||||
@get:Rule
|
@get:Rule
|
||||||
val warmUpRule = WarmUpRule()
|
val warmUpRule = WarmUpRule()
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue