Skip to content

Commit

Permalink
fix(deps): update dependency androidx.compose:compose-bom to v2024.11…
Browse files Browse the repository at this point in the history
….00 (#1094)

* fix(deps): update dependency androidx.compose:compose-bom to v2024.11.00

* fix issues

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Anil Kumar Beesetti <anilbeesetti10@gmail.com>
  • Loading branch information
renovate[bot] and anilbeesetti authored Dec 7, 2024
1 parent 02cc757 commit e3b6d26
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListScope
Expand Down Expand Up @@ -147,7 +143,6 @@ fun OptionsBottomSheet(
ModalBottomSheet(
onDismissRequest = onDismiss,
sheetState = sheetState,
windowInsets = WindowInsets.navigationBars.only(WindowInsetsSides.Bottom),
) {
Column(modifier = Modifier.padding(bottom = 8.dp)) {
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
Expand All @@ -34,11 +33,10 @@ import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.pulltorefresh.PullToRefreshContainer
import androidx.compose.material3.pulltorefresh.PullToRefreshBox
import androidx.compose.material3.pulltorefresh.rememberPullToRefreshState
import androidx.compose.material3.surfaceColorAtElevation
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
Expand All @@ -47,7 +45,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
Expand Down Expand Up @@ -137,20 +134,6 @@ internal fun MediaPickerScreen(

val pullToRefreshState = rememberPullToRefreshState()

LaunchedEffect(pullToRefreshState.isRefreshing) {
if (pullToRefreshState.isRefreshing) {
onRefreshClicked()
}
}

LaunchedEffect(isRefreshing) {
if (isRefreshing) {
pullToRefreshState.startRefresh()
} else {
pullToRefreshState.endRefresh()
}
}

Scaffold(
modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing.only(WindowInsetsSides.Horizontal)),
topBar = {
Expand Down Expand Up @@ -193,10 +176,11 @@ internal fun MediaPickerScreen(
}
},
) { paddingValues ->
Box(
modifier = Modifier
.padding(paddingValues)
.nestedScroll(pullToRefreshState.nestedScrollConnection),
PullToRefreshBox(
modifier = Modifier.padding(paddingValues),
state = pullToRefreshState,
isRefreshing = isRefreshing,
onRefresh = onRefreshClicked,
) {
Column(
modifier = Modifier.fillMaxSize(),
Expand Down Expand Up @@ -239,11 +223,6 @@ internal fun MediaPickerScreen(
)
}
}

PullToRefreshContainer(
state = pullToRefreshState,
modifier = Modifier.align(Alignment.TopCenter),
)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package dev.anilbeesetti.nextplayer.feature.videopicker.screens.mediaFolder

import android.net.Uri
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawing
Expand All @@ -14,14 +12,12 @@ import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.pulltorefresh.PullToRefreshContainer
import androidx.compose.material3.pulltorefresh.PullToRefreshBox
import androidx.compose.material3.pulltorefresh.rememberPullToRefreshState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.res.stringResource
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.Lifecycle
Expand Down Expand Up @@ -83,20 +79,6 @@ internal fun MediaPickerFolderScreen(
) {
val pullToRefreshState = rememberPullToRefreshState()

LaunchedEffect(pullToRefreshState.isRefreshing) {
if (pullToRefreshState.isRefreshing) {
onRefreshClicked()
}
}

LaunchedEffect(isRefreshing) {
if (isRefreshing) {
pullToRefreshState.startRefresh()
} else {
pullToRefreshState.endRefresh()
}
}

Scaffold(
modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing.only(WindowInsetsSides.Horizontal)),
topBar = {
Expand Down Expand Up @@ -129,12 +111,12 @@ internal fun MediaPickerFolderScreen(
)
}
},
) {
Box(
modifier = Modifier
.fillMaxSize()
.padding(it)
.nestedScroll(pullToRefreshState.nestedScrollConnection),
) { paddingValues ->
PullToRefreshBox(
modifier = Modifier.padding(paddingValues),
state = pullToRefreshState,
isRefreshing = isRefreshing,
onRefresh = onRefreshClicked,
contentAlignment = Alignment.Center,
) {
MediaView(
Expand All @@ -148,10 +130,6 @@ internal fun MediaPickerFolderScreen(
onVideoLoaded = onAddToSync,
onRenameVideoClick = onRenameVideoClick,
)
PullToRefreshContainer(
state = pullToRefreshState,
modifier = Modifier.align(Alignment.TopCenter),
)
}
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ androidGradlePlugin = "8.7.3"
androidMaterial = "1.12.0"
androidxActivity = "1.9.3"
androidxAppCompat = "1.7.0"
androidxComposeBom = "2024.08.00"
androidxComposeBom = "2024.11.00"
androidxConstraintLayout = "2.2.0"
androidxCore = "1.15.0"
androidxCoreSplashscreen = "1.0.1"
Expand Down

0 comments on commit e3b6d26

Please sign in to comment.