Comments (9)
same issue..
i use a trick this
pagerAdapter.notifyDataSetChanged(); viewPager.setAdapter(null); viewPager.setAdapter(pagerAdapter); viewPager.setCurrentItem(viewPosition);
i'm working
from android-coverflow.
Hello,I had the same issue, the solution:
private void saveItem() { pagerAdapter.addItem(new Item("ItemAdded")); cardPager.setOffscreenPageLimit(pagerAdapter.getCount()); // this is the important thing cardPager.setCurrentItem(pagerAdapter.getCount()); // this is cos the problem still there when we add an item, but if you select the item inserted then the pager will show the new item added correctly }
from android-coverflow.
Hi there!
Same issue here while removing item from my ViewPager
(which calls notifyDataSetChanged()
). I am currently using a library that wraps the ViewPager
with additional features. When removing my item, the library takes care of updating the ViewPager
content and scroll to next position. However both scale and margins are broken and only scrolling the content refreshes the pager correctly.
I tried to force an invalidate()
that is done in the onPageScrolled()
callback but with no success. I obviously tried the solution above but it is not always working. Plus this is not the wanted behavior as I definitely don't want to have my pager scrolling the last item.
Any idea how to simply achieve this force refresh to keep the CoverFlow
correctly configured
from android-coverflow.
Actually combining both setOffscreenPageLimit()
setCurrentItem()
seems to do the trick for all items except the first and last item in the pager, especially if you only want to scroll forward (after add item to pager) or back (after remove item from pager). Seems erratic to me :)
from android-coverflow.
I've stumbled with this issue too. Simulating a MotionEvent was the only thing that worked, though it obviously looks bad, and is prone to looking worse across devices.
from android-coverflow.
Confirm bug. Angle issue.
from android-coverflow.
@djshanne After call notifyDataSetChanged(),my view has no cos。event if i setOffscreenPageLimit,can you sovle it??
from android-coverflow.
Can you tell me, what do you mean with has no cos ? Sorry I dont get it. @catroom
from android-coverflow.
I also have the same problem can anyone have a solution for it ?
from android-coverflow.
Related Issues (20)
- How to know when user changes cardview HOT 1
- On initial launch, doesn't transform HOT 2
- Program type already present: android.support.v4.app.FragmentTransitionCompat21$
- The method of setPageItemClickListener not work HOT 2
- supportV4
- Restore transform
- the production environment removes logs
- 椭圆弧形的变化效果?
- kotlin, setPageItemClickListener not works into fragments HOT 1
- Migrating to AndroidX
- [very interesting] but it need some fix-issue
- issue with scrollView (vertical)
- Clicks on Upper LinkagePager in Linkage2 coverflow are reversed
- How to add onClick listener to each card and how to show layouts in each card ? HOT 1
- Can we show more than 3 card HOT 2
- How to avoid scroll when click on pagerContainer
- viewpager2 HOT 1
- Disable debug logging for scrolling position? HOT 1
- Not working in Realme Device HOT 2
- IllegalAccessError in running app
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-coverflow.