Review fixes: indeterminate still pull indicator, Dp corner springs, add-subtask row on the nested token (#118, #157)
This commit is contained in:
1 parent
d856786161
commit
89fa58ddff
4 files changed
+18
-10
No files matched your search
@@ -16,6 +16,9 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import de.jeanlucmakiola.floret.identity.rememberLoopingMotion
|
||||
import androidx.compose.ui.semantics.ProgressBarRangeInfo
|
||||
import androidx.compose.ui.semantics.clearAndSetSemantics
|
||||
import androidx.compose.ui.semantics.progressBarRangeInfo
|
||||
|
||||
/**
|
||||
* Pull down to sync every account (#73). Without an account there is nothing
|
||||
@@ -58,7 +61,9 @@ fun SyncPullBox(
|
||||
) {
|
||||
CircularProgressIndicator(
|
||||
progress = { if (syncing) 1f else state.distanceFraction.coerceIn(0f, 1f) },
|
||||
modifier = Modifier.size(24.dp),
|
||||
modifier = Modifier
|
||||
.size(24.dp)
|
||||
.clearAndSetSemantics { progressBarRangeInfo = ProgressBarRangeInfo.Indeterminate },
|
||||
strokeWidth = 2.5.dp,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import androidx.compose.material.icons.rounded.SwapVert
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.core.animateDpAsState
|
||||
import androidx.compose.animation.core.VisibilityThreshold
|
||||
import androidx.compose.animation.core.spring
|
||||
import androidx.compose.animation.core.tween
|
||||
import androidx.compose.animation.expandHorizontally
|
||||
@@ -79,6 +80,7 @@ import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.input.KeyboardCapitalization
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
@@ -654,7 +656,7 @@ private fun SearchResults(
|
||||
private fun TodayHero(done: Int, total: Int, onClick: () -> Unit) {
|
||||
val interaction = remember { MutableInteractionSource() }
|
||||
val pressed by interaction.collectIsPressedAsState()
|
||||
val corner by animateDpAsState(if (pressed) 34.dp else 22.dp, reducibleSpec(spring()), label = "todayCorner")
|
||||
val corner by animateDpAsState(if (pressed) 34.dp else 22.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "todayCorner")
|
||||
val left = total - done
|
||||
Surface(
|
||||
onClick = onClick,
|
||||
@@ -852,7 +854,7 @@ private fun SmartCard(count: SmartCount, modifier: Modifier = Modifier, onClick:
|
||||
val style = smartStyle(count.smart)
|
||||
val interaction = remember { MutableInteractionSource() }
|
||||
val pressed by interaction.collectIsPressedAsState()
|
||||
val corner by animateDpAsState(if (pressed) 34.dp else 22.dp, reducibleSpec(spring()), label = "smartCorner")
|
||||
val corner by animateDpAsState(if (pressed) 34.dp else 22.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "smartCorner")
|
||||
Surface(
|
||||
onClick = onClick,
|
||||
shape = RoundedCornerShape(corner),
|
||||
|
||||
@@ -4,6 +4,7 @@ import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.core.animateDpAsState
|
||||
import androidx.compose.animation.core.animateFloatAsState
|
||||
import androidx.compose.animation.core.VisibilityThreshold
|
||||
import androidx.compose.animation.core.spring
|
||||
import androidx.compose.animation.fadeIn
|
||||
import androidx.compose.animation.fadeOut
|
||||
@@ -107,6 +108,7 @@ import androidx.compose.ui.text.input.ImeAction
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextDecoration
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
@@ -137,7 +139,6 @@ import de.jeanlucmakiola.floret.time.formatDateTimeCompact
|
||||
import de.jeanlucmakiola.floret.components.pastelize
|
||||
import de.jeanlucmakiola.floret.components.positionOf
|
||||
import de.jeanlucmakiola.floret.identity.FloretDensity
|
||||
import de.jeanlucmakiola.floret.identity.byDensity
|
||||
import de.jeanlucmakiola.floret.identity.reducibleSpec
|
||||
import de.jeanlucmakiola.floret.identity.rememberReduceMotion
|
||||
import de.jeanlucmakiola.floret.components.ActionButton
|
||||
@@ -817,8 +818,8 @@ internal fun TaskRowContent(
|
||||
) {
|
||||
val interaction = remember { MutableInteractionSource() }
|
||||
val pressed by interaction.collectIsPressedAsState()
|
||||
val full by animateDpAsState(if (pressed) 36.dp else 22.dp, reducibleSpec(spring()), label = "fullCorner")
|
||||
val small by animateDpAsState(if (pressed) 36.dp else 6.dp, reducibleSpec(spring()), label = "smallCorner")
|
||||
val full by animateDpAsState(if (pressed) 36.dp else 22.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "fullCorner")
|
||||
val small by animateDpAsState(if (pressed) 36.dp else 6.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "smallCorner")
|
||||
val dark = isSystemInDarkTheme()
|
||||
val due = task.shownValue(TaskEnd.DUE)?.formatDateTimeCompact(!task.hasTime(TaskEnd.DUE), LocalUse24HourFormat.current)
|
||||
val listName = task.listName?.takeIf { showListName && it.isNotBlank() }
|
||||
@@ -1046,7 +1047,7 @@ private fun AddSubtaskRow(
|
||||
modifier = modifier.fillMaxWidth().padding(horizontal = 16.dp).then(gap).revealOnFocus(),
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth().heightIn(min = byDensity(52.dp, 48.dp)).padding(start = 12.dp, end = 8.dp),
|
||||
modifier = Modifier.fillMaxWidth().heightIn(min = FloretDensity.nestedRowHeight).padding(start = 12.dp, end = 8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Spacer(Modifier.width(5.dp)) // the parents' colour-bar slot, kept for alignment
|
||||
@@ -1170,8 +1171,8 @@ private fun SubtaskRow(
|
||||
)
|
||||
val interaction = remember { MutableInteractionSource() }
|
||||
val pressed by interaction.collectIsPressedAsState()
|
||||
val full by animateDpAsState(if (pressed) 36.dp else 22.dp, reducibleSpec(spring()), label = "subFullCorner")
|
||||
val small by animateDpAsState(if (pressed) 36.dp else 6.dp, reducibleSpec(spring()), label = "subSmallCorner")
|
||||
val full by animateDpAsState(if (pressed) 36.dp else 22.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "subFullCorner")
|
||||
val small by animateDpAsState(if (pressed) 36.dp else 6.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "subSmallCorner")
|
||||
val gap = if (lastInRun) Modifier else Modifier.padding(bottom = 2.dp)
|
||||
SwipeToDismissBox(
|
||||
state = dismissState,
|
||||
|
||||
+1
-1
Submodule floret-kit updated: 7d3b7b7e45...a7f8166c4b.
Reference in new issue
Block a user