|
@@ -1,42 +1,32 @@
|
|
|
package com.zaojiao.component.personal
|
|
|
|
|
|
-import androidx.annotation.DrawableRes
|
|
|
-import androidx.compose.foundation.Image
|
|
|
+import androidx.compose.animation.AnimatedVisibility
|
|
|
+import androidx.compose.animation.fadeIn
|
|
|
+import androidx.compose.animation.fadeOut
|
|
|
import androidx.compose.foundation.background
|
|
|
-import androidx.compose.foundation.layout.Arrangement
|
|
|
import androidx.compose.foundation.layout.Box
|
|
|
-import androidx.compose.foundation.layout.Column
|
|
|
-import androidx.compose.foundation.layout.Row
|
|
|
-import androidx.compose.foundation.layout.RowScope
|
|
|
-import androidx.compose.foundation.layout.fillMaxHeight
|
|
|
import androidx.compose.foundation.layout.fillMaxSize
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
import androidx.compose.foundation.layout.height
|
|
|
-import androidx.compose.foundation.layout.padding
|
|
|
import androidx.compose.foundation.layout.statusBarsPadding
|
|
|
-import androidx.compose.foundation.layout.width
|
|
|
-import androidx.compose.foundation.layout.widthIn
|
|
|
-import androidx.compose.foundation.layout.wrapContentHeight
|
|
|
import androidx.compose.foundation.lazy.LazyColumn
|
|
|
-import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
-import androidx.compose.material3.Text
|
|
|
+import androidx.compose.foundation.lazy.rememberLazyListState
|
|
|
import androidx.compose.runtime.Composable
|
|
|
-import androidx.compose.ui.Alignment
|
|
|
+import androidx.compose.runtime.derivedStateOf
|
|
|
+import androidx.compose.runtime.getValue
|
|
|
+import androidx.compose.runtime.remember
|
|
|
import androidx.compose.ui.Modifier
|
|
|
import androidx.compose.ui.graphics.Brush
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
-import androidx.compose.ui.res.painterResource
|
|
|
-import androidx.compose.ui.text.TextStyle
|
|
|
-import androidx.compose.ui.text.font.FontWeight
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
-import androidx.compose.ui.unit.sp
|
|
|
-import com.zaojiao.component.common.shadow
|
|
|
|
|
|
+/**
|
|
|
+ * 首页 - 我的勋章
|
|
|
+ */
|
|
|
@Composable
|
|
|
fun HomePersonalPage() {
|
|
|
Box(
|
|
|
modifier = Modifier
|
|
|
- .statusBarsPadding()
|
|
|
.background(
|
|
|
brush = Brush.verticalGradient(
|
|
|
listOf(Color(0xFFFEFEFE), Color(0xFFFAFAFA)),
|
|
@@ -44,9 +34,10 @@ fun HomePersonalPage() {
|
|
|
)
|
|
|
.fillMaxSize()
|
|
|
) {
|
|
|
+ val state = rememberLazyListState()
|
|
|
|
|
|
LazyColumn(
|
|
|
-
|
|
|
+ state = state
|
|
|
) {
|
|
|
item {
|
|
|
HomePersonalTopBar()
|
|
@@ -72,26 +63,25 @@ fun HomePersonalPage() {
|
|
|
HomePersonalService()
|
|
|
}
|
|
|
|
|
|
- item{
|
|
|
-
|
|
|
+ item {
|
|
|
+ HomePersonalBottom()
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
-@Composable
|
|
|
-fun HomePersonalTopBar() {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-@Composable
|
|
|
-fun HomePersonalUserBar() {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-@Composable
|
|
|
-fun HomePersonalEngage() {
|
|
|
+ val showTop by remember {
|
|
|
+ derivedStateOf {
|
|
|
+ state.firstVisibleItemIndex > 1
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ AnimatedVisibility(
|
|
|
+ visible = showTop,
|
|
|
+ enter = fadeIn(),
|
|
|
+ exit = fadeOut(),
|
|
|
+ ) {
|
|
|
+ HomePersonalScrollTopBar()
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|