I have a layout with a linearLayout (top layout) and a listview under this.
What I want to do is like the phone app in Lollipop:
With the scrollbar I can scroll the contact list (top layout doesn't move)
When scroll the list with the finger, first the top layout is scrolling and once it is not visible anymore the listview scroll. When the top layout is visible the scrollbar doesn't move.
Someone has any idea how to do this trick?
What I'm thinking :
I can add the top layout to the header of listview, but the scrollbar take count of the header. And if I scroll with the scrollbar, the top layout will scroll
Trying to set a scrollListener to the listview, and translate the top view, but don't think it will be good and the scrollY is not available for listView
I think I can do something with a scrollView for the root layout, but I know it is not good to put a listview inside a scrollview.
I don't find any proper way to do this kind of feature...
EDIT: To be more clear, I want to translate the listview before I'm able to scroll the listview itself. Problem is when translate listview, the listview height will not expand.
I am also getting this problem in version 5.1 in lower version it's working fine.Try to use in 5.0 As it STABLE verson, also check another scrolling bug in 5.1 in this link here I could not comment so posting this as answer.
Related
I have a TabLayout inside a CoordinatorLayout set up using ViewPager.
In the first fragment I have a GridView inside a SwipeRefreshLayout. I have set the nested scrolling on for GridView using gridView.setNestedScrollingEnabled(true);
It works fine for API level 21 and above. Now for API level 19 i expect the app bar to not collapse but at least the GridView should be scrollable till the end row.
Instead what's happening is the bottom most row is not fully display, i.e. can't scroll till the bottom of gridview. And the height that's cut off(not scrollable) at the bottom row is visually the same height as that of the app bar.
My understanding is, if the nested view cannot be scrolled then it should just take the remaining height i.e. fill_parent, although even setting that to gridview doesn't help.
I've tried all possible permutations of setting layout heights but couldn't get it working. Could someone please guide me further?
On scrolling down gridView.
I want to scroll my three tabs on top as shown in second image.
And on scrolling up back shows that again like first image.
I have checked paralloid library, but not sure if it solves this problem or not.
Same functionality i found in google+ android app. In profile page on scrolling tab scroll till they reach on top. after that list view scrolls.
GridView already has scrolling built into it, so its children should scroll separately than its siblings by default. No extra library should be needed for scrolling down, although scrolling horizontally is a separate issue.
I have an HorizontalScrollView in my design, which I populate with a variable number of items. The problem I have is that sometimes I populate it with many items, so the ScrollView shows scroll bars. That's OK, but I would like to check this situation and show a Previous and Next buttons in this case.
How can I do this?
I don't think ScrollView has a scroll listener. Synchronise ScrollView scroll positions - android might help you for creating a custom one.
In my app I have a scroll view with n number of data to be listed out. There are two buttons one is named as UP placed above scroll view and the other is DOWN placed below scroll view.
Using the UP and DOWN buttons the list of views can be scrolled.
When the scroll bar is in top the Up button will be invisible and when the scroll bar reaches the bottom the DOWN button will become invisible, I have written logic for this using the getScrollX() method.
Now my problem is when there is very few data for example 3, the scroll bar will not be visible and the layout cannot be scrolled, in such a case both the UP and DOWN buttons need to be in invisible. How to do this, please suggest me a way?
You can try and use a ViewTreeObserver to check the dimension of the View inside your ScrollView. If the dimension exceeds a certain limit (such as the screen size), the ScrollView will be scrollable. See this preview SO answer for more details. Hope that helps!
I'm trying to implement a FAQ screen in my project and I wanted to use ExpandableListView. I display question as a text in GroupView and answer as a text in ChildView. If items can fit into screen, there's no problem, it works as it should. But when there's more items than the screen height and I have to scroll, this problem occurs that when I expand the last item, it acts like it's expanded but I can not scroll to the child view.
Any ideas or experiences on this issue?
Here's the screenshot (as you can see, scrollbar shows that it's expanded and there's place to scroll, but when I try to scroll, no luck) :
EDIT: I found out that this problem is because I'm using a WebView inside child row, when I switched to TextView it works as expected. How can I achieve the same result with WebView?
In your getGroupView() method of BaseExpandableListAdapter, give view=null as the first line of the method.