Android Listview Floating First Row - android

I'm trying to find the best way to approach implementing Facebook like floating row on list 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?

It's called the Quick Return pattern, and Roman's explained it in detail along with an example here:
https://plus.google.com/u/0/+RomanNurik/posts/1Sb549FvpJt

You can find implementations at these two pages:
https://github.com/LarsWerkman/QuickReturnListView
https://github.com/ManuelPeinado/QuickReturnHeader
And I suggest you to read the following blog post which discusses when to use and not to use this ui pattern: http://www.androiduipatterns.com/2012/08/an-emerging-ui-pattern-quick-return.html

Related

material design two line list in android

this might be a duplicate question but I'm wondering how to use the two-line list from "material design" on a recycler view. I can't figure it out, and I can't find anything on Youtube and Stackoverflow after searching for about an hour.
I want to create something like the picture below.
This image is directly from the website itself: https://material.io/components/lists
Thanks!
Well, in order to do so, it would suffice to use android.R.layout.simple_list_item_2 as the row layout in your Adapter. Although it won't have the overflow menu icon. I don't know if you are trying to replicate that exact same list you posted.
But honestly, I don't know what's your Android experience. Do you have a working understanding of RecyclerViews and Adapters?
The link you provided shows Material Design guidelines. It doesn't necessarily mean that those lists and functionalities are ready to use with any basic Adapter you implement. For complex rows, you need to provide the layout, as well as implement functionality to user-initiated events such as click listeners, swipes, drags, etc.
For me, codelabs are always a good place to start with some hands-on exercise.
RecyclerView codelab:
https://developer.android.com/codelabs/kotlin-android-training-recyclerview-fundamentals?index=..%2F..android-kotlin-fundamentals&authuser=1#0

Motion UI ListView android example

Maybe someone knows/or found somewhere how to make this kind of list on android using kotlin?
https://cdn.dribbble.com/users/418188/screenshots/2182940/art_gallery_app.gif
I think it's similar to Material desgn:
https://material.io/design/components/lists.html#behavior
but I couldn't find anywhere is it cards layout or some expandable list view. So maybe someone experienced could tell me from where I should start to make list like in the first link?
Moreover for such transitions is it better to use Fragments or Activities?

How to do advance "listing" for android views

I've been searching for a while now how to do some "Advance" lists like the facebook news feed and I don't think I am using the right keywords to search how to do that. I'm still quite new to android environment.
This is what I am trying to achieve:
How would I achieve a kind of list like that? Can I just do somekind of layout with a scrollbar and feed in some custom views? Do I need to do some kind of advance list?
Thank you for refering me to some useful information
For simplicity's sake, I would recommend maybe you should use a ScrollView nesting a Vertical LinearLayout and dynamically add all your child items in there.
I know...it's not the right way, but this is coming from a (somewhat) beginner's point of view here myself. (I've been coding all my life, but I was immediately not a fan of Lists and "Adapters" when I got into Android.)
So, if/when you need to search through/categorize/sort/manage your items I would suggest maybe using View.setTag() to store key information about each child, and either a) loop through all your child elements for deep searching, or b) use View.findViewsWithText() or findViewWithTag() for quick searching/categorizing.
It can get dirty pretty quick if you have to do extensive sorting, but in my head (and maybe yours) I would rather use what I know rather than learn what I don't know.
I didn't intend this to be an rock-solid answer, but it's a lot of info to cover in the comments.
Happy programming

Pull to Refresh on ViewPager

I'm looking to implement pull to refresh on a ViewPager, and I'm curious what the best way to go about it is.
It looks like just setting a page transformation on the ViewPager wouldn't really do the trick, as you really want things like onAbsorb, which is available in EdgeEffect.
Just implementing an EdgeEffect doesn't seem like the right choice, since AFAICT, it won't move any of the existing children around.
I'd rather not use the PullToRefresh library (since it isn't being maintained), and would prefer to do mostly custom stuff -
Any advice on what approach is the most promising way to proceed?
Don't try to implement the pull to refresh by yourself, there are several good 3rd party libraries which are very easy to use.
But pull to refresh maybe not a good choice on android, a refresh action button is better.
A widely used pulltorefresh library.
It is slide to refresh that you want, as it is ViewPager. Detect a swipe (left on first element and right on last) and request for new data, when the detection is positive. For that you want onInterceptTouch over a Custom ViewPager, and a SwipeGesture detector. After that you can try other custom features that you suggest in your question.
I'm looking to implement pull to refresh on a ViewPager, and I'm
curious what the best way to go about it is.
You sited you didn't want to use the PullToRefresh library, and I get that. But I would start your research/exploration there if you are looking for similar behavior. Chris' repos have a healthy commit history, and from those you can infer some decisions regarding design choices, pitfalls, and fixes.
https://github.com/chrisbanes/Android-PullToRefresh
https://github.com/chrisbanes/ActionBar-PullToRefresh
With something like a scroll view, I imagine you can have EdgeEffects and PTR in the actionbar and not worry about moving children at all (with it working right out of the box - His google play sample app has that behavior). But I'm not sure if that is the exact effect you are looking for.
Don't implement pull to refresh on Android. I know it's not the answer, but pull to refresh is an iOS convention, not an Android one.

Slide to layout Android

I'm apparently not phrasing it correctly to get any accurate results on Google. I want to be able to slide right/left to go to another layout. What is the proper term I should be using when trying to find an example of how this is done?
You are looking for the ViewPager.

Categories

Resources