fix: API 变动导致编译失败
This commit is contained in:
parent
bb9c9ef974
commit
c112cf79eb
|
|
@ -1,6 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
id 'com.didiglobal.booster'
|
|
||||||
id 'kotlin-android'
|
id 'kotlin-android'
|
||||||
id 'kotlin-kapt'
|
id 'kotlin-kapt'
|
||||||
id 'kotlinx-serialization'
|
id 'kotlinx-serialization'
|
||||||
|
|
@ -8,6 +7,7 @@ plugins {
|
||||||
id 'com.squareup.wire'
|
id 'com.squareup.wire'
|
||||||
id 'com.google.devtools.ksp' version "$kotlin_version-1.0.13"
|
id 'com.google.devtools.ksp' version "$kotlin_version-1.0.13"
|
||||||
id "org.jetbrains.kotlin.plugin.parcelize"
|
id "org.jetbrains.kotlin.plugin.parcelize"
|
||||||
|
// id 'com.didiglobal.booster'
|
||||||
}
|
}
|
||||||
|
|
||||||
def keystoreProperties = new Properties()
|
def keystoreProperties = new Properties()
|
||||||
|
|
@ -28,8 +28,8 @@ if (!isSelfBuild) {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
buildToolsVersion = '34.0.0'
|
||||||
compileSdk 34
|
compileSdk 34
|
||||||
buildToolsVersion '33.0.0'
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.huanchengfly.tieba.post"
|
applicationId "com.huanchengfly.tieba.post"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
|
|
@ -49,9 +49,6 @@ android {
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
compose true
|
compose true
|
||||||
}
|
}
|
||||||
composeOptions {
|
|
||||||
kotlinCompilerExtensionVersion compose_compiler_version
|
|
||||||
}
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
keyAlias keystoreProperties["releaseKeyAlias"]
|
keyAlias keystoreProperties["releaseKeyAlias"]
|
||||||
|
|
@ -79,12 +76,15 @@ android {
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
composeOptions {
|
||||||
|
kotlinCompilerExtensionVersion compose_compiler_version
|
||||||
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = '1.8'
|
jvmTarget = '11'
|
||||||
// freeCompilerArgs += ["-P", "plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"]
|
// freeCompilerArgs += ["-P", "plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"]
|
||||||
freeCompilerArgs += ["-P", "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + project.buildDir.absolutePath + "/compose_metrics"]
|
freeCompilerArgs += ["-P", "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + project.buildDir.absolutePath + "/compose_metrics"]
|
||||||
freeCompilerArgs += ["-P", "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + project.buildDir.absolutePath + "/compose_metrics"]
|
freeCompilerArgs += ["-P", "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + project.buildDir.absolutePath + "/compose_metrics"]
|
||||||
|
|
@ -167,7 +167,7 @@ dependencies {
|
||||||
implementation composeBom
|
implementation composeBom
|
||||||
androidTestImplementation composeBom
|
androidTestImplementation composeBom
|
||||||
|
|
||||||
implementation 'androidx.compose.runtime:runtime-tracing:1.0.0-alpha04'
|
implementation 'androidx.compose.runtime:runtime-tracing:1.0.0-alpha03'
|
||||||
implementation 'androidx.compose.material:material'
|
implementation 'androidx.compose.material:material'
|
||||||
implementation 'androidx.compose.material:material-icons-core'
|
implementation 'androidx.compose.material:material-icons-core'
|
||||||
// Optional - Add full set of material icons
|
// Optional - Add full set of material icons
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import androidx.compose.animation.AnimatedContentScope
|
import androidx.compose.animation.AnimatedContentTransitionScope
|
||||||
import androidx.compose.animation.ExperimentalAnimationApi
|
import androidx.compose.animation.ExperimentalAnimationApi
|
||||||
import androidx.compose.animation.core.AnimationSpec
|
import androidx.compose.animation.core.AnimationSpec
|
||||||
import androidx.compose.animation.core.Spring
|
import androidx.compose.animation.core.Spring
|
||||||
|
|
@ -50,12 +50,12 @@ import androidx.datastore.preferences.core.stringPreferencesKey
|
||||||
import androidx.lifecycle.flowWithLifecycle
|
import androidx.lifecycle.flowWithLifecycle
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
|
import androidx.navigation.compose.rememberNavController
|
||||||
import androidx.navigation.plusAssign
|
import androidx.navigation.plusAssign
|
||||||
import androidx.window.layout.FoldingFeature
|
import androidx.window.layout.FoldingFeature
|
||||||
import androidx.window.layout.WindowInfoTracker
|
import androidx.window.layout.WindowInfoTracker
|
||||||
import com.github.panpf.sketch.compose.AsyncImage
|
import com.github.panpf.sketch.compose.AsyncImage
|
||||||
import com.github.panpf.sketch.fetch.newFileUri
|
import com.github.panpf.sketch.fetch.newFileUri
|
||||||
import com.google.accompanist.navigation.animation.rememberAnimatedNavController
|
|
||||||
import com.google.accompanist.navigation.material.BottomSheetNavigator
|
import com.google.accompanist.navigation.material.BottomSheetNavigator
|
||||||
import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi
|
import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi
|
||||||
import com.google.accompanist.navigation.material.ModalBottomSheetLayout
|
import com.google.accompanist.navigation.material.ModalBottomSheetLayout
|
||||||
|
|
@ -297,35 +297,35 @@ class MainActivityV2 : BaseComposeActivity() {
|
||||||
rootDefaultAnimations = RootNavGraphDefaultAnimations(
|
rootDefaultAnimations = RootNavGraphDefaultAnimations(
|
||||||
enterTransition = {
|
enterTransition = {
|
||||||
slideIntoContainer(
|
slideIntoContainer(
|
||||||
AnimatedContentScope.SlideDirection.Start,
|
AnimatedContentTransitionScope.SlideDirection.Start,
|
||||||
animationSpec = animationSpec,
|
animationSpec = animationSpec,
|
||||||
initialOffset = { it }
|
initialOffset = { it }
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
exitTransition = {
|
exitTransition = {
|
||||||
slideOutOfContainer(
|
slideOutOfContainer(
|
||||||
AnimatedContentScope.SlideDirection.End,
|
AnimatedContentTransitionScope.SlideDirection.End,
|
||||||
animationSpec = animationSpec,
|
animationSpec = animationSpec,
|
||||||
targetOffset = { -it }
|
targetOffset = { -it }
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
popEnterTransition = {
|
popEnterTransition = {
|
||||||
slideIntoContainer(
|
slideIntoContainer(
|
||||||
AnimatedContentScope.SlideDirection.Start,
|
AnimatedContentTransitionScope.SlideDirection.Start,
|
||||||
animationSpec = animationSpec,
|
animationSpec = animationSpec,
|
||||||
initialOffset = { -it }
|
initialOffset = { -it }
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
popExitTransition = {
|
popExitTransition = {
|
||||||
slideOutOfContainer(
|
slideOutOfContainer(
|
||||||
AnimatedContentScope.SlideDirection.End,
|
AnimatedContentTransitionScope.SlideDirection.End,
|
||||||
animationSpec = animationSpec,
|
animationSpec = animationSpec,
|
||||||
targetOffset = { it }
|
targetOffset = { it }
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
val navController = rememberAnimatedNavController()
|
val navController = rememberNavController()
|
||||||
val bottomSheetNavigator =
|
val bottomSheetNavigator =
|
||||||
rememberBottomSheetNavigator(
|
rememberBottomSheetNavigator(
|
||||||
animationSpec = spring(stiffness = Spring.StiffnessMediumLow),
|
animationSpec = spring(stiffness = Spring.StiffnessMediumLow),
|
||||||
|
|
|
||||||
|
|
@ -435,7 +435,7 @@ fun ForumPage(
|
||||||
val tbs by viewModel.uiState.collectPartialAsState(prop1 = ForumUiState::tbs, initial = null)
|
val tbs by viewModel.uiState.collectPartialAsState(prop1 = ForumUiState::tbs, initial = null)
|
||||||
|
|
||||||
val account = LocalAccount.current
|
val account = LocalAccount.current
|
||||||
val pagerState = rememberPagerState()
|
val pagerState = rememberPagerState { 2 }
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
val lazyListStates = persistentListOf(rememberLazyListState(), rememberLazyListState())
|
val lazyListStates = persistentListOf(rememberLazyListState(), rememberLazyListState())
|
||||||
|
|
||||||
|
|
@ -830,7 +830,6 @@ fun ForumPage(
|
||||||
|
|
||||||
if (forumInfo != null) {
|
if (forumInfo != null) {
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
pageCount = 2,
|
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
verticalAlignment = Alignment.Top,
|
verticalAlignment = Alignment.Top,
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ import kotlinx.coroutines.launch
|
||||||
fun HistoryPage(
|
fun HistoryPage(
|
||||||
navigator: DestinationsNavigator
|
navigator: DestinationsNavigator
|
||||||
) {
|
) {
|
||||||
val pagerState = rememberPagerState()
|
val pagerState = rememberPagerState { 2 }
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
val scaffoldState = rememberScaffoldState()
|
val scaffoldState = rememberScaffoldState()
|
||||||
|
|
||||||
|
|
@ -138,7 +138,6 @@ fun HistoryPage(
|
||||||
) {
|
) {
|
||||||
ProvideNavigator(navigator = navigator) {
|
ProvideNavigator(navigator = navigator) {
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
pageCount = 2,
|
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
verticalAlignment = Alignment.Top,
|
verticalAlignment = Alignment.Top,
|
||||||
|
|
|
||||||
|
|
@ -122,17 +122,22 @@ fun MainPage(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val pagerState = rememberPagerState()
|
|
||||||
val hideExplore by rememberPreferenceAsState(
|
val hideExplore by rememberPreferenceAsState(
|
||||||
key = booleanPreferencesKey("hideExplore"),
|
key = booleanPreferencesKey("hideExplore"),
|
||||||
defaultValue = LocalContext.current.appPreferences.hideExplore
|
defaultValue = LocalContext.current.appPreferences.hideExplore
|
||||||
)
|
)
|
||||||
|
val pageCount by remember {
|
||||||
|
derivedStateOf {
|
||||||
|
if (hideExplore) 3 else 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val pagerState = rememberPagerState { pageCount }
|
||||||
LaunchedEffect(hideExplore) {
|
LaunchedEffect(hideExplore) {
|
||||||
if (pagerState.currentPage == 3 && hideExplore) {
|
if (pagerState.currentPage == 3 && hideExplore) {
|
||||||
pagerState.scrollToPage(2)
|
pagerState.scrollToPage(2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
val themeColors = ExtendedTheme.colors
|
val themeColors = ExtendedTheme.colors
|
||||||
val navigationItems by remember {
|
val navigationItems by remember {
|
||||||
|
|
@ -188,8 +193,6 @@ fun MainPage(
|
||||||
).toImmutableList()
|
).toImmutableList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val pageCount by remember { derivedStateOf { navigationItems.size } }
|
|
||||||
|
|
||||||
val navigationType by remember {
|
val navigationType by remember {
|
||||||
derivedStateOf {
|
derivedStateOf {
|
||||||
when (windowWidthSizeClass) {
|
when (windowWidthSizeClass) {
|
||||||
|
|
@ -270,7 +273,6 @@ fun MainPage(
|
||||||
) { paddingValues ->
|
) { paddingValues ->
|
||||||
LazyLoadHorizontalPager(
|
LazyLoadHorizontalPager(
|
||||||
contentPadding = paddingValues,
|
contentPadding = paddingValues,
|
||||||
pageCount = pageCount,
|
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
key = { navigationItems[it].id },
|
key = { navigationItems[it].id },
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ fun ExplorePage() {
|
||||||
),
|
),
|
||||||
).toImmutableList()
|
).toImmutableList()
|
||||||
}
|
}
|
||||||
val pagerState = rememberPagerState(initialPage = if (account != null) 1 else 0)
|
val pagerState = rememberPagerState(initialPage = if (account != null) 1 else 0) { pages.size }
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
onGlobalEvent<GlobalEvent.Refresh>(
|
onGlobalEvent<GlobalEvent.Refresh>(
|
||||||
|
|
@ -167,7 +167,6 @@ fun ExplorePage() {
|
||||||
) { paddingValues ->
|
) { paddingValues ->
|
||||||
LazyLoadHorizontalPager(
|
LazyLoadHorizontalPager(
|
||||||
contentPadding = paddingValues,
|
contentPadding = paddingValues,
|
||||||
pageCount = pages.size,
|
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
key = { pages[it].id },
|
key = { pages[it].id },
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ fun NotificationsPage() {
|
||||||
NotificationsListPage(type = NotificationsType.AtMe)
|
NotificationsListPage(type = NotificationsType.AtMe)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
val pagerState = rememberPagerState()
|
val pagerState = rememberPagerState { pages.size }
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
Scaffold(
|
Scaffold(
|
||||||
backgroundColor = Color.Transparent,
|
backgroundColor = Color.Transparent,
|
||||||
|
|
@ -87,9 +87,8 @@ fun NotificationsPage() {
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
) { paddingValues ->
|
) { paddingValues ->
|
||||||
LazyLoadHorizontalPager(
|
LazyLoadHorizontalPager(
|
||||||
contentPadding = paddingValues,
|
|
||||||
pageCount = pages.size,
|
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
|
contentPadding = paddingValues,
|
||||||
key = { pages[it].first },
|
key = { pages[it].first },
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
verticalAlignment = Alignment.Top,
|
verticalAlignment = Alignment.Top,
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ class PhotoViewActivity : BaseComposeActivityWithParcelable<PhotoViewData>() {
|
||||||
Surface(color = Color.Black) {
|
Surface(color = Color.Black) {
|
||||||
if (items.isNotEmpty()) {
|
if (items.isNotEmpty()) {
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
val pagerState = rememberPagerState(initialPage = initialIndex)
|
val pagerState = rememberPagerState(initialPage = initialIndex) { pageCount }
|
||||||
LaunchedEffect(initialIndex) {
|
LaunchedEffect(initialIndex) {
|
||||||
if (pagerState.currentPage != initialIndex) pagerState.scrollToPage(initialIndex)
|
if (pagerState.currentPage != initialIndex) pagerState.scrollToPage(initialIndex)
|
||||||
}
|
}
|
||||||
|
|
@ -204,7 +204,6 @@ class PhotoViewActivity : BaseComposeActivityWithParcelable<PhotoViewData>() {
|
||||||
}
|
}
|
||||||
Box(modifier = Modifier.fillMaxSize()) {
|
Box(modifier = Modifier.fillMaxSize()) {
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
pageCount = pageCount,
|
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
key = {
|
key = {
|
||||||
"${items[it].overallIndex}"
|
"${items[it].overallIndex}"
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@ import androidx.compose.ui.platform.LocalDensity
|
||||||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.AnnotatedString
|
import androidx.compose.ui.text.AnnotatedString
|
||||||
import androidx.compose.ui.text.ExperimentalTextApi
|
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.rememberTextMeasurer
|
import androidx.compose.ui.text.rememberTextMeasurer
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
@ -111,7 +110,7 @@ import com.huanchengfly.tieba.post.utils.StringUtil
|
||||||
import com.huanchengfly.tieba.post.utils.appPreferences
|
import com.huanchengfly.tieba.post.utils.appPreferences
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
import com.ramcosta.composedestinations.spec.DestinationStyle
|
import com.ramcosta.composedestinations.spec.DestinationStyleBottomSheet
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
import kotlinx.coroutines.FlowPreview
|
import kotlinx.coroutines.FlowPreview
|
||||||
|
|
@ -128,10 +127,10 @@ import kotlin.concurrent.thread
|
||||||
|
|
||||||
// TODO: 将软键盘状态相关逻辑抽离出来
|
// TODO: 将软键盘状态相关逻辑抽离出来
|
||||||
@OptIn(
|
@OptIn(
|
||||||
ExperimentalTextApi::class, ExperimentalLayoutApi::class, ExperimentalComposeUiApi::class,
|
ExperimentalLayoutApi::class, ExperimentalComposeUiApi::class,
|
||||||
FlowPreview::class
|
FlowPreview::class
|
||||||
)
|
)
|
||||||
@Destination(style = DestinationStyle.BottomSheet::class)
|
@Destination(style = DestinationStyleBottomSheet::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun ReplyPage(
|
fun ReplyPage(
|
||||||
navigator: DestinationsNavigator,
|
navigator: DestinationsNavigator,
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ fun BlockListPage(
|
||||||
}
|
}
|
||||||
|
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val pagerState = rememberPagerState()
|
val pagerState = rememberPagerState { 2 }
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
val blackList by viewModel.uiState.collectPartialAsState(
|
val blackList by viewModel.uiState.collectPartialAsState(
|
||||||
prop1 = BlockListUiState::blackList,
|
prop1 = BlockListUiState::blackList,
|
||||||
|
|
@ -217,7 +217,6 @@ fun BlockListPage(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
pageCount = 2,
|
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
contentPadding = paddingValues,
|
contentPadding = paddingValues,
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ import com.huanchengfly.tieba.post.utils.StringUtil
|
||||||
import com.huanchengfly.tieba.post.utils.TiebaUtil
|
import com.huanchengfly.tieba.post.utils.TiebaUtil
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
import com.ramcosta.composedestinations.spec.DestinationStyle
|
import com.ramcosta.composedestinations.spec.DestinationStyleBottomSheet
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
|
|
@ -105,7 +105,7 @@ fun SubPostsPage(
|
||||||
}
|
}
|
||||||
|
|
||||||
@Destination(
|
@Destination(
|
||||||
style = DestinationStyle.BottomSheet::class
|
style = DestinationStyleBottomSheet::class
|
||||||
)
|
)
|
||||||
@Composable
|
@Composable
|
||||||
fun SubPostsSheetPage(
|
fun SubPostsSheetPage(
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import androidx.compose.foundation.pager.HorizontalPager
|
||||||
import androidx.compose.foundation.pager.PageSize
|
import androidx.compose.foundation.pager.PageSize
|
||||||
import androidx.compose.foundation.pager.PagerDefaults
|
import androidx.compose.foundation.pager.PagerDefaults
|
||||||
import androidx.compose.foundation.pager.PagerState
|
import androidx.compose.foundation.pager.PagerState
|
||||||
import androidx.compose.foundation.pager.rememberPagerState
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.CompositionLocalProvider
|
import androidx.compose.runtime.CompositionLocalProvider
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
|
@ -54,9 +53,8 @@ fun ProvideShouldLoad(
|
||||||
@OptIn(ExperimentalFoundationApi::class)
|
@OptIn(ExperimentalFoundationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun LazyLoadHorizontalPager(
|
fun LazyLoadHorizontalPager(
|
||||||
pageCount: Int,
|
state: PagerState,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
state: PagerState = rememberPagerState(),
|
|
||||||
contentPadding: PaddingValues = PaddingValues(0.dp),
|
contentPadding: PaddingValues = PaddingValues(0.dp),
|
||||||
pageSize: PageSize = PageSize.Fill,
|
pageSize: PageSize = PageSize.Fill,
|
||||||
beyondBoundsPageCount: Int = 0,
|
beyondBoundsPageCount: Int = 0,
|
||||||
|
|
@ -69,10 +67,9 @@ fun LazyLoadHorizontalPager(
|
||||||
pageNestedScrollConnection: NestedScrollConnection = PagerDefaults.pageNestedScrollConnection(
|
pageNestedScrollConnection: NestedScrollConnection = PagerDefaults.pageNestedScrollConnection(
|
||||||
Orientation.Horizontal
|
Orientation.Horizontal
|
||||||
),
|
),
|
||||||
pageContent: @Composable (page: Int) -> Unit
|
pageContent: @Composable (page: Int) -> Unit,
|
||||||
) {
|
) {
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
pageCount = pageCount,
|
|
||||||
state = state,
|
state = state,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
contentPadding = contentPadding,
|
contentPadding = contentPadding,
|
||||||
|
|
|
||||||
26
build.gradle
26
build.gradle
|
|
@ -12,7 +12,7 @@ buildscript {
|
||||||
compose_bom_version = '2023.09.01'
|
compose_bom_version = '2023.09.01'
|
||||||
wire_version = '4.7.2'
|
wire_version = '4.7.2'
|
||||||
hilt_version = '2.46.1'
|
hilt_version = '2.46.1'
|
||||||
booster_version = '4.15.0'
|
booster_version = '4.16.2'
|
||||||
lottie_version = '6.1.0'
|
lottie_version = '6.1.0'
|
||||||
debug = gradle.startParameter.taskNames.any {
|
debug = gradle.startParameter.taskNames.any {
|
||||||
it.contains('debug') || it.contains('Debug')
|
it.contains('debug') || it.contains('Debug')
|
||||||
|
|
@ -24,22 +24,22 @@ buildscript {
|
||||||
maven { url "https://maven.aliyun.com/repository/public" }
|
maven { url "https://maven.aliyun.com/repository/public" }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.4.2'
|
classpath 'com.android.tools.build:gradle:8.1.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
||||||
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
|
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
|
||||||
classpath "com.squareup.wire:wire-gradle-plugin:$wire_version"
|
classpath "com.squareup.wire:wire-gradle-plugin:$wire_version"
|
||||||
classpath "com.didiglobal.booster:booster-gradle-plugin:$booster_version"
|
// classpath "com.didiglobal.booster:booster-gradle-plugin:$booster_version"
|
||||||
classpath "com.didiglobal.booster:booster-transform-webview:$booster_version"
|
// classpath "com.didiglobal.booster:booster-transform-webview:$booster_version"
|
||||||
classpath "com.didiglobal.booster:booster-transform-shared-preferences:$booster_version"
|
// classpath "com.didiglobal.booster:booster-transform-shared-preferences:$booster_version"
|
||||||
if (!debug) {
|
// if (!debug) {
|
||||||
classpath "com.didiglobal.booster:booster-transform-activity-thread:$booster_version"
|
// classpath "com.didiglobal.booster:booster-transform-activity-thread:$booster_version"
|
||||||
// classpath "com.didiglobal.booster:booster-transform-finalizer-watchdog-daemon:$booster_version"
|
//// classpath "com.didiglobal.booster:booster-transform-finalizer-watchdog-daemon:$booster_version"
|
||||||
// classpath "com.didiglobal.booster:booster-transform-res-check:$booster_version"
|
//// classpath "com.didiglobal.booster:booster-transform-res-check:$booster_version"
|
||||||
// classpath "com.didiglobal.booster:booster-transform-toast:$booster_version"
|
//// classpath "com.didiglobal.booster:booster-transform-toast:$booster_version"
|
||||||
classpath "com.didiglobal.booster:booster-task-compression-processed-res:$booster_version"
|
// classpath "com.didiglobal.booster:booster-task-compression-processed-res:$booster_version"
|
||||||
classpath "com.didiglobal.booster:booster-transform-r-inline:$booster_version"
|
// classpath "com.didiglobal.booster:booster-transform-r-inline:$booster_version"
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,3 +11,6 @@ org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
# org.gradle.unsafe.configuration-cache=true
|
# org.gradle.unsafe.configuration-cache=true
|
||||||
booster.transform.r.inline.ignores=android/*,androidx/*,com/huanchengfly/tieba/post/R$color
|
booster.transform.r.inline.ignores=android/*,androidx/*,com/huanchengfly/tieba/post/R$color
|
||||||
|
android.defaults.buildfeatures.buildconfig=true
|
||||||
|
android.nonTransitiveRClass=false
|
||||||
|
android.nonFinalResIds=false
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue