You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Original
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)
Doing a line by line comparison between my code and the example provided, I was able to figure out at least one thing I had wrong, but it's still not behaving quite right.
Now I can swipe infinitely, but it's not always loading the right page. I'm updating the repo now with the latest code. It goes something like this:
Update
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
Original
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()
returnInteger.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:
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.
The text was updated successfully, but these errors were encountered: