Don't use listviews in scrollviews they say, well, okay, but how do you fix this?
I have a viewpager with some lists in it (mockup)
above that, I have a tabindicator and some other information that doesn't change when you go to another tab.
My problem is that I always want to scroll the complete view (so content, tabindicator and viewpager).
If you scroll down, only the fragment with the listview (=tab content) should be visible and scrollable.
I don't want to put the content view and tab headers in a listview header because I don't want them to change every time I go to another tab (swipey tabs, so the user will see it)
What's the best way to do this?
Related
I have a design with header and footer (not fixed) scrolling with a content that is longer than the height of the screen.
Question 1. When I click the button on screen 1, content 1 will be replaced by content 2. footer and header remain the same.
Question 2. header and footer both have their own events, how can I reuse those events and only write code once?
Design what Views and View groups are suitable for this case, please help me. Currently I use Scrollview as container then replace content 1 with frament containing content 2.
ViewPager may be good for you. You can define 2 sub pages for the view pager, and when button on page 1 is clicked, advance the view pager to the next page.
I am using a view pager in a recycler view cell, which is swiped to reveal a checkmark image. Outside of this, the recycler view is contained in a fragment which is located inside of another viewpager. What I want to accomplish is, after the cell's viewpager finishes, it begins to drag the view pager containing the fragment. I have been working on this for two days and have not reached any solution. It works fine if I lift my finger between swiping the view pager in the cell and then swiping the screen again to swipe the fragment's view pager. However, I want this swipe to be possible without having to lift a finger off the screen. A good model of this is snapchat's swipe to message views. Any help would seriously be appreciated. i do not know what to do. I can provide code, but it's fairly complicated and messy.
The images below are the current app I am trying to execute this behavior in. They are for testing purposes of course. Image 1) is before nothing is swiped. Image 2) is after the cell's view pager has been swiped, and Image 3) is after the fragment's view pager has been swiped. What I want is for there to be no need to touch the screen twice in between images two and three.
best solution is to find a view that does the swipe effect without a pager
cause this is a lot of nested views
I've used one before that has done the job
check this library I used it to implement a row with a swipe to show call button and was inside a tabbed activity didn't have any issues
https://github.com/daimajia/AndroidSwipeLayout
goodluck
I want to have ScrollView Inside a Fragment that contains a TabHost as you can see from the screen-shot
it's composed by two sections:
Header: in my case it's an image, I want this section to scroll
TabHost: contains three Fragments one of them is a ListView
What I have tried ?
I tried to create a scroll view and a list view inside the TabHost, everything is fine for the two first tabs, but in the third one which is a ListView, the items are not displayed.
After some research, I figured out that we can't have a ListView inside a ScrollView.
So what is the best approach to create a view like described here is a screen-shot of what I want to create:
In fact there's a way to implement ListView in ScrollView. But with this solution, ListView acts like a LinearLayout in memory.
btw: I used it before and working nice, saves the day.
I'm trying to create a layout for my activity, but am not sure what the best way to do this is. What I want is a ViewGroup on top with some user's information. Then, below that (filling the rest of the vertical space), I have a ViewPager that hosts two ListFragments. Both ListFragments contain dynamic feeds relevant to the user.
This works fine, but what I would like to have is something that would scroll the top profile stuff out of view as the ListFragments in the ViewPager is scrolled. Attaching HeaderViews to the ListViews don't make sense since I only want the user to swipe between feeds not the feed + static HeaderView, and neither does putting the ViewPager + ListViews in a ScrollView root. Any ideas on a good way of making this layout?
I am trying to make a small dynamic book on Android.
I currently have a viewFlipper and gesture detector to swipe between the different pages in the book. This works ok if it is a fixed number of pages to a book, but I want to make it dynamic and also memory efficient by saying:
-create a linear layout with a scrollview, put this into the view flipper
-load content to that view
-on page swipe, animate to next page view but refresh the linear layout and load page2 content..etc
-on page swipe to go back a page, refresh view and load that page numbers content..etc
is there a way of doing this? instead of creating a lot of pages and overloading the memory?
A good solution would be to use a ViewPager with your own custom PagerAdapter. In the OnPageChangeListener you would load the next piece of content and then call notifyDataSetChanged() on the adapter.