Skip to content

Correct the TabBarView swipe selection change animation - #969

Merged
HansMuller merged 1 commit into
flutter:masterfrom
HansMuller:fix_tab_swipe_animation
Dec 16, 2015
Merged

HansMuller merged 1 commit into
flutter:masterfrom
HansMuller:fix_tab_swipe_animation

Conversation

@HansMuller

Copy link
Copy Markdown
Contributor

The TabBarSelection change animation needs to start where the fling's drag gesture ended rather than from zero. The intial vlaue of progress for the TabBarSelection's performance is now converted from the range used during an interactive drag, to the range used when animating from the previously selected tab to the new one.

TabBarSelection now requires a maxIndex parameter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does all this work well when maxIndex == 0?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right. I added some asserts to verify that two or more tab labels or views are specified, since that's what's supported now. Filed an issue for the general case:
#970

@Hixie

Hixie commented Dec 16, 2015

Copy link
Copy Markdown
Contributor

not sure I fully follow this logic, but LGTM.

The TabBarSelection change animation needs to start where the fling's drag gesture ended rather than from zero.  The intial vlaue of progress for the TabBarSelection's performance is now converted from the range used during an interactive drag, to the range used when animating from the previously selected tab to the new one.

TabBarSelection now requires a maxIndex parameter.
@HansMuller
HansMuller force-pushed the fix_tab_swipe_animation branch from ab8134c to 65dca5b Compare December 16, 2015 23:31
HansMuller pushed a commit that referenced this pull request Dec 16, 2015
Correct the TabBarView swipe selection change animation

The TabBarSelection change animation needs to start where the fling's drag gesture ended rather than from zero. The intial vlaue of progress for the TabBarSelection's performance is now converted from the range used during an interactive drag, to the range used when animating from the previously selected tab to the new one.

TabBarSelection now requires a maxIndex parameter.
@HansMuller
HansMuller merged commit fd4599f into flutter:master Dec 16, 2015
@HansMuller
HansMuller deleted the fix_tab_swipe_animation branch December 16, 2015 23:44
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants