Extract Provider (and rename them) to their own file and move fixture(s) there.
This commit is contained in:
parent
41965a8bcc
commit
e120ca7163
46 changed files with 593 additions and 302 deletions
|
|
@ -17,9 +17,7 @@
|
|||
package io.element.android.features.preferences.root
|
||||
|
||||
import io.element.android.features.logout.LogoutPreferenceState
|
||||
import io.element.android.features.logout.aLogoutPreferenceState
|
||||
import io.element.android.features.rageshake.preferences.RageshakePreferencesState
|
||||
import io.element.android.features.rageshake.preferences.aRageshakePreferencesState
|
||||
import io.element.android.libraries.architecture.Async
|
||||
import io.element.android.libraries.matrix.ui.model.MatrixUser
|
||||
|
||||
|
|
@ -28,9 +26,3 @@ data class PreferencesRootState(
|
|||
val rageshakeState: RageshakePreferencesState,
|
||||
val myUser: Async<MatrixUser>,
|
||||
)
|
||||
|
||||
fun aPreferencesRootState() = PreferencesRootState(
|
||||
logoutState = aLogoutPreferenceState(),
|
||||
rageshakeState = aRageshakePreferencesState(),
|
||||
myUser = Async.Uninitialized
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* 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.features.preferences.root
|
||||
|
||||
import io.element.android.features.logout.aLogoutPreferenceState
|
||||
import io.element.android.features.rageshake.preferences.aRageshakePreferencesState
|
||||
import io.element.android.libraries.architecture.Async
|
||||
|
||||
fun aPreferencesRootState() = PreferencesRootState(
|
||||
logoutState = aLogoutPreferenceState(),
|
||||
rageshakeState = aRageshakePreferencesState(),
|
||||
myUser = Async.Uninitialized
|
||||
)
|
||||
|
|
@ -28,7 +28,7 @@ import io.element.android.libraries.architecture.Async
|
|||
import io.element.android.libraries.designsystem.components.preferences.PreferenceView
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
import io.element.android.libraries.matrix.ui.components.MatrixUserPreviewParameterProvider
|
||||
import io.element.android.libraries.matrix.ui.components.MatrixUserProvider
|
||||
import io.element.android.libraries.matrix.ui.model.MatrixUser
|
||||
import io.element.android.libraries.ui.strings.R as StringR
|
||||
|
||||
|
|
@ -59,12 +59,12 @@ fun PreferencesRootView(
|
|||
|
||||
@Preview
|
||||
@Composable
|
||||
fun PreferencesRootViewLightPreview(@PreviewParameter(MatrixUserPreviewParameterProvider::class) matrixUser: MatrixUser) =
|
||||
fun PreferencesRootViewLightPreview(@PreviewParameter(MatrixUserProvider::class) matrixUser: MatrixUser) =
|
||||
ElementPreviewLight { ContentToPreview(matrixUser) }
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
fun PreferencesRootViewDarkPreview(@PreviewParameter(MatrixUserPreviewParameterProvider::class) matrixUser: MatrixUser) =
|
||||
fun PreferencesRootViewDarkPreview(@PreviewParameter(MatrixUserProvider::class) matrixUser: MatrixUser) =
|
||||
ElementPreviewDark { ContentToPreview(matrixUser) }
|
||||
|
||||
@Composable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue