Add preview with an image.
This commit is contained in:
parent
8e104b7ae5
commit
c250adbb53
1 changed files with 7 additions and 2 deletions
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
package io.element.android.features.preferences.impl.user.editprofile
|
package io.element.android.features.preferences.impl.user.editprofile
|
||||||
|
|
||||||
|
import android.net.Uri
|
||||||
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
||||||
|
import androidx.core.net.toUri
|
||||||
import io.element.android.libraries.architecture.AsyncAction
|
import io.element.android.libraries.architecture.AsyncAction
|
||||||
import io.element.android.libraries.matrix.api.core.UserId
|
import io.element.android.libraries.matrix.api.core.UserId
|
||||||
import io.element.android.libraries.permissions.api.aPermissionsState
|
import io.element.android.libraries.permissions.api.aPermissionsState
|
||||||
|
|
@ -17,14 +19,17 @@ open class EditUserProfileStateProvider : PreviewParameterProvider<EditUserProfi
|
||||||
override val values: Sequence<EditUserProfileState>
|
override val values: Sequence<EditUserProfileState>
|
||||||
get() = sequenceOf(
|
get() = sequenceOf(
|
||||||
aEditUserProfileState(),
|
aEditUserProfileState(),
|
||||||
|
aEditUserProfileState(userAvatarUrl = "example://uri".toUri()),
|
||||||
// Add other states here
|
// Add other states here
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun aEditUserProfileState() = EditUserProfileState(
|
fun aEditUserProfileState(
|
||||||
|
userAvatarUrl: Uri? = null,
|
||||||
|
) = EditUserProfileState(
|
||||||
userId = UserId("@john.doe:matrix.org"),
|
userId = UserId("@john.doe:matrix.org"),
|
||||||
displayName = "John Doe",
|
displayName = "John Doe",
|
||||||
userAvatarUrl = null,
|
userAvatarUrl = userAvatarUrl,
|
||||||
avatarActions = persistentListOf(),
|
avatarActions = persistentListOf(),
|
||||||
saveAction = AsyncAction.Uninitialized,
|
saveAction = AsyncAction.Uninitialized,
|
||||||
saveButtonEnabled = true,
|
saveButtonEnabled = true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue