material design two line list in android - 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

Related

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?

Android, Material Design, RecyclerView doesn't show elements

I have a question related to Material Design introduced in Android 5. I'm very new with UX interfaces. Now I'm trying to implement simple music player with fragment for choosing songs from storage. Actually, that fragment contains RecyclerView. But RecyclerView doesn't show any element (it contains views with one TextView), even simple "..". I checked it with log-tracking and found that function "onBindViewHolder" was called correctly. To be honest, I have no idea what is wrong with my code. Obviously, I provide link to my project: UX
I will be gratefull for any suggestion, advice or may be pointer to the mistake.

Android Listview Floating First Row

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

Switch from one page to another

I'm new to Android programming and I'm working on my first application "FunFacts" where
there should be more than 100 cool things to learn about nature, science etc.
My question is: How can I switch from one page to another using two buttons "left" and "right"? which method should I use? I don't think that a horizontal scrollview is the solution.
So if I have 2 different layouts, page one and page two, how can I switch from one to other in my application?
Thank you!
It sounds like you might want a ViewPager. Below is a link to the Android tutorial. This creates a slideshow type effect which sounds like what you're going for. You said you will have different layouts which this will use one layout but you can customize the content and I would think you would want one so it all looks relatively the same
Docs
Update
No, you don't have to create 100 layouts or activities. Just one of each. Following will be a link to a post that explains it a little better. That post explains how it is like a listview in that you add the different pages to your view adapter as you would with a list. You can use the same layout for all and just add new data to it (like a list). Probably store them in an ArrayList or possibly a DB if you have that many and want to have a lot of data attached to them. I hope this makes sense and helps a little. I would suggest starting one with just a couple pages to see how it works, following these examples, and if you get stuck then post a more specific question as to what you can't get to work.
Link

Is there something like a ListView that allows dynamic relocation of ListView elements drag-and-drop style?

I am having a hard time describing this in a way Google will understand. Is there a list object that has the capability to drag a List element and move it up or down to the desired location?
ya. check this link out : https://github.com/commonsguy/cwac-touchlist.
Actually this has been implemented in the Android Music application. Just take a look at the source code as well.
Please make sure you research your question before posting. This has been discussed a lot of times in stack overflow.. possible duplicates here :
Android List View Drag and Drop sort
How can I allow a user to re-sort items in a list?

Categories

Resources