I'm trying to use a SlidingPaneLayout inside of a ViewPager. All I can find are solutions for the other way around, like Using Android's SlidingPaneLayout with ViewPager which doesn't work.
Is there something easy to change to allow the SlidingPaneLayout's edge to get priority over a ViewPager's? I don't know anything about handling touch events or I'd try to tackle it myself.
JFeinstein slideMenu project is referred to in this post - very similar to yours. The config for the inner view can be configured to consume the swipe from the edge of the bezel, before that event propogates to the ViewPager
Related
i'm trying to achive this on my application:
youtube link
The goal is to have a ViewPager that can be dragged vertically but at the same time you can swipe the views inside of ViewPager, the problem is when i swipe inside of viewPagger horizantally the dragg resets to the inicial position
to achive what is in the video, i follow this blog post
So i implemented a DraggerViewHolder that extends to a FrameLayout and then ViewDragHelper inside of it! all the code is at github
So, how can i make it stay on the same drag state?
So finally i have manage to fix the problem(sort of because sometimes i still get the "bug").
You can see in the github repo(in the question) the commit with the fix, for more information about the solution see this question
I use ViewPager with PagerAdapter. Is it possible to implement vertical swipe in Android, where you can scroll between views from top to down and from down to top? I need identical behavior that ViewPager does by default, but in vertical way. I found method canScrollVertically() but it's not what I am looking for I suppose. Thanks in advance
Natively, no.
However, Jake Wharton has a directional ViewPager that does this.
https://github.com/JakeWharton/Android-DirectionalViewPager/
The only problem is he doesn't support it anymore, but it will get you started. It might even be enough for what you want.
I'm using the new slide navigation UI pattern in my android app, yet it keeps crashing when I use it with a vertical listview. The listview listener on my main screen conflicts with the slide menu listener, which causes the crash when they both capture the motion events.
I know using two different listeners for motion events isn't recommended, yet many applications use it nowadays (like Youtube and Facebook). How did they manage to do it? Any useful libraries out there that can solve this issue?
If you want to implement list view on the main screen, you would do that using any of the ListViewAdapter. For implementing listView on the side screen when the view is slided you need to implement using ListFragment.
Also, you may refer example in https://github.com/jfeinstein10/SlidingMenu
In my viewpager Ive enabled horizontal scrollbar by such featuredPager.setHorizontalScrollBarEnabled(true);
However it never shows up or does anything
setHorizontalScrollBarEnabled is a method of View. It will not work as an indicator for the pages of a ViewPager. You can make your own View that does this, by listening using an implementation of ViewPager.OnPageChangeListener. However, there are already some libraries that can handle this for you, like this one. I would recommend you to try that first.
i've now got the listview and it's touch actions and swipe actions working. But now i'm not sure how i can implement a swipe effect, like it's in the twitter app.
I've found in the internet that it's possible to animate 2 views with a viewflipper, but is it possible to animate two layouts in the same way?
Anyone out there, who knows how i can implement such a function?
The only thing i want is to switch the ListViewsItem layout with a swipe.
Simple, set both the item views in 2 separate thread and then start both of them.