Skip to content

Commit

Permalink
Bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisFn committed Nov 2, 2024
1 parent 30547cf commit a82dfd8
Show file tree
Hide file tree
Showing 33 changed files with 1,021 additions and 227 deletions.
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ dependencies {
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.process)
implementation(libs.retrofit.core)
implementation(libs.accompanist.systemuicontroller)
implementation(libs.timber)

debugImplementation(libs.leakcanary)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,27 @@ package com.louisfn.somovie.app.ui.main
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.graphics.Color
import androidx.core.view.WindowCompat
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.louisfn.somovie.ui.common.LocalAppRouter
import com.louisfn.somovie.ui.common.LocalMoshi
import com.louisfn.somovie.ui.common.base.BaseActivity
import com.louisfn.somovie.ui.common.navigation.AppRouter
import com.louisfn.somovie.ui.theme.AppTheme
import com.squareup.moshi.Moshi
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

@AndroidEntryPoint
internal class MainActivity : BaseActivity() {

@Inject
internal lateinit var moshi: Moshi

@Inject
internal lateinit var appRouter: AppRouter

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

WindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
CompositionLocalProvider(
LocalMoshi provides moshi,
LocalAppRouter provides appRouter,
) {
AppTheme {
val systemUiController = rememberSystemUiController()
SideEffect {
systemUiController.setSystemBarsColor(Color.Transparent)
}

MainScreen()
}
}
Expand Down
4 changes: 2 additions & 2 deletions build-logic/src/main/kotlin/AppConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

object AppConfig {
const val MIN_SDK_VERSION = 26
const val COMPILE_SDK_VERSION = 34
const val TARGET_SDK_VERSION = 34
const val COMPILE_SDK_VERSION = 35
const val TARGET_SDK_VERSION = 35

const val VERSION_CODE = 1
const val VERSION_NAME = "0.1.0"
Expand Down
6 changes: 4 additions & 2 deletions detekt/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ style:
- '10'
- '60'
- '24'
- '50'
- '100'
- '3600'
ignoreHashCodeFunction: true
ignorePropertyDeclaration: true
Expand Down Expand Up @@ -709,7 +711,7 @@ Compose:
ContentEmitterReturningValues:
active: true
ModifierComposable:
active: true
active: false
ModifierMissing:
active: true
ModifierReused:
Expand All @@ -729,7 +731,7 @@ Compose:
RememberMissing:
active: true
UnstableCollections:
active: true
active: false
ViewModelForwarding:
active: true
ViewModelInjection:
Expand Down
1 change: 0 additions & 1 deletion feature/home/account/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ dependencies {
implementation(project(":feature:home:common"))
implementation(project(":feature:login"))
implementation(libs.androidx.lifecycle.process)
implementation(libs.accompanist.webview)
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ private fun AccountScreen(
private fun AccountContent(
state: AccountUiState,
logInManager: LogInManager,
modifier: Modifier = Modifier,
onLogOutButtonClick: () -> Unit,
modifier: Modifier = Modifier,
) {
Box(
modifier = modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ sealed class HomeBottomSheetItem(
@StringRes val titleId: Int,
val icon: ImageVector,
) {
object Explore : HomeBottomSheetItem(ExploreNavigation, R.string.home_explore, Icons.Default.Movie)
object WatchList : HomeBottomSheetItem(WatchlistDestination, R.string.home_watchlist, Icons.AutoMirrored.Filled.List)
object Discover : HomeBottomSheetItem(DiscoverNavigation, R.string.home_discover, Icons.Default.Swipe)
object Account : HomeBottomSheetItem(AccountNavigation, R.string.home_account, Icons.Default.Settings)
data object Explore : HomeBottomSheetItem(ExploreNavigation, R.string.home_explore, Icons.Default.Movie)
data object WatchList : HomeBottomSheetItem(WatchlistDestination, R.string.home_watchlist, Icons.AutoMirrored.Filled.List)
data object Discover : HomeBottomSheetItem(DiscoverNavigation, R.string.home_discover, Icons.Default.Swipe)
data object Account : HomeBottomSheetItem(AccountNavigation, R.string.home_account, Icons.Default.Settings)
}

val HomeBottomSheetItems = listOf(Explore, WatchList, Discover, Account)
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,20 @@ internal fun DiscoverScreen(

DiscoverScreen(
uiState = uiState,
onSwiped = viewModel::onMovieSwiped,
onDisappeared = viewModel::onMovieDisappeared,
onSwipe = viewModel::onMovieSwipe,
onDisappear = viewModel::onMovieDisappeared,
retry = { viewModel.retry() },
onLogInSnackbarActionClicked = { showAccount() },
onLogInSnackbarActionClick = { showAccount() },
)
}

@Composable
private fun DiscoverScreen(
uiState: DiscoverUiState,
onSwiped: (MovieItem, SwipeDirection) -> Unit,
onDisappeared: (MovieItem) -> Unit,
onSwipe: (MovieItem, SwipeDirection) -> Unit,
onDisappear: (MovieItem) -> Unit,
retry: () -> Unit,
onLogInSnackbarActionClicked: () -> Unit,
onLogInSnackbarActionClick: () -> Unit,
) {
Box(
modifier = Modifier.fillMaxSize(),
Expand All @@ -83,9 +83,9 @@ private fun DiscoverScreen(
is DiscoverUiState.Discover -> DiscoverContent(
items = uiState.items,
logInSnackbarState = uiState.logInSnackbarState,
onSwiped = onSwiped,
onDisappeared = onDisappeared,
onLogInSnackbarActionClicked = onLogInSnackbarActionClicked,
onSwipe = onSwipe,
onDisappear = onDisappear,
onLogInSnackbarActionClick = onLogInSnackbarActionClick,
)
is DiscoverUiState.Retry -> Retry(
modifier = Modifier.align(Alignment.Center),
Expand All @@ -103,20 +103,20 @@ private fun DiscoverScreen(
private fun BoxScope.DiscoverContent(
items: ImmutableList<MovieItem>,
logInSnackbarState: LogInSnackbarState,
onSwiped: (MovieItem, SwipeDirection) -> Unit,
onDisappeared: (MovieItem) -> Unit,
onLogInSnackbarActionClicked: () -> Unit,
onSwipe: (MovieItem, SwipeDirection) -> Unit,
onDisappear: (MovieItem) -> Unit,
onLogInSnackbarActionClick: () -> Unit,
) {
DiscoverSwipeContainer(
items = items,
onSwiped = onSwiped,
onDisappeared = onDisappeared,
onSwipe = onSwipe,
onDisappear = onDisappear,
)
if (logInSnackbarState != LogInSnackbarState.HIDDEN) {
DefaultSnackbar(
message = stringResource(id = commonR.string.discover_log_in_description),
actionLabel = stringResource(id = commonR.string.discover_log_in_action),
onActionClick = onLogInSnackbarActionClicked,
onActionClick = onLogInSnackbarActionClick,
modifier = Modifier
.shake(logInSnackbarState == LogInSnackbarState.SHAKING)
.align(Alignment.BottomCenter),
Expand All @@ -127,8 +127,8 @@ private fun BoxScope.DiscoverContent(
@Composable
private fun BoxScope.DiscoverSwipeContainer(
items: ImmutableList<MovieItem>,
onSwiped: (MovieItem, SwipeDirection) -> Unit,
onDisappeared: (MovieItem) -> Unit,
onSwipe: (MovieItem, SwipeDirection) -> Unit,
onDisappear: (MovieItem) -> Unit,
) {
var draggingState by remember { mutableStateOf<DraggingState?>(null) }

Expand All @@ -139,12 +139,12 @@ private fun BoxScope.DiscoverSwipeContainer(
onDragging = { _, direction, ratio ->
draggingState = DraggingState(direction, ratio)
},
onCanceled = { draggingState = null },
onSwiped = { item, direction ->
onCancel = { draggingState = null },
onSwipe = { item, direction ->
draggingState = null
onSwiped(item, direction)
onSwipe(item, direction)
},
onDisappeared = { item, _ -> onDisappeared(item) },
onDisappear = { item, _ -> onDisappear(item) },
) { item ->
DiscoverMovieItem(item)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ internal class DiscoverViewModel @Inject constructor(
}

@AnyThread
fun onMovieSwiped(movieItem: MovieItem, direction: SwipeDirection) {
fun onMovieSwipe(movieItem: MovieItem, direction: SwipeDirection) {
viewModelScope.launch(defaultDispatcher) {
if (direction.shouldAddMovieToWatchlist()) {
if (!isLoggedIn.first()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class WatchListScreenTest {
scaffoldState = rememberScaffoldState(),
logInManager = FakeLogInManager(),
onMovieClick = {},
onMovieSwiped = {},
onMovieSwipe = {},
)
}
}
Expand Down Expand Up @@ -90,7 +90,7 @@ class WatchListScreenTest {
scaffoldState = rememberScaffoldState(),
logInManager = FakeLogInManager(),
onMovieClick = {},
onMovieSwiped = {},
onMovieSwipe = {},
)
}
}
Expand Down Expand Up @@ -127,7 +127,7 @@ class WatchListScreenTest {
scaffoldState = rememberScaffoldState(),
logInManager = FakeLogInManager(),
onMovieClick = {},
onMovieSwiped = {},
onMovieSwipe = {},
)
}
}
Expand Down Expand Up @@ -162,7 +162,7 @@ class WatchListScreenTest {
scaffoldState = rememberScaffoldState(),
logInManager = FakeLogInManager(),
onMovieClick = {},
onMovieSwiped = {},
onMovieSwipe = {},
)
}
}
Expand Down Expand Up @@ -201,7 +201,7 @@ class WatchListScreenTest {
scaffoldState = rememberScaffoldState(),
logInManager = FakeLogInManager(),
onMovieClick = {},
onMovieSwiped = {},
onMovieSwipe = {},
)
}
}
Expand Down Expand Up @@ -245,7 +245,7 @@ class WatchListScreenTest {
scaffoldState = rememberScaffoldState(),
logInManager = FakeLogInManager(),
onMovieClick = {},
onMovieSwiped = {},
onMovieSwipe = {},
)
}
}
Expand Down Expand Up @@ -284,7 +284,7 @@ class WatchListScreenTest {
scaffoldState = rememberScaffoldState(),
logInManager = FakeLogInManager(),
onMovieClick = {},
onMovieSwiped = {},
onMovieSwipe = {},
)
}
}
Expand Down Expand Up @@ -325,7 +325,7 @@ class WatchListScreenTest {
scaffoldState = rememberScaffoldState(),
logInManager = FakeLogInManager(),
onMovieClick = {},
onMovieSwiped = {},
onMovieSwipe = {},
)
}
}
Expand Down Expand Up @@ -362,7 +362,7 @@ class WatchListScreenTest {
scaffoldState = rememberScaffoldState(),
logInManager = FakeLogInManager(),
onMovieClick = {},
onMovieSwiped = {},
onMovieSwipe = {},
)
}
}
Expand Down Expand Up @@ -395,7 +395,7 @@ class WatchListScreenTest {
movie = movie,
isHidden = false,
onClick = {},
onSwiped = { isSwiped = true },
onSwipe = { isSwiped = true },
)
}
}
Expand Down Expand Up @@ -426,7 +426,7 @@ class WatchListScreenTest {
movie = movie,
isHidden = false,
onClick = {},
onSwiped = { isSwiped = true },
onSwipe = { isSwiped = true },
)
}
}
Expand All @@ -445,7 +445,7 @@ class WatchListScreenTest {
//region Undo dismissed Snackbar

@Test
fun shouldInvokedOnSnackbarActionPerformed_whenSnackbarActionClicked() {
fun shouldInvokedonSnackbarActionPerform_whenSnackbarActionClicked() {
// Given
val movieId = 1L
val action = flowOf<WatchlistAction>(ShowUndoSwipeToDismissSnackbar(movieId))
Expand All @@ -467,9 +467,9 @@ class WatchListScreenTest {
scaffoldState = rememberScaffoldState(),
logInManager = FakeLogInManager(),
onMovieClick = {},
onMovieSwiped = {},
onSnackbarActionPerformed = { isSnackbarActionPerformed = true },
onSnackbarDismissed = {},
onMovieSwipe = {},
onSnackbarActionPerform = { isSnackbarActionPerformed = true },
onSnackbarDismiss = {},
)
}
}
Expand All @@ -483,7 +483,7 @@ class WatchListScreenTest {
}

@Test
fun shouldInvokeOnSnackbarDismissed_whenSnackbarActionClicked() {
fun shouldInvokeonSnackbarDismiss_whenSnackbarActionClicked() {
// Given
val movieId = 1L
val action = flowOf<WatchlistAction>(ShowUndoSwipeToDismissSnackbar(movieId))
Expand All @@ -505,9 +505,9 @@ class WatchListScreenTest {
scaffoldState = rememberScaffoldState(),
logInManager = FakeLogInManager(),
onMovieClick = {},
onMovieSwiped = {},
onSnackbarActionPerformed = {},
onSnackbarDismissed = { isSnackbarDismissed = true },
onMovieSwipe = {},
onSnackbarActionPerform = {},
onSnackbarDismiss = { isSnackbarDismissed = true },
)
}
}
Expand Down
Loading

0 comments on commit a82dfd8

Please sign in to comment.