pref: Pad 加载动画宽度
This commit is contained in:
parent
7701fceff0
commit
735ded6a5b
|
|
@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.ColumnScope
|
||||||
import androidx.compose.foundation.layout.aspectRatio
|
import androidx.compose.foundation.layout.aspectRatio
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.requiredWidthIn
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material.MaterialTheme
|
||||||
|
|
@ -59,7 +60,9 @@ fun TipScreen(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
verticalArrangement = Arrangement.spacedBy(8.dp, alignment = Alignment.CenterVertically)
|
verticalArrangement = Arrangement.spacedBy(8.dp, alignment = Alignment.CenterVertically)
|
||||||
) {
|
) {
|
||||||
|
Column(modifier = Modifier.requiredWidthIn(max = 400.dp)) {
|
||||||
image()
|
image()
|
||||||
|
}
|
||||||
ProvideTextStyle(
|
ProvideTextStyle(
|
||||||
value = MaterialTheme.typography.h6.copy(
|
value = MaterialTheme.typography.h6.copy(
|
||||||
color = ExtendedTheme.colors.text,
|
color = ExtendedTheme.colors.text,
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.aspectRatio
|
import androidx.compose.foundation.layout.aspectRatio
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.requiredWidthIn
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material.MaterialTheme
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
|
@ -13,6 +14,7 @@ import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
import com.airbnb.lottie.compose.LottieAnimation
|
import com.airbnb.lottie.compose.LottieAnimation
|
||||||
import com.airbnb.lottie.compose.LottieCompositionSpec
|
import com.airbnb.lottie.compose.LottieCompositionSpec
|
||||||
import com.airbnb.lottie.compose.LottieConstants
|
import com.airbnb.lottie.compose.LottieConstants
|
||||||
|
|
@ -24,6 +26,7 @@ import com.huanchengfly.tieba.post.ui.widgets.compose.TipScreen
|
||||||
|
|
||||||
val DefaultLoadingScreen: @Composable StateScreenScope.() -> Unit = {
|
val DefaultLoadingScreen: @Composable StateScreenScope.() -> Unit = {
|
||||||
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.lottie_loading_paperplane))
|
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.lottie_loading_paperplane))
|
||||||
|
Box(modifier = Modifier.requiredWidthIn(max = 500.dp)) {
|
||||||
LottieAnimation(
|
LottieAnimation(
|
||||||
composition = composition,
|
composition = composition,
|
||||||
iterations = LottieConstants.IterateForever,
|
iterations = LottieConstants.IterateForever,
|
||||||
|
|
@ -31,6 +34,7 @@ val DefaultLoadingScreen: @Composable StateScreenScope.() -> Unit = {
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.aspectRatio(2f)
|
.aspectRatio(2f)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
// CircularProgressIndicator(modifier = Modifier.size(48.dp), color = MaterialTheme.colors.primary)
|
// CircularProgressIndicator(modifier = Modifier.size(48.dp), color = MaterialTheme.colors.primary)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue