Init analytics modules (#350)
This commit is contained in:
parent
93456e8d44
commit
f534ecda96
125 changed files with 2018 additions and 2130 deletions
|
|
@ -17,6 +17,7 @@
|
|||
package io.element.android.features.preferences.impl.root
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import io.element.android.features.analytics.api.preferences.AnalyticsPreferencesPresenter
|
||||
import io.element.android.features.logout.api.LogoutPreferencePresenter
|
||||
import io.element.android.features.rageshake.api.preferences.RageshakePreferencesPresenter
|
||||
import io.element.android.libraries.architecture.Async
|
||||
|
|
@ -27,6 +28,7 @@ import javax.inject.Inject
|
|||
class PreferencesRootPresenter @Inject constructor(
|
||||
private val logoutPresenter: LogoutPreferencePresenter,
|
||||
private val rageshakePresenter: RageshakePreferencesPresenter,
|
||||
private val analyticsPresenter: AnalyticsPreferencesPresenter,
|
||||
private val buildType: BuildType,
|
||||
) : Presenter<PreferencesRootState> {
|
||||
|
||||
|
|
@ -34,10 +36,12 @@ class PreferencesRootPresenter @Inject constructor(
|
|||
override fun present(): PreferencesRootState {
|
||||
val logoutState = logoutPresenter.present()
|
||||
val rageshakeState = rageshakePresenter.present()
|
||||
val analyticsState = analyticsPresenter.present()
|
||||
val showDeveloperSettings = buildType != BuildType.RELEASE
|
||||
return PreferencesRootState(
|
||||
logoutState = logoutState,
|
||||
rageshakeState = rageshakeState,
|
||||
analyticsState = analyticsState,
|
||||
myUser = Async.Uninitialized,
|
||||
showDeveloperSettings = showDeveloperSettings
|
||||
)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package io.element.android.features.preferences.impl.root
|
||||
|
||||
import io.element.android.features.analytics.api.preferences.AnalyticsPreferencesState
|
||||
import io.element.android.features.logout.api.LogoutPreferenceState
|
||||
import io.element.android.features.rageshake.api.preferences.RageshakePreferencesState
|
||||
import io.element.android.libraries.architecture.Async
|
||||
|
|
@ -24,6 +25,7 @@ import io.element.android.libraries.matrix.api.user.MatrixUser
|
|||
data class PreferencesRootState(
|
||||
val logoutState: LogoutPreferenceState,
|
||||
val rageshakeState: RageshakePreferencesState,
|
||||
val analyticsState: AnalyticsPreferencesState,
|
||||
val myUser: Async<MatrixUser>,
|
||||
val showDeveloperSettings: Boolean
|
||||
)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package io.element.android.features.preferences.impl.root
|
||||
|
||||
import io.element.android.features.analytics.api.preferences.aAnalyticsPreferencesState
|
||||
import io.element.android.features.logout.api.aLogoutPreferenceState
|
||||
import io.element.android.features.rageshake.api.preferences.aRageshakePreferencesState
|
||||
import io.element.android.libraries.architecture.Async
|
||||
|
|
@ -23,6 +24,7 @@ import io.element.android.libraries.architecture.Async
|
|||
fun aPreferencesRootState() = PreferencesRootState(
|
||||
logoutState = aLogoutPreferenceState(),
|
||||
rageshakeState = aRageshakePreferencesState(),
|
||||
analyticsState = aAnalyticsPreferencesState(),
|
||||
myUser = Async.Uninitialized,
|
||||
showDeveloperSettings = true
|
||||
)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import androidx.compose.ui.res.stringResource
|
|||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||
import io.element.android.features.logout.api.LogoutPreferenceView
|
||||
import io.element.android.features.preferences.impl.user.UserPreferences
|
||||
import io.element.android.features.analytics.api.preferences.AnalyticsPreferencesView
|
||||
import io.element.android.features.rageshake.api.preferences.RageshakePreferencesView
|
||||
import io.element.android.libraries.architecture.Async
|
||||
import io.element.android.libraries.designsystem.components.preferences.PreferenceCategory
|
||||
|
|
@ -52,6 +53,9 @@ fun PreferencesRootView(
|
|||
title = stringResource(id = StringR.string.common_settings)
|
||||
) {
|
||||
UserPreferences(state.myUser)
|
||||
AnalyticsPreferencesView(
|
||||
state = state.analyticsState,
|
||||
)
|
||||
RageshakePreferencesView(
|
||||
state = state.rageshakeState,
|
||||
onOpenRageshake = onOpenRageShake,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue