mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Add preview with an image.
This commit is contained in:
+7
-2
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user