Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private fun NavGraphBuilder.onListNavGraph(navController: NavHostController) =
appComposable<Lists> {
ListScreen(
onNavigateToListDetails = ::navigateToListDetails,
onNavigateToLogin = ::navigateToLoginWithPopUp,
onNavigateToLogin = ::navigateToLogin,
)
}
appComposable<ViewListItems> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private fun Content(

LazyColumn(
modifier = Modifier.fillMaxSize(),
contentPadding = PaddingValues(bottom = 16.dp),
contentPadding = PaddingValues(bottom = 24.dp),
state = lazyState
) {
item {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.london.presentation.feature.home.trending.actor

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand Down Expand Up @@ -73,42 +74,48 @@ private fun Content(

Box(
modifier = Modifier.fillMaxSize()
){
) {
BackgroundGradient(
modifier = Modifier.align(Alignment.TopStart).zIndex(1f)
modifier = Modifier
.align(Alignment.TopStart)
.zIndex(1f)
)

LazyColumn(
Column (
modifier = Modifier
.fillMaxSize()
.padding(horizontal = 16.dp)
.background(color = NovixTheme.colors.surface),
contentPadding = PaddingValues(bottom = 16.dp)
) {
stickyHeader {
TopBar(
title = stringResource(R.string.trending_people),
onBackClick = contract::onBackClick,
modifier = Modifier
.fillMaxWidth()
.background(NovixTheme.colors.surface)
.padding(vertical = 12.dp)
)
}
TopBar(
title = stringResource(R.string.trending_people),
onBackClick = contract::onBackClick,
modifier = Modifier
.fillMaxWidth()
.background(NovixTheme.colors.surface)
.padding(vertical = 12.dp)
)

LazyColumn(
modifier = Modifier
.fillMaxSize()
.background(color = NovixTheme.colors.surface),
contentPadding = PaddingValues(bottom = 24.dp)
) {

item {
LazyPagingColumn(
pagingItems = state.actorsFlow.collectAsLazyPagingItems(),
modifier = Modifier.fillMaxSize(),
itemContent = { actor ->
ActorItem(
actorName = actor.name,
characterName = null,
imageRes = actor.profilePictureUrl,
onClick = { contract.onActorClick(actor.id) }
)
}
)
item {
LazyPagingColumn(
pagingItems = state.actorsFlow.collectAsLazyPagingItems(),
modifier = Modifier.fillMaxSize(),
itemContent = { actor ->
ActorItem(
actorName = actor.name,
characterName = null,
imageRes = actor.profilePictureUrl,
onClick = { contract.onActorClick(actor.id) }
)
}
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.london.presentation.feature.home.trending.movie
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -72,9 +73,11 @@ private fun Content(

Box(
modifier = Modifier.fillMaxSize()
){
) {
BackgroundGradient(
modifier = Modifier.align(Alignment.TopStart).zIndex(1f)
modifier = Modifier
.align(Alignment.TopStart)
.zIndex(1f)
)
Column(
modifier = Modifier
Expand Down Expand Up @@ -107,7 +110,8 @@ private fun Content(
.fillMaxWidth()
.padding(horizontal = 16.dp),
onSaveClick = { contract.onManageBookmarkClicked(it.id) },
hasSaveIcon = true
hasSaveIcon = true,
contentPadding = PaddingValues(bottom = 24.dp)
)

BookmarkBottomSheet(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.london.presentation.feature.home.trending.tvshow
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -73,9 +74,11 @@ private fun Content(

Box(
modifier = Modifier.fillMaxSize()
){
) {
BackgroundGradient(
modifier = Modifier.align(Alignment.TopStart).zIndex(1f)
modifier = Modifier
.align(Alignment.TopStart)
.zIndex(1f)
)
Column(
modifier = Modifier
Expand Down Expand Up @@ -106,8 +109,9 @@ private fun Content(
.weight(1f)
.fillMaxWidth()
.padding(horizontal = 16.dp),
onSaveClick = { /* TODO: Implement save functionality */ },
onSaveClick = { },
isItemSaved = { false },
contentPadding = PaddingValues(bottom = 24.dp)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import com.london.presentation.feature.home.HomeScreenContract
import com.london.presentation.feature.home.HomeScreenUiState
import com.london.presentation.shared.GenresSection
import com.london.presentation.shared.HomeCard
import com.london.presentation.shared.ShimmerMovieCard

@Composable
fun UpcomingSectionTitle(isLoading: Boolean) {
Expand Down Expand Up @@ -102,13 +103,3 @@ fun UpcomingMovieItem(
}
}
}

@Composable
private fun ShimmerMovieCard() {
Box(
modifier = Modifier
.height(240.dp)
.clip(RoundedCornerShape(12.dp))
.shimmerEffect()
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,9 @@ class ListViewModel @Inject constructor(
override fun onListNameChanged(listName: TextFieldValue) =
updateState { copy(addListSheetState = addListSheetState.copy(listName = listName)) }

override fun resetSnackBarErrorState() {
updateState { copy(isSnackBarSuccessVisible = false) }
}
override fun resetSnackBarErrorState() = updateState { copy(error = null) }

override fun resetSnackBarSuccessState() {
updateState { copy(error = null) }
}
override fun resetSnackBarSuccessState() = updateState { copy(isSnackBarSuccessVisible = false) }

override fun onAddList(listName: String) {
tryToExecute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
Expand Down Expand Up @@ -34,7 +35,8 @@ fun HomeCard(
hasSaveIcon: Boolean = true,
onDeleteClick: () -> Unit = {},
imageDescription: String? = null,
hasOverlay: Boolean = false
hasOverlay: Boolean = false,
isLoadingShimmer: Boolean = false
) {
Box(
modifier = Modifier
Expand All @@ -56,7 +58,14 @@ fun HomeCard(
modifier = Modifier.matchParentSize(),
contentScale = ContentScale.Crop,
errorContent = { ErrorImage() },
loadingContent = { CircularLoading(modifier = Modifier.align(Alignment.Center)) },
loadingContent = {
if (isLoadingShimmer) ShimmerMovieCard(
modifier = Modifier
.fillMaxSize()
.align(Alignment.Center)
)
else CircularLoading(modifier = Modifier.align(Alignment.Center))
},
moderatedContent = { UnSuitableEye() }
)
if (hasSaveIcon)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.paging.compose.LazyPagingItems
import com.london.presentation.utils.gridColumns
import com.london.presentation.utils.isNotLoading

@Deprecated(
message = "Use MediaLazyVerticalGrid or MediaLazyGridWithFilter instead. This composable will be removed in a future version. Note: Both have two overloads - one for List<T> and one for LazyPagingItems<T>.",
Expand Down Expand Up @@ -59,14 +60,15 @@ fun <T : Any> MediaLazyPagingGrid(
onSaveClick: (T) -> Unit = {},
isItemSaved: (T) -> Boolean = { false },
hasSaveIcon: Boolean = false,
contentPadding: PaddingValues = PaddingValues(bottom = 16.dp)
) {
LazyVerticalGrid(
state = rememberLazyGridState(),
columns = GridCells.Fixed(gridColumns()),
modifier = modifier.fillMaxSize(),
horizontalArrangement = Arrangement.spacedBy(12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(bottom = 16.dp)
contentPadding = contentPadding
) {
items(pagingFlow.itemCount) { index ->
val item = pagingFlow[index]
Expand All @@ -77,7 +79,8 @@ fun <T : Any> MediaLazyPagingGrid(
onSaveClick = { onSaveClick(item) },
isSaved = isItemSaved(item),
imageDescription = getTitle(item),
modifier = Modifier.clickable { onItemClick(item) }
modifier = Modifier.clickable { onItemClick(item) },
isLoadingShimmer = true
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.london.presentation.shared

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.unit.dp
import com.london.designsystem.utils.shimmerEffect

@Composable
fun ShimmerMovieCard(modifier: Modifier = Modifier) {
Box(
modifier = modifier
.height(240.dp)
.clip(RoundedCornerShape(12.dp))
.shimmerEffect()
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ fun <T : Any> LazyPagingItems<T>.isEmpty(): Boolean = itemSnapshotList.isEmpty()

fun <T : Any> LazyPagingItems<T>.isLoading(): Boolean = loadState.refresh is LoadState.Loading

fun <T : Any> LazyPagingItems<T>.isNotLoading(): Boolean = loadState.refresh !is LoadState.Loading

fun <T : Any> LazyPagingItems<T>.isError(): Boolean = loadState.refresh is LoadState.Error
Loading