Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ios): update ViewPager's pageIndex automatically after data changes #3857

Merged
merged 2 commits into from
May 16, 2024

Conversation

wwwcg
Copy link
Collaborator

@wwwcg wwwcg commented May 16, 2024

Before submitting a new pull request, please make sure:

  • Test cases have been added/updated/passed for the code you will submit.
  • Documentation has added or updated.
  • Commit message is following the Convention Commit guideline with maximum 72 characters.
  • Squash the repeat code commits, short patches are welcome.

wwwcg added 2 commits May 15, 2024 17:54
Also fixed the issue of missing onPageSelected callbacks upon first entry;

The logic for automatic updates keep same with Android, as follows
1. If the previous item only changes its location,
update the current location and keep the current item displayed.
2. If the previous item does not exist, do not adjust the position,
but keep the current position in the valid range (that is, 0 ~ count-1).
this is a minor fix for feat 'pageIndex of ViewPager auto update after data changes'
@wwwcg wwwcg requested a review from ruifanyuan as a code owner May 16, 2024 07:39
@github-actions github-actions bot added renderer: native size: s Denotes a PR that changes 10-99 lines labels May 16, 2024
Copy link

hippy-service bot commented May 16, 2024

Hi, @wwwcg. Thanks for your PR! 👏

🏷️ You can leave a comment in this PR with #help tag when you need help (e.g. some status checks run failed due to internal issue), admin team members will help asap.

@wwwcg wwwcg merged commit 4769911 into Tencent:main May 16, 2024
28 of 30 checks passed
wwwcg added a commit to wwwcg/Hippy that referenced this pull request May 16, 2024
…ges (Tencent#3857)

* feat(ios): pageIndex of ViewPager auto update after data changes

Also fixed the issue of missing onPageSelected callbacks upon first entry;

The logic for automatic updates keep same with Android, as follows
1. If the previous item only changes its location,
update the current location and keep the current item displayed.
2. If the previous item does not exist, do not adjust the position,
but keep the current position in the valid range (that is, 0 ~ count-1).

* fix(ios): auto-update of page index may lag by one frame in view pager

this is a minor fix for feat 'pageIndex of ViewPager auto update after data changes'
@wwwcg wwwcg deleted the main_2 branch May 20, 2024 03:24
wwwcg added a commit that referenced this pull request May 20, 2024
…ges (#3857)

* feat(ios): pageIndex of ViewPager auto update after data changes

Also fixed the issue of missing onPageSelected callbacks upon first entry;

The logic for automatic updates keep same with Android, as follows
1. If the previous item only changes its location,
update the current location and keep the current item displayed.
2. If the previous item does not exist, do not adjust the position,
but keep the current position in the valid range (that is, 0 ~ count-1).

* fix(ios): auto-update of page index may lag by one frame in view pager

this is a minor fix for feat 'pageIndex of ViewPager auto update after data changes'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
renderer: native size: s Denotes a PR that changes 10-99 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant