-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify Gallery state object for inclusion of a user state
- Loading branch information
Showing
9 changed files
with
103 additions
and
119 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
gallery-app/src/androidMain/kotlin/io/ashdavies/gallery/GalleryScreen.preview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.ashdavies.gallery | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import io.ashdavies.content.PlatformContext | ||
|
||
private val DefaultState = GalleryScreen.State( | ||
itemList = emptyList(), | ||
showCapture = false, | ||
isLoggedIn = false, | ||
eventSink = { }, | ||
) | ||
|
||
private val EmptyStorageManager = object : StorageManager { | ||
override fun create(context: PlatformContext): File = TempFile | ||
override fun delete(file: File): Boolean = false | ||
} | ||
|
||
private val TempFile = File.createTempFile( | ||
/* prefix = */ "tmp", | ||
/* suffix = */ null, | ||
) | ||
|
||
@Preview | ||
@Composable | ||
internal fun GalleryCaptureDefaultPreview() { | ||
GalleryCapture(EmptyStorageManager) { } | ||
} | ||
|
||
@Preview | ||
@Composable | ||
internal fun GalleryBottomBarDefaultPreview() { | ||
GalleryBottomBar(DefaultState, isSelecting = false) | ||
} | ||
|
||
@Preview | ||
@Composable | ||
internal fun GalleryBottomBarSelectingPreview() { | ||
GalleryBottomBar(DefaultState, isSelecting = true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.