fix empty group not round bottom corner issue (#529)
This commit is contained in:
parent
27f700dbba
commit
799a44cdd3
@ -18,6 +18,9 @@ data class Group(
|
|||||||
var accountId: Int,
|
var accountId: Int,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* see [me.ash.reader.domain.model.feed.ImportantNum.important]
|
||||||
|
*/
|
||||||
@Ignore
|
@Ignore
|
||||||
var important: Int? = 0
|
var important: Int? = 0
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package me.ash.reader.ui.page.home.feeds
|
package me.ash.reader.ui.page.home.feeds
|
||||||
|
|
||||||
import android.util.Log
|
|
||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.compose.animation.core.*
|
import androidx.compose.animation.core.*
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
@ -229,7 +228,7 @@ fun FeedsPage(
|
|||||||
group = groupWithFeed.group,
|
group = groupWithFeed.group,
|
||||||
alpha = groupAlpha,
|
alpha = groupAlpha,
|
||||||
indicatorAlpha = groupIndicatorAlpha,
|
indicatorAlpha = groupIndicatorAlpha,
|
||||||
isEnded = { index == groupWithFeedList.lastIndex },
|
roundedBottomCorner = { index == groupWithFeedList.lastIndex || groupWithFeed.group.important == 0 },
|
||||||
onExpanded = {
|
onExpanded = {
|
||||||
groupsVisible[groupWithFeed.group.id] = groupsVisible.getOrPut(
|
groupsVisible[groupWithFeed.group.id] = groupsVisible.getOrPut(
|
||||||
groupWithFeed.group.id,
|
groupWithFeed.group.id,
|
||||||
|
@ -35,7 +35,7 @@ fun GroupItem(
|
|||||||
group: Group,
|
group: Group,
|
||||||
alpha: Float = 1f,
|
alpha: Float = 1f,
|
||||||
indicatorAlpha: Float = 1f,
|
indicatorAlpha: Float = 1f,
|
||||||
isEnded: () -> Boolean,
|
roundedBottomCorner: () -> Boolean,
|
||||||
isExpanded: () -> Boolean,
|
isExpanded: () -> Boolean,
|
||||||
groupOptionViewModel: GroupOptionViewModel = hiltViewModel(),
|
groupOptionViewModel: GroupOptionViewModel = hiltViewModel(),
|
||||||
onExpanded: () -> Unit = {},
|
onExpanded: () -> Unit = {},
|
||||||
@ -49,7 +49,7 @@ fun GroupItem(
|
|||||||
.animateContentSize()
|
.animateContentSize()
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp)
|
||||||
.clip(if (isExpanded() && !isEnded()) ShapeTop32 else Shape32)
|
.clip(if (isExpanded() && !roundedBottomCorner()) ShapeTop32 else Shape32)
|
||||||
.background(MaterialTheme.colorScheme.secondary.copy(alpha = alpha))
|
.background(MaterialTheme.colorScheme.secondary.copy(alpha = alpha))
|
||||||
.combinedClickable(
|
.combinedClickable(
|
||||||
onClick = {
|
onClick = {
|
||||||
|
@ -94,7 +94,7 @@ fun FeedsPagePreview(
|
|||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(12.dp))
|
Spacer(modifier = Modifier.height(12.dp))
|
||||||
GroupItem(
|
GroupItem(
|
||||||
isEnded = { false },
|
roundedBottomCorner = { false },
|
||||||
isExpanded = { groupListExpand.value },
|
isExpanded = { groupListExpand.value },
|
||||||
group = generateGroupPreview(),
|
group = generateGroupPreview(),
|
||||||
alpha = groupAlpha,
|
alpha = groupAlpha,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user