tobiasbuchholz / circularviewpager Goto Github PK
View Code? Open in Web Editor NEWThis is my implementation of a circular ViewPager
This is my implementation of a circular ViewPager
/src folder is empty unable to use
My project is mature and uses non-support fragments. Changing the code base to use support fragments is non-trivial. It would be neat if your library supported both types. :)
If using inside an Activity, works as expected.
If used inside a fragment, throws:
"java.lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 3, found: 5"
"final Bundle savedFragmentState = f.mSavedFragmentState;" - Not found this field! Not build.
I fixed half of my issue and made a second post (below). There's still a problem, but at least it's scrolling infinitely now
I'm brand new to Android development, so forgive any terrible code or lack of understanding of simple concepts (like the difference between an Activity and a Fragment)
For my work I was asked to create a simple app with 3 screens that you could cycle between with a swipe, and on each of these screens we wanted a streaming video (same subject, different angles). Because Android supports OpenGL I know that in the worst-case scenario this is guaranteed to be possible by drawing all of the content to the screen myself, but Android had a lot of built-in UI components that seemed to make the job easier. Unfortunately I quickly learned that the ViewPager wouldn't meet my needs - as every solution online suggests you need at least 4 screens (I want 3) and their suggestion of having getCount()
return Integer.MAX_VALUE
means you can swipe right infinitely, but you still hit 0 if you swipe left.
Then I found this library - and the demo worked perfectly. I believe this will do everything I need. But when I tried to implement it in my project, I got the following behavior:
Load app: Displays screen A
Swipe left: Failed (hit the edge)
Swipe right: Displays screen A
Swipe right: Displays screen B
Swipe right: Displays screen C
Swipe right: Displays screen A
Swipe right: Failed (hit the edge)
Swipe left: Briefly displays screen C, then switches to screen B when the animation completes
Swipe left: Displays screen B again
Swipe left: Displays screen A
Swipe left: Displays screen C
Swipe left: Failed (hit the edge)
Here's a link to the repository where I temporarily uploaded my code (I've removed the license key for our Red5 streaming server from the code, so the video won't work -- but there's a red bar at the bottom of each screen which reads "test 1", "test 2", and "test 3" for each screen)
https://github.com/stevendesu/red5pro-tmp-repo
I'm not sure if I'm doing something wrong or if I found a bug in the library.
i have a grid view inside viewPagerFragment when i scrolling view pager it shine at the "end" of item. i mean at the first item or last item that repeated. i set view pager and grid view "overScrollMode="never" ",in xml and java code, but the problem not solved!
It do not scroll properly, when i am on last page, and swipe right, it sets item on first index instead of 0th index and vice versa.
I tried to reinitialize like this
viewpager.setAdapter(new BranchCircularViewPagerAdapter(getApplicationContext(), getSupportFragmentManager(), temp)); final CircularViewPagerHandler circularViewPagerHandler = new CircularViewPagerHandler(viewpager); circularViewPagerHandler.setOnPageChangeListener(createOnPageChangeListener()); viewpager.addOnPageChangeListener(circularViewPagerHandler);
But it previous fragment is still there it wont remove..
how to create shape in circular and put this viewpager at bottom of the screen so that user can keep rotating as arc menu
Hi, and thanks for this library. I can't get setCurrentItem to work properly - the item I set is always off by one. The only way seems to be to use a "+1" when I invoke setCurrentItem, so for instance: if the user clicks on the item 0, I need to launch the pager and use setCurrentPager(1).
Is this somehow expected by the CircularViewPager? I see that in the CircularViewPagerHandler constructor, the current item is set at 1 by default and not at 0.
Thanks for any hint.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.