Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add shifting animation to bottom-tabs and various fixes
This adds a new shifting animation preset to bottom tabs, as well as various animation related fixes. - Instead of `0`, `1` for animated value, use `-1`, `0`, `1` - so that it can represent both focus state and direction - Animate with `duration: 0` when animation is not enabled - this ensures that the animation values stay in sync - Add correct types to animated styles instead of `any`
- Loading branch information
Showing
13 changed files
with
186 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
packages/bottom-tabs/src/TransitionConfigs/TransitionPresets.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import type { BottomTabTransitionPreset } from '../types'; | ||
import { forCrossFade } from './SceneStyleInterpolators'; | ||
import { CrossFadeAnimationSpec } from './TransitionSpecs'; | ||
import { forCrossFade, forShifting } from './SceneStyleInterpolators'; | ||
import { CrossFadeSpec, ShiftingSpec } from './TransitionSpecs'; | ||
|
||
export const FadeTransition: BottomTabTransitionPreset = { | ||
animationEnabled: true, | ||
transitionSpec: CrossFadeAnimationSpec, | ||
transitionSpec: CrossFadeSpec, | ||
sceneStyleInterpolator: forCrossFade, | ||
}; | ||
|
||
export const ShiftingTransition: BottomTabTransitionPreset = { | ||
transitionSpec: ShiftingSpec, | ||
sceneStyleInterpolator: forShifting, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.