diff --git a/data/src/main/java/com/london/data/local/preference/AppPreferencesServiceImpl.kt b/data/src/main/java/com/london/data/local/preference/AppPreferencesServiceImpl.kt index 5de1959d5..458acb452 100644 --- a/data/src/main/java/com/london/data/local/preference/AppPreferencesServiceImpl.kt +++ b/data/src/main/java/com/london/data/local/preference/AppPreferencesServiceImpl.kt @@ -78,8 +78,11 @@ class AppPreferencesServiceImpl @Inject constructor( preferences.edit { putString(PreferencesKeys.CONTENT_RESTRICTION_KEY, level.name) } _contentRestrictionLevel.value = level } + //endregion + override fun clearAllPreferences() = preferences.edit { clear() } + private object PreferencesKeys { const val HAS_ONBOARDING_BEEN_SHOWN = "has_onboarding_been_shown" const val CONTENT_RESTRICTION_KEY = "content_restriction_key" diff --git a/data/src/main/java/com/london/data/repository/authentication/AuthenticationRepositoryImpl.kt b/data/src/main/java/com/london/data/repository/authentication/AuthenticationRepositoryImpl.kt index fe17291dd..876258c29 100644 --- a/data/src/main/java/com/london/data/repository/authentication/AuthenticationRepositoryImpl.kt +++ b/data/src/main/java/com/london/data/repository/authentication/AuthenticationRepositoryImpl.kt @@ -9,13 +9,15 @@ import com.london.data.remote.source.account.AccountRemoteDataSource import com.london.data.remote.source.authentication.AuthenticationRemoteDataSource import com.london.data.utils.isFailure import com.london.domain.repository.AuthenticationRepository +import com.london.domain.service.AppPreferencesService import javax.inject.Inject class AuthenticationRepositoryImpl @Inject constructor( private val authenticationRemoteDataSource: AuthenticationRemoteDataSource, private val accountRemoteDataSource: AccountRemoteDataSource, private val authenticationPreferences: AuthenticationPreferences, - private val customMovieListLocalDataSource: CustomMovieListLocalDataSource + private val customMovieListLocalDataSource: CustomMovieListLocalDataSource, + private val appPreferencesService: AppPreferencesService ) : AuthenticationRepository { override suspend fun login(username: String, password: String): Boolean { @@ -52,6 +54,7 @@ class AuthenticationRepositoryImpl @Inject constructor( } customMovieListLocalDataSource.clearAllCache() authenticationPreferences.clearAuthentication() + appPreferencesService.clearAllPreferences() return true } diff --git a/designSystem/src/main/java/com/london/designsystem/component/button/FloatingActionButton.kt b/designSystem/src/main/java/com/london/designsystem/component/button/FloatingActionButton.kt index 22e21b551..de194c8bc 100644 --- a/designSystem/src/main/java/com/london/designsystem/component/button/FloatingActionButton.kt +++ b/designSystem/src/main/java/com/london/designsystem/component/button/FloatingActionButton.kt @@ -35,7 +35,7 @@ fun FloatingActionButton( ) { if (isDisabledIcon || isDefaultIcon) { Icon( - painter = painterResource(id = R.drawable.icon_add), + painter = painterResource(id = R.drawable.add_icon), contentDescription = "Add button", modifier = Modifier.size(24.dp) ) diff --git a/designSystem/src/main/java/com/london/designsystem/component/button/OutlineButton.kt b/designSystem/src/main/java/com/london/designsystem/component/button/OutlineButton.kt index 46e74c224..e1c37894c 100644 --- a/designSystem/src/main/java/com/london/designsystem/component/button/OutlineButton.kt +++ b/designSystem/src/main/java/com/london/designsystem/component/button/OutlineButton.kt @@ -84,7 +84,7 @@ private fun PreviewNormalOutlineButton() { isLoading = false, hasIcon = false, hasLabel = true, - icon = R.drawable.icon_add + icon = R.drawable.add_icon ) } } @@ -130,7 +130,7 @@ private fun PreviewOutlinePrimaryWithIcon() { isLoading = false, hasIcon = true, hasLabel = true, - icon = R.drawable.icon_add + icon = R.drawable.add_icon ) } } @@ -145,7 +145,7 @@ private fun PreviewPrimaryWithIconOnly() { isLoading = false, hasIcon = true, hasLabel = false, - icon = R.drawable.icon_add + icon = R.drawable.add_icon ) } diff --git a/designSystem/src/main/java/com/london/designsystem/component/button/PrimaryButton.kt b/designSystem/src/main/java/com/london/designsystem/component/button/PrimaryButton.kt index ccad80228..4ab5a6364 100644 --- a/designSystem/src/main/java/com/london/designsystem/component/button/PrimaryButton.kt +++ b/designSystem/src/main/java/com/london/designsystem/component/button/PrimaryButton.kt @@ -89,7 +89,7 @@ private fun PreviewPrimaryNormal() { enabled = false, hasIcon = false, hasLabel = true, - icon = R.drawable.icon_add + icon = R.drawable.add_icon ) } } @@ -137,7 +137,7 @@ private fun PreviewPrimaryWithTextAndIcon() { enabled = false, hasIcon = true, hasLabel = true, - icon = R.drawable.icon_add + icon = R.drawable.add_icon ) } } @@ -153,7 +153,7 @@ private fun PreviewPrimaryWithIcon() { enabled = false, hasIcon = true, hasLabel = false, - icon = R.drawable.icon_add + icon = R.drawable.add_icon ) } diff --git a/designSystem/src/main/res/drawable-mdpi/ellipse_pre_blurred.png b/designSystem/src/main/res/drawable-mdpi/ellipse_pre_blurred.png deleted file mode 100644 index dc4063871..000000000 Binary files a/designSystem/src/main/res/drawable-mdpi/ellipse_pre_blurred.png and /dev/null differ diff --git a/designSystem/src/main/res/drawable-mdpi/icon_add.png b/designSystem/src/main/res/drawable-mdpi/icon_add.png deleted file mode 100644 index 446317f31..000000000 Binary files a/designSystem/src/main/res/drawable-mdpi/icon_add.png and /dev/null differ diff --git a/designSystem/src/main/res/drawable-xhdpi/ellipse_pre_blurred.png b/designSystem/src/main/res/drawable-xhdpi/ellipse_pre_blurred.png deleted file mode 100644 index 0de5cac36..000000000 Binary files a/designSystem/src/main/res/drawable-xhdpi/ellipse_pre_blurred.png and /dev/null differ diff --git a/designSystem/src/main/res/drawable-xhdpi/icon_add.png b/designSystem/src/main/res/drawable-xhdpi/icon_add.png deleted file mode 100644 index b771bc559..000000000 Binary files a/designSystem/src/main/res/drawable-xhdpi/icon_add.png and /dev/null differ diff --git a/designSystem/src/main/res/drawable-xxhdpi/ellipse_pre_blurred.png b/designSystem/src/main/res/drawable-xxhdpi/ellipse_pre_blurred.png deleted file mode 100644 index 4f1bd399f..000000000 Binary files a/designSystem/src/main/res/drawable-xxhdpi/ellipse_pre_blurred.png and /dev/null differ diff --git a/designSystem/src/main/res/drawable-xxhdpi/icon_add.png b/designSystem/src/main/res/drawable-xxhdpi/icon_add.png deleted file mode 100644 index dea86aafd..000000000 Binary files a/designSystem/src/main/res/drawable-xxhdpi/icon_add.png and /dev/null differ diff --git a/designSystem/src/main/res/drawable-xxxhdpi/ellipse_pre_blurred.png b/designSystem/src/main/res/drawable-xxxhdpi/ellipse_pre_blurred.png deleted file mode 100644 index d47658bc4..000000000 Binary files a/designSystem/src/main/res/drawable-xxxhdpi/ellipse_pre_blurred.png and /dev/null differ diff --git a/designSystem/src/main/res/drawable-xxxhdpi/icon_add.png b/designSystem/src/main/res/drawable-xxxhdpi/icon_add.png deleted file mode 100644 index 651a00420..000000000 Binary files a/designSystem/src/main/res/drawable-xxxhdpi/icon_add.png and /dev/null differ diff --git a/designSystem/src/main/res/drawable/ellipse_pre_blurred.webp b/designSystem/src/main/res/drawable/ellipse_pre_blurred.webp new file mode 100644 index 000000000..42e9f16c8 Binary files /dev/null and b/designSystem/src/main/res/drawable/ellipse_pre_blurred.webp differ diff --git a/designSystem/src/main/res/drawable/polygon1.png b/designSystem/src/main/res/drawable/polygon1.png deleted file mode 100644 index 38c09d90f..000000000 Binary files a/designSystem/src/main/res/drawable/polygon1.png and /dev/null differ diff --git a/domain/src/main/java/com/london/domain/service/AppPreferencesService.kt b/domain/src/main/java/com/london/domain/service/AppPreferencesService.kt index d5acaeb9f..0e0fa6858 100644 --- a/domain/src/main/java/com/london/domain/service/AppPreferencesService.kt +++ b/domain/src/main/java/com/london/domain/service/AppPreferencesService.kt @@ -19,4 +19,6 @@ interface AppPreferencesService { val contentRestrictionLevel: StateFlow fun setContentRestrictionLevel(level: ContentRestrictionLevel) + + fun clearAllPreferences() } diff --git a/presentation/src/main/java/com/london/presentation/feature/authentication/login/LoginScreen.kt b/presentation/src/main/java/com/london/presentation/feature/authentication/login/LoginScreen.kt index 41f44b304..271339bbd 100644 --- a/presentation/src/main/java/com/london/presentation/feature/authentication/login/LoginScreen.kt +++ b/presentation/src/main/java/com/london/presentation/feature/authentication/login/LoginScreen.kt @@ -94,14 +94,6 @@ private fun Content( .zIndex(1f) ) - Image( - painter = painterResource(dsR.drawable.polygon1), - contentDescription = stringResource(R.string.app_icon), - modifier = Modifier - .align(Alignment.TopStart) - .offset(y = (-60).dp, x = (-20).dp) - ) - Column( modifier = Modifier .fillMaxSize() diff --git a/presentation/src/main/java/com/london/presentation/feature/list/savedlist/ListScreen.kt b/presentation/src/main/java/com/london/presentation/feature/list/savedlist/ListScreen.kt index 2274d99a2..ecd8e4286 100644 --- a/presentation/src/main/java/com/london/presentation/feature/list/savedlist/ListScreen.kt +++ b/presentation/src/main/java/com/london/presentation/feature/list/savedlist/ListScreen.kt @@ -8,6 +8,7 @@ import androidx.compose.foundation.border import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxScope import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize @@ -54,6 +55,7 @@ import com.london.presentation.shared.BackgroundGradient import com.london.presentation.shared.base.ErrorState import com.london.presentation.shared.buildscreen.BuildScreen import com.london.presentation.utils.Listen +import com.london.presentation.utils.navBarBottomPadding import com.london.presentation.utils.toLocalizedNumbers @Composable @@ -86,7 +88,9 @@ private fun Content( val pagingItems = state.items.collectAsLazyPagingItems() Box( - modifier = Modifier.fillMaxSize() + modifier = Modifier + .fillMaxSize() + .navBarBottomPadding() ) { BuildScreen( @@ -96,7 +100,12 @@ private fun Content( pagingFlow = pagingItems, isGuest = state.isGuest, guestContent = { NoListFoundAsGuest(onLoginClick = contract::onLoginClick) }, - emptyContent = { EmptyList(contract = contract, addListSheetState = state.addListSheetState) }, + emptyContent = { + EmptyList( + contract = contract, + addListSheetState = state.addListSheetState + ) + }, handlePagingLoadingAutomatically = true ) { @@ -128,6 +137,8 @@ private fun Content( } } + ListFAB(contract::onFabClick) + AddListBottomSheet( addListInteractions = contract, addListSheetState = state.addListSheetState @@ -158,30 +169,28 @@ private fun Content( @Composable private fun ScreenScaffold( - titleRes: Int, - showFab: Boolean = true, onFabClick: (() -> Unit)? = null, content: @Composable () -> Unit, ) { - - Box( - modifier = Modifier.fillMaxSize() - ) { + Box(modifier = Modifier.fillMaxSize()) { content() - - if (showFab && onFabClick != null) { - FloatingActionButton( - modifier = Modifier - .align(Alignment.BottomEnd) - .padding(bottom = 16.dp, end = 16.dp), - onClick = onFabClick, - isLoadingIcon = false, - isDisabledIcon = false, - isDefaultIcon = true - ) - } + onFabClick?.let { ListFAB(onFabClick) } } +} +@Composable +fun BoxScope.ListFAB( + onFabClick: () -> Unit +) { + FloatingActionButton( + modifier = Modifier + .align(Alignment.BottomEnd) + .padding(bottom = 16.dp, end = 16.dp), + onClick = onFabClick, + isLoadingIcon = false, + isDisabledIcon = false, + isDefaultIcon = true + ) } @Composable @@ -248,9 +257,7 @@ private fun EmptyList( addListSheetState: AddSheetState ) { ScreenScaffold( - titleRes = R.string.saved_list_title, - onFabClick = contract::onFabClick, - showFab = true, + onFabClick = contract::onFabClick ) { Box( modifier = Modifier @@ -280,10 +287,7 @@ private fun NoListFoundAsGuest( onLoginClick: () -> Unit, modifier: Modifier = Modifier ) { - ScreenScaffold( - titleRes = R.string.saved_list_title, - showFab = false - ) { + ScreenScaffold { Box( modifier = Modifier.fillMaxSize() ) {