pref: 优化 UI
This commit is contained in:
parent
b487b1686c
commit
53df4568f3
|
|
@ -254,7 +254,7 @@ fun ForumThreadListPage(
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth(fraction)
|
modifier = Modifier.fillMaxWidth(fraction)
|
||||||
) {
|
) {
|
||||||
if (index > 0 && threadList[index - 1].isTop != item.isTop) {
|
if (index > 0) {
|
||||||
Divider(
|
Divider(
|
||||||
color = ExtendedTheme.colors.divider,
|
color = ExtendedTheme.colors.divider,
|
||||||
modifier = Modifier.padding(horizontal = 16.dp),
|
modifier = Modifier.padding(horizontal = 16.dp),
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package com.huanchengfly.tieba.post.ui.page.main.notifications.list
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
|
|
@ -89,8 +88,7 @@ fun NotificationsListPage(
|
||||||
onLoadMore = { viewModel.send(NotificationsListUiIntent.LoadMore(currentPage + 1)) },
|
onLoadMore = { viewModel.send(NotificationsListUiIntent.LoadMore(currentPage + 1)) },
|
||||||
) {
|
) {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
contentPadding = PaddingValues(vertical = 16.dp),
|
contentPadding = PaddingValues(vertical = 4.dp)
|
||||||
verticalArrangement = Arrangement.spacedBy(24.dp),
|
|
||||||
) {
|
) {
|
||||||
items(
|
items(
|
||||||
items = data,
|
items = data,
|
||||||
|
|
@ -109,7 +107,7 @@ fun NotificationsListPage(
|
||||||
ThreadActivity.launch(context, it.threadId!!, it.postId)
|
ThreadActivity.launch(context, it.threadId!!, it.postId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp, vertical = 12.dp)
|
||||||
) {
|
) {
|
||||||
if (it.replyer != null) {
|
if (it.replyer != null) {
|
||||||
UserHeader(
|
UserHeader(
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.*
|
import androidx.compose.material.*
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
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.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
|
|
@ -36,9 +35,7 @@ fun LoadMoreLayout(
|
||||||
) {
|
) {
|
||||||
val loadDistance = with(LocalDensity.current) { LoadDistance.toPx() }
|
val loadDistance = with(LocalDensity.current) { LoadDistance.toPx() }
|
||||||
|
|
||||||
val canLoadMore = remember(key1 = enableLoadMore, key2 = loadEnd) {
|
val canLoadMore = (enableLoadMore && !loadEnd)
|
||||||
enableLoadMore || !loadEnd
|
|
||||||
}
|
|
||||||
|
|
||||||
val swipeableState = if (canLoadMore) {
|
val swipeableState = if (canLoadMore) {
|
||||||
rememberSwipeableState(isLoading) { newValue ->
|
rememberSwipeableState(isLoading) { newValue ->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue