Skip to content

Commit

Permalink
Update project
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbel committed Jul 21, 2023
1 parent b5689c6 commit 1e9c1e7
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ import org.michaelbel.movies.common.localization.exceptions.InvalidLocaleExcepti
sealed class AppLanguage(
val code: String
) {
object English: AppLanguage("en") {
override fun toString(): String = "English"
}
data object English: AppLanguage("en")

object Russian: AppLanguage("ru") {
override fun toString(): String = "Russian"
}
data object Russian: AppLanguage("ru")

companion object {
fun transform(code: String): AppLanguage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@ import org.michaelbel.movies.common.theme.exceptions.InvalidThemeException
sealed class AppTheme(
val theme: Int
) {
object NightNo: AppTheme(AppCompatDelegate.MODE_NIGHT_NO) {
override fun toString(): String = "NightNo"
}
data object NightNo: AppTheme(AppCompatDelegate.MODE_NIGHT_NO)

object NightYes: AppTheme(AppCompatDelegate.MODE_NIGHT_YES) {
override fun toString(): String = "NightYes"
}
data object NightYes: AppTheme(AppCompatDelegate.MODE_NIGHT_YES)

object FollowSystem: AppTheme(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) {
override fun toString(): String = "FollowSystem"
}
data object FollowSystem: AppTheme(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)

companion object {
fun transform(theme: Int): AppTheme {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ internal fun AccountScreenContent(
) {
if (loading) {
CircularProgressIndicator(
modifier = Modifier
.size(24.dp),
modifier = Modifier.size(24.dp),
strokeWidth = 2.dp
)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ fun AccountToolbar(
private fun AccountToolbarPreview() {
MoviesTheme {
AccountToolbar(
modifier = Modifier
.background(MaterialTheme.colorScheme.primaryContainer),
modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer),
onNavigationIconClick = {}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ private fun AuthLinksBoxPreview() {
AuthLinksBox(
onTermsOfUseClick = {},
onPrivacyPolicyClick = {},
modifier = Modifier
.background(MaterialTheme.colorScheme.primaryContainer)
modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ fun AuthToolbar(
private fun AuthToolbarPreview() {
MoviesTheme {
AuthToolbar(
modifier = Modifier
.background(MaterialTheme.colorScheme.primaryContainer),
modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer),
onNavigationIconClick = {}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fun DetailsToolbar(
)
}
},
colors = TopAppBarDefaults.smallTopAppBarColors(
colors = TopAppBarDefaults.topAppBarColors(
containerColor = Color.Transparent
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.unit.dp
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.items
import androidx.paging.compose.itemContentType
import androidx.paging.compose.itemKey
import org.michaelbel.movies.domain.data.entity.MovieDb
import org.michaelbel.movies.entities.isTmdbApiKeyEmpty
import org.michaelbel.movies.ui.ktx.isNotEmpty
Expand All @@ -34,10 +35,15 @@ fun FeedContent(
state = listState,
contentPadding = contentPadding
) {
items(pagingItems) { movieItem ->
movieItem?.let { movie ->
items(
count = pagingItems.itemCount,
key = pagingItems.itemKey(),
contentType = pagingItems.itemContentType()
) { index ->
val movieDb: MovieDb? = pagingItems[index]
if (movieDb != null) {
FeedMovieBox(
movie = movie,
movie = movieDb,
modifier = Modifier
.fillMaxWidth()
.padding(
Expand All @@ -47,7 +53,7 @@ fun FeedContent(
.clip(MaterialTheme.shapes.small)
.background(MaterialTheme.colorScheme.inversePrimary)
.clickable {
onMovieClick(movie.movieId)
onMovieClick(movieDb.movieId)
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fun FeedToolbar(
}
}
},
colors = TopAppBarDefaults.smallTopAppBarColors(
colors = TopAppBarDefaults.topAppBarColors(
containerColor = MaterialTheme.colorScheme.inversePrimary
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal fun SettingsToolbar(
)
}
},
colors = TopAppBarDefaults.smallTopAppBarColors(
colors = TopAppBarDefaults.topAppBarColors(
containerColor = Color.Transparent
)
)
Expand Down

0 comments on commit 1e9c1e7

Please sign in to comment.