I have listView like main part of my activity view. I want to implement header bar like in twitter app. (hiding header onScroll UP and showing header onScroll DOWN). How can I do this?
Thanks for all future help.
You can try using PoppyView though you may need to tweak it to implement it as per your requirement
Related
I am working on an android application and want to implement a functionality in which I want to show a layout which will contain Like/Comment of that content at the bottom of the page.
I want this layout to be shown when I scroll up the page and hide when I scroll down the page.
I have scene many applications that have implemented this feature, but I have no idea how to implement this feature in my app.
Please check this link of the app which is giving the same functionality which I want to implenment https://play.google.com/store/apps/details?id=com.midsizemango.materialapps
Please help if anyone have idea here, Thanks a lot in advanced.
You need to do the same thing which happens with fab, first create a class extendingCoordinatorLayout.Behavior<View> and implement it like other fab examples. just remember that it won't work on simple listView and gridView.
Also here's a good detailed tutorial for you.
You Just have to set Scroll-Up & Scroll-Down listener of your Recycler view or Scroll View check Reference link.
Now base on Scroll-Up & Scroll-Down listener set VISIBLE / GONEof your footer view either it is LinearLayout or Toolbar with animation.
I would like to implement the same pull-to-refresh UI pattern used by the Twitter app.
I have been trying to use a RelativeLayout containing a ListView, but it's really slow. How can I make it as smooth as Twitter?
I have been using the Listview's onTouch callback to get the MotionEvent, detecting when the listview is already scrolled to the top and the touch is moving downwards. Then, I adjust the top margin of the listview based on the Y coordinate. But surely that's not the way to do it, as the Listview moves down in little steps, not smoothly.
Do you know which layout should be best used?
Below is just a screenshot from the Twitter app:
UPDATE:
I think I found it. I believe the smoothest implementation is by using the ListView header. So, no need to use a viewgroup like RelativeLayout. Everything could be implemented within the ListView.
Android has a SwipeRefreshLayout for this purpose.
https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html
I'm trying to find the best way to approach implementing Facebook like floating last row on Grid view.
when scrolling down, the status-photo-checkin disappear to allow more space for the list, and when scrolling up it appears again. anyone has an idea how can I implement this or direct me to an existing component/library?
I have seen the post Android Listview Floating First Row and try the Quick Return pattern: https://plus.google.com/u/0/+RomanNurik/posts/1Sb549FvpJt
But it does not work for GridView.
Check out this QuickReturn library I wrote.
https://github.com/lawloretienne/QuickReturn
It even has an example of how its done in Facebook.
I am working on an Android app, in which an Activity contains a header view and a ListView below it.
I want when the listview scrolls down, the header dismiss (at the same speed I scroll), and when the listview scrolls up, the header shows back.
I am not sure if I explained it clearly. If I did not make it clear, please take a look at the Twitter Android app. The action bar tab has the same effect as I described.
Thank you!
Actually you need pinnedHeaderListView for that you need implement logic of below two library or you can use these library to desire effect that you want.
https://github.com/JimiSmith/PinnedHeaderListView
https://code.google.com/p/android-amazing-listview/
I am using a ScrollView to display a list of items that are inflated on runtime. Like a feed of updates for the user.
While thinking about the options i got to let the user update the view with new notifications I thought about the pull to refresh feature in the twitter app.
Anyone got any idea how and if can it be implemented with a ScrollView ?
Saw there are some implementations for that using ListView but I don't like the idea of changing all of my platform to gain this refresh effect.
There is a solution introduced for implementing pull to refresh for various component which are scrollable like listview and scroollview.
Look at ChangeLog link https://github.com/chrisbanes/Android-PullToRefresh
ListView with just one element can be treated as a ScrollView. You can use the implementation for pull-to-refresh ListView and add just one item in it. I had used this trick in the past.
You can do that. You can increase the top margin of the scrollview when the user moves the finger down and the scrollview it's on it's top. Then on release fire the update and decrease the margin with animation.(You have to create your own animation to pull that off). That's the idea. If you want more particular help ask what you cannot implement.