Skip to content

Commit

Permalink
Merge pull request #638 from aashay-gaikwad/backstack-parallax-fix-vi…
Browse files Browse the repository at this point in the history
…sibility

Fix visibility issue for bottom element in BackStackParallax
  • Loading branch information
aashay-gaikwad authored Nov 29, 2023
2 parents 7beb112 + da3e131 commit 7a13582
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- [#630](https://github.com/bumble-tech/appyx/pull/630) – Pass initial state into Spotlights visualisations

### Fixed

- [#638](https://github.com/bumble-tech/appyx/pull/638) - Fix visibility issue for bottom element in BackStackParallax

---

## 2.0.0-alpha09
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class BackStackParallaxTest {
with(visualisation.mapUpdate(backStackModel.output.value as Update<BackStackModel.State<InteractionTarget>>)) {
Assert.assertFalse(get(0).visibleState.value) // Child #1 should be false
Assert.assertFalse(get(1).visibleState.value) // Child #2 should be false
Assert.assertTrue(get(2).visibleState.value) // Child #3 should be true
Assert.assertFalse(get(2).visibleState.value) // Child #3 should be false
Assert.assertTrue(get(3).visibleState.value) // Child #4 should be true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,19 @@ class BackStackParallax<InteractionTarget : Any>(
private val right = TargetUiState(
offsetMultiplier = 1f,
shadow = Shadow.Target(value = 0f, easing = slowOutFastInEasing),
alpha = Alpha.Target(1f),
)

private val bottom = TargetUiState(
offsetMultiplier = -0.2f,
colorOverlay = ColorOverlay.Target(0.7f),
alpha = Alpha.Target(value = 0f, easing = { fraction -> if (fraction == 1f) 1f else 0f })
)

private val top = TargetUiState(
offsetMultiplier = 0f,
shadow = Shadow.Target(25f),
alpha = Alpha.Target(value = 1f, easing = { fraction -> if (fraction == 0f) 0f else 1f })
)

override fun State<InteractionTarget>.toUiTargets(): List<MatchedTargetUiState<InteractionTarget, TargetUiState>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TargetUiState(
offsetMultiplier: Float,
colorOverlay: ColorOverlay.Target = ColorOverlay.Target(0f),
shadow: Shadow.Target = Shadow.Target(0f),
alpha: Alpha.Target = Alpha.Target(1f),
alpha: Alpha.Target,
) : this(
positionAlignment = PositionAlignment.Target(
OutsideAlignment(
Expand Down

0 comments on commit 7a13582

Please sign in to comment.