Android, Material Design, RecyclerView doesn't show elements - android

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.

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?

Best method for true drill-down navigation in Navigation Drawer

I know EXACTLY what I want to do, but am new to android programming. I have gone through countless tutorials and searched everywhere, but cannot find any code examples of how to use multiple listviews (or other method, if there's a better way) in Navigation Drawer to achieve a true multi-level drill-down menu. I'm talking 4 or maybe even 5 levels of hierarchy. Expandable listview will NOT work for me. The BEST explanation I can find is the "Dropbox" example located here: http://www.androidpatterns.com/uap_pattern/drill-down-navigation
Let's assume this is for a product catalog. So listview #1 would have options like Computers, Appliances, Video, Audio. Listview #2 would re-populate the NavDrawer list with options like Stereos, Speakers, Cables (assuming they select Audio), Listview #3 would re-populate list with Sony, Yamaha, Etc. (assuming they select Stereos), and the final listview #4 would list all Sony stereos. When they make their selection, it would query the database and display the fragment view of that particular stereo.
I think I can handle all the database code. What's really holding me up is simply the functionality of the navigation. I am a very visual learner, so any actual code examples or tutorials you can point me to would be invaluable. Thank you in advance for any help! :)
I would implement it with Fragments. For every level in your hierarchy you create a ListFragment and if a user clicks on an item in the list you perform a FragmentTransaction and replace the current Fragment with the next one. I assume you know how to implement a ListFragment, if not I can explain it to you. I'm not sure what code samples to give you aside from just posting a completely implemented ListFragment as this is not really a very specific question. Perhaps I can help you further if you explain what you have tried so far or if you post some relevant code.

MvxListView in Android with MvvmCross

I'm using MvvmCross v3 and I have a little problem with list in Android.
I actually have a Mvx.MvxListView who works well, but I'm working on tablet, and ListView is a little bit inapropriate. So I want to have a control like WrapPannel in XAML to have more than one item in a row.
How can I have this kind of control?
Thanks
There are two challenges here:
1. Find or make the control you want
The first is really up to you and your UX/design team to do - although people might be able to suggest apps and projects which might help. When choosing a control always be careful to understand it's memory use - especially:
whether it virtualises the UI reusing cells (like a list does)
or whether it creates a cell for every item even if the item is not visible (like a SL WrapPanel does?)
2. Add data-binding to it
This second step is generally quite simple to do - take a look at one of the Mvx layout controls and see how it is converted for databinding - e.g. https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/Views/MvxLinearLayout.cs
You can generally just cut-and-paste this code over to your new type.
For more on subclassing existing types, also see N=18 in the video series - http://slodge.blogspot.co.uk/2013/05/n18-android-custom-controls-n1-days-of.html - this shows subclassing of a TextView
For a wrappanel, I did previously adapt and use one of #CheeseBaron's ports - FlowLayout - see http://slodge.blogspot.co.uk/2013/01/an-mono-for-android-wrappanelflowlayout.html. However, this has not been updated for v3 - if you do update it, it'd be great if you shared the results back.

An alternative to a list of SlidingDrawers

Hi I am developing an application that needs to display list of items. Clicking (or Tapping) on an item should display a description text of the item right below the item. I am talking about something like a vertical accordion.
I want them dynamically created (created in code rather than the XML). That part was completed with ease. I inflated multiple SlidingDrawer in a LinearLayout to accomplish it.
But the problem is only one SlidingDrawer is displayed in the activity. This was accomplished by giving fixed heights to SlidingDrawer. This approach will not hold as I mentioned above that the list of items is dynamically generated and also the area in the activity where the description of the item must come remains blank.
I am now looking for alternative views for accomplishing this. As I am a beginner in Android Development I cant find any that will work in android versions 2.3 and later.
You can always take a look at the SlidingMenu. The project can be found on GitHub. I guess you need to modify the behaviour a bit.

Categories

Resources