Skip to content

Commit

Permalink
Fix primary action button bottom padding going into negative values
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed May 25, 2023
1 parent 4230cd1 commit 5370fe5
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.unit.coerceAtLeast
import androidx.compose.ui.unit.coerceIn
import androidx.compose.ui.unit.dp
import com.moriatsushi.insetsx.ime
import com.moriatsushi.insetsx.navigationBars
Expand Down Expand Up @@ -194,7 +193,7 @@ fun HomeScreen(
.coerceAtMost(24.dp)

val primaryActionBottomPadding =
navigationBarPadding - (4 * bottomSheetSwipeTransition.currentState).dp.coerceIn(0.dp, 4.dp)
navigationBarPadding - (4 * bottomSheetSwipeTransition.currentState).dp

Box(Modifier.padding(start = primaryActionStartPadding).align(Alignment.BottomStart)) {
if (state.canShowFeedLinkEntry) {
Expand All @@ -212,7 +211,7 @@ fun HomeScreen(
)
} else {
BottomSheetPrimaryActionButton(
modifier = Modifier.padding(bottom = primaryActionBottomPadding),
modifier = Modifier.padding(bottom = primaryActionBottomPadding.coerceAtLeast(0.dp)),
selected = state.isAllFeedsSelected,
bottomSheetSwipeProgress =
(bottomSheetSwipeTransition.currentState * threshold).inverseProgress(),
Expand Down

0 comments on commit 5370fe5

Please sign in to comment.