mirror of
https://github.com/BetterAndroid/FlexiUI.git
synced 2025-09-07 11:09:53 +08:00
refactor: merge to compose new version usage
This commit is contained in:
@@ -60,8 +60,11 @@ data class RippleStyle(
|
||||
* @param style the style, default is [InteractionDefaults.rippleStyle].
|
||||
* @return [Indication]
|
||||
*/
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
@Composable
|
||||
fun rememberRipple(style: RippleStyle = InteractionDefaults.rippleStyle()) =
|
||||
// FIXME: Compose deprecated the rememberRipple function,
|
||||
// it's no effect without Android platform now, need to migrate to the new API.
|
||||
materialRememberRipple(style.bounded, style.radius, style.color)
|
||||
|
||||
/**
|
||||
|
@@ -19,11 +19,8 @@
|
||||
*
|
||||
* This file is created by fankes on 2024/1/12.
|
||||
*/
|
||||
@file:OptIn(ExperimentalFoundationApi::class)
|
||||
|
||||
package com.highcapable.flexiui.demo.screen
|
||||
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
@@ -150,7 +147,7 @@ fun LazyListScreen() {
|
||||
HorizontalPager(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
state = pagerState,
|
||||
beyondBoundsPageCount = pageCount
|
||||
beyondViewportPageCount = pageCount
|
||||
) { index ->
|
||||
@Composable
|
||||
fun LazyItem(modifier: Modifier, index: Int) {
|
||||
@@ -189,7 +186,7 @@ fun LazyListScreen() {
|
||||
key = { testListData[it].index }
|
||||
) { index ->
|
||||
LazyItem(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
modifier = Modifier.animateItem(),
|
||||
index = index
|
||||
)
|
||||
}
|
||||
@@ -208,7 +205,7 @@ fun LazyListScreen() {
|
||||
key = { testListData[it].index }
|
||||
) { index ->
|
||||
LazyItem(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
modifier = Modifier.animateItem(),
|
||||
index = index
|
||||
)
|
||||
}
|
||||
|
@@ -19,12 +19,9 @@
|
||||
*
|
||||
* This file is created by fankes on 2024/1/12.
|
||||
*/
|
||||
@file:OptIn(ExperimentalFoundationApi::class)
|
||||
|
||||
package com.highcapable.flexiui.demo.screen
|
||||
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
@@ -159,7 +156,7 @@ fun MainScreen() {
|
||||
HorizontalPager(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
state = pagerState,
|
||||
beyondBoundsPageCount = pageCount
|
||||
beyondViewportPageCount = pageCount
|
||||
) { index ->
|
||||
val modifier = Modifier.padding(innerPadding)
|
||||
when (index) {
|
||||
|
Reference in New Issue
Block a user