Skip to content

Commit

Permalink
Update project
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbel committed Jul 22, 2024
1 parent bec9913 commit 721bd79
Show file tree
Hide file tree
Showing 28 changed files with 87 additions and 52 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import coil3.request.ImageRequest
import coil3.request.crossfade
import org.jetbrains.compose.resources.stringResource
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo
import org.michaelbel.movies.persistence.database.ktx.letters
import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon
import org.michaelbel.movies.ui.ktx.lettersTextFontSizeSmall
import org.michaelbel.movies.ui.preview.AccountPreviewParameterProvider
import org.michaelbel.movies.ui.theme.MoviesTheme

@Composable
Expand Down Expand Up @@ -62,7 +64,7 @@ fun AccountAvatar(
@Preview
@Composable
private fun AccountAvatarPreview(
/*@PreviewParameter(AccountPreviewParameterProvider::class)*/ account: AccountPojo
@PreviewParameter(AccountPreviewParameterProvider::class) account: AccountPojo
) {
MoviesTheme {
AccountAvatar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import org.jetbrains.compose.resources.stringResource
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon
import org.michaelbel.movies.ui.icons.MoviesIcons
import org.michaelbel.movies.ui.preview.BooleanPreviewParameterProvider
import org.michaelbel.movies.ui.theme.MoviesTheme

@Composable
Expand All @@ -34,7 +36,7 @@ fun PasswordIcon(
@Preview
@Composable
private fun PasswordIconPreview(
/*@PreviewParameter(BooleanPreviewParameterProvider::class)*/ state: Boolean
@PreviewParameter(BooleanPreviewParameterProvider::class) state: Boolean
) {
MoviesTheme {
PasswordIcon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ import movies.core.ui.generated.resources.Res
import movies.core.ui.generated.resources.no_image
import org.jetbrains.compose.resources.stringResource
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.michaelbel.movies.network.config.formatPosterImage
import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo
import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon
import org.michaelbel.movies.ui.ktx.isErrorOrEmpty
import org.michaelbel.movies.ui.preview.MoviePreviewParameterProvider
import org.michaelbel.movies.ui.theme.MoviesTheme

@Composable
Expand Down Expand Up @@ -103,7 +105,7 @@ internal fun MovieColumn(
@Preview
@Composable
private fun MovieColumnPreview(
/*@PreviewParameter(MoviePreviewParameterProvider::class)*/ movie: MoviePojo
@PreviewParameter(MoviePreviewParameterProvider::class) movie: MoviePojo
) {
MoviesTheme {
MovieColumn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ import movies.core.ui.generated.resources.Res
import movies.core.ui.generated.resources.no_image
import org.jetbrains.compose.resources.stringResource
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.michaelbel.movies.network.config.formatPosterImage
import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo
import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon
import org.michaelbel.movies.ui.ktx.isErrorOrEmpty
import org.michaelbel.movies.ui.preview.MoviePreviewParameterProvider
import org.michaelbel.movies.ui.theme.MoviesTheme

@Composable
Expand Down Expand Up @@ -105,7 +107,7 @@ internal fun MovieColumnDesktop(
@Preview
@Composable
private fun MovieColumnDesktopPreview(
/*@PreviewParameter(MoviePreviewParameterProvider::class)*/ movie: MoviePojo
@PreviewParameter(MoviePreviewParameterProvider::class) movie: MoviePojo
) {
MoviesTheme {
MovieColumnDesktop(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ import coil3.request.ImageRequest
import coil3.request.crossfade
import org.jetbrains.compose.resources.stringResource
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.michaelbel.movies.network.config.formatBackdropImage
import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo
import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon
import org.michaelbel.movies.ui.ktx.isErrorOrEmpty
import org.michaelbel.movies.ui.preview.MoviePreviewParameterProvider
import org.michaelbel.movies.ui.strings.MoviesStrings
import org.michaelbel.movies.ui.theme.MoviesTheme

Expand Down Expand Up @@ -103,7 +105,7 @@ internal fun MovieRow(
@Preview
@Composable
private fun MovieRowPreview(
/*@PreviewParameter(MoviePreviewParameterProvider::class)*/ movie: MoviePojo
@PreviewParameter(MoviePreviewParameterProvider::class) movie: MoviePojo
) {
MoviesTheme {
MovieRow(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ import coil3.request.ImageRequest
import coil3.request.crossfade
import org.jetbrains.compose.resources.stringResource
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.michaelbel.movies.network.config.formatBackdropImage
import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo
import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon
import org.michaelbel.movies.ui.ktx.isErrorOrEmpty
import org.michaelbel.movies.ui.preview.MoviePreviewParameterProvider
import org.michaelbel.movies.ui.strings.MoviesStrings
import org.michaelbel.movies.ui.theme.MoviesTheme

Expand Down Expand Up @@ -105,7 +107,7 @@ internal fun MovieRowDesktop(
@Preview
@Composable
private fun MovieRowDesktopPreview(
/*@PreviewParameter(MoviePreviewParameterProvider::class)*/ movie: MoviePojo
@PreviewParameter(MoviePreviewParameterProvider::class) movie: MoviePojo
) {
MoviesTheme {
MovieRowDesktop(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.michaelbel.movies.ui.preview.provider
package org.michaelbel.movies.ui.preview

import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo
import org.michaelbel.movies.ui.preview.base.CollectionPreviewParameterProvider

class AccountPreviewParameterProvider: CollectionPreviewParameterProvider<AccountPojo>(
listOf(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.michaelbel.movies.ui.preview.provider
package org.michaelbel.movies.ui.preview

import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import org.michaelbel.movies.common.appearance.FeedView
import org.michaelbel.movies.ui.preview.base.CollectionPreviewParameterProvider

class AppearancePreviewParameterProvider: CollectionPreviewParameterProvider<FeedView>(FeedView.VALUES)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.michaelbel.movies.ui.preview

import org.michaelbel.movies.ui.preview.base.CollectionPreviewParameterProvider

class BooleanPreviewParameterProvider: CollectionPreviewParameterProvider<Boolean>(
listOf(true, false)
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.michaelbel.movies.ui.preview.provider
package org.michaelbel.movies.ui.preview

import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import org.michaelbel.movies.ui.appicon.IconAlias
import org.michaelbel.movies.ui.preview.base.CollectionPreviewParameterProvider

class IconAliasPreviewParameterProvider: CollectionPreviewParameterProvider<IconAlias>(IconAlias.VALUES)
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package org.michaelbel.movies.ui.preview.provider
package org.michaelbel.movies.ui.preview

import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import kotlinx.datetime.Clock
import org.michaelbel.movies.network.model.Movie
import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo
import org.michaelbel.movies.ui.preview.base.CollectionPreviewParameterProvider

class MovieDbPreviewParameterProvider: CollectionPreviewParameterProvider<MoviePojo>(
listOf(
MoviePojo(
movieList = Movie.NOW_PLAYING,
dateAdded = System.currentTimeMillis(),
dateAdded = Clock.System.now().toEpochMilliseconds(),
page = null,
position = 0,
movieId = 438148,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.michaelbel.movies.ui.preview.provider
package org.michaelbel.movies.ui.preview

import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import org.michaelbel.movies.common.list.MovieList
import org.michaelbel.movies.ui.preview.base.CollectionPreviewParameterProvider

class MovieListPreviewParameterProvider: CollectionPreviewParameterProvider<MovieList>(MovieList.VALUES)
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package org.michaelbel.movies.ui.preview.provider
package org.michaelbel.movies.ui.preview

import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import kotlinx.datetime.Clock
import org.michaelbel.movies.network.model.Movie
import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo
import org.michaelbel.movies.ui.preview.base.CollectionPreviewParameterProvider

class MoviePreviewParameterProvider: CollectionPreviewParameterProvider<MoviePojo>(
listOf(
MoviePojo(
movieList = Movie.NOW_PLAYING,
dateAdded = System.currentTimeMillis(),
dateAdded = Clock.System.now().toEpochMilliseconds(),
page = null,
position = 0,
movieId = 438148,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.michaelbel.movies.ui.preview.provider
package org.michaelbel.movies.ui.preview

import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo
import org.michaelbel.movies.ui.preview.base.CollectionPreviewParameterProvider

class SuggestionDbPreviewParameterProvider: CollectionPreviewParameterProvider<List<SuggestionPojo>>(
listOf(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.michaelbel.movies.ui.preview.provider
package org.michaelbel.movies.ui.preview

import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import org.michaelbel.movies.common.theme.AppTheme
import org.michaelbel.movies.ui.preview.base.CollectionPreviewParameterProvider

class ThemePreviewParameterProvider: CollectionPreviewParameterProvider<AppTheme>(AppTheme.VALUES)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.michaelbel.movies.ui.preview.provider
package org.michaelbel.movies.ui.preview

import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import org.michaelbel.movies.ui.preview.base.CollectionPreviewParameterProvider

class TitlePreviewParameterProvider: CollectionPreviewParameterProvider<String>(
listOf(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.michaelbel.movies.ui.preview.provider
package org.michaelbel.movies.ui.preview

import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
import org.michaelbel.movies.common.version.AppVersionData
import org.michaelbel.movies.ui.preview.base.CollectionPreviewParameterProvider

class VersionPreviewParameterProvider: CollectionPreviewParameterProvider<AppVersionData>(
listOf(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.michaelbel.movies.ui.preview.base

import org.jetbrains.compose.ui.tooling.preview.PreviewParameterProvider

open class CollectionPreviewParameterProvider<T>(
private val collection: Collection<T>
): PreviewParameterProvider<T> {

override val values: Sequence<T>
get() = collection.asSequence()
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.dp
import androidx.constraintlayout.compose.ConstraintLayout
import androidx.constraintlayout.compose.Dimension
Expand All @@ -33,14 +31,16 @@ import coil.compose.AsyncImage
import coil.compose.AsyncImagePainter
import coil.request.ImageRequest
import coil.request.SuccessResult
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.michaelbel.movies.network.config.formatBackdropImage
import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo
import org.michaelbel.movies.persistence.database.ktx.isNotEmpty
import org.michaelbel.movies.ui.accessibility.MoviesContentDescription
import org.michaelbel.movies.ui.placeholder.PlaceholderHighlight
import org.michaelbel.movies.ui.placeholder.material3.fade
import org.michaelbel.movies.ui.placeholder.placeholder
import org.michaelbel.movies.ui.preview.provider.MovieDbPreviewParameterProvider
import org.michaelbel.movies.ui.preview.MovieDbPreviewParameterProvider
import org.michaelbel.movies.ui.theme.MoviesTheme

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextOverflow
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.michaelbel.movies.ui.compose.iconbutton.BackIcon
import org.michaelbel.movies.ui.compose.iconbutton.ShareIcon
import org.michaelbel.movies.ui.ktx.modifierDisplayCutoutWindowInsets
import org.michaelbel.movies.ui.preview.TitlePreviewParameterProvider
import org.michaelbel.movies.ui.theme.MoviesTheme

@Composable
Expand Down Expand Up @@ -74,7 +76,7 @@ internal fun DetailsToolbar(
@Preview
@Composable
private fun DetailsToolbarPreview(
/*@PreviewParameter(TitlePreviewParameterProvider::class)*/ title: String
@PreviewParameter(TitlePreviewParameterProvider::class) title: String
) {
MoviesTheme {
DetailsToolbar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.dp
import androidx.constraintlayout.compose.ConstraintLayout
import androidx.constraintlayout.compose.Dimension
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo
import org.michaelbel.movies.ui.accessibility.MoviesContentDescription
import org.michaelbel.movies.ui.compose.iconbutton.CloseIcon
import org.michaelbel.movies.ui.icons.MoviesIcons
import org.michaelbel.movies.ui.preview.provider.MoviePreviewParameterProvider
import org.michaelbel.movies.ui.preview.MoviePreviewParameterProvider
import org.michaelbel.movies.ui.theme.MoviesTheme

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.dp
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo
import org.michaelbel.movies.ui.preview.provider.SuggestionDbPreviewParameterProvider
import org.michaelbel.movies.ui.preview.SuggestionDbPreviewParameterProvider
import org.michaelbel.movies.ui.theme.MoviesTheme

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.dp
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo
import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo
import org.michaelbel.movies.persistence.database.typealiases.MovieId
Expand All @@ -31,7 +31,7 @@ import org.michaelbel.movies.search_impl.R
import org.michaelbel.movies.ui.compose.iconbutton.BackIcon
import org.michaelbel.movies.ui.compose.iconbutton.CloseIcon
import org.michaelbel.movies.ui.compose.iconbutton.VoiceIcon
import org.michaelbel.movies.ui.preview.provider.SuggestionDbPreviewParameterProvider
import org.michaelbel.movies.ui.preview.SuggestionDbPreviewParameterProvider
import org.michaelbel.movies.ui.theme.MoviesTheme

@Composable
Expand Down
Loading

0 comments on commit 721bd79

Please sign in to comment.