An app includes a feed like Twitter or Instagram.
Tried it with the RecyclerView.
Would Litho (fblitho.com) be a good alternative to make a good feed with text, videos and pictures? Or maby other libraries?
I would suggest learning more about RecyclerView before trying to move onto different libraries. Even if you do end up using another library, it's always good to have a better understanding of what it's being built on top of.
RecyclerView is the best way to handle feeds like you're looking to build. Even with images, or videos.
If you have any specific questions about RecyclerView, you should ask them here. For example, why does RecyclerView not fit your current needs?
I strongly recommend you to take a look at epoxy. As it description says, it is an Android library for building complex screens in a RecyclerView. Models are automatically generated from custom views or databinding layouts via annotation processing.
Wish it can help you.
Related
This is one of the implementations that I have the most difficulty in actually finding the best way to solve.
There are a lot of techniques and ways, but the last answers I found did not really seem to me to solve the problem. Another point is that they are usually very old techniques and libraries.
What I want to do is this:
How do I create this ListView with a GridView inside and the screen has infinite height without using ScrollView, so we know that it is not recommended to use ListView within ScrollView.
I am not asking you to develop the code, but rather recommend me the correct architecture that I should use to implement this (ScrollView, ListView, GridView), or memo a library that has new development concepts that can help me.
This question arises because many of the existing responses are too old and have outdated ideas.
I know the question is of a slightly higher level of complexity, but I accept everyone's help.
Thank you very much.
It is very easy to solve this using a RecyclerView.
The documentation is pretty clear and explains all the details necessary for the development of the functionality.
I will leave the necessary documentation links to implement:
RecyclerView
GridLayoutManager
ItemsViewHolder
We know that it is always better to use native components in the development, I recommend, but if you prefer to use a library ready to solve your problem, here are some interesting:
Sticky Headers
recyclerview-stickyheaders
StickyListHeaders
I am developing an android app similar to other social network app such as Facebook , Google plus. Similarly my newsfeed ListView have multiple views type and also complex. Even though i am using ViewBinder , my list view feel laggy as i add in more view types. There is a clever alternative solution here. They split each list item into multiple components such as header , content , footer and so. I planned to adapt and find it difficult to start code on my own. Is there any working code available out there similar to this technique?
Consider using a RecyclerView. It's a little more work than using a ListView but it should handle the complexity you're looking for.
http://developer.android.com/training/material/lists-cards.html
I'm working on an Android application and one of the features is a list of upcoming events. I need to be able to generate a 'card' so to speak for each of these events and place them in to a scroll view. This would be simple if I knew how many there were going to be and could prepopulate an axml file but I must populate the scrollview programmatically based off the parse of an xml file on the web so that the client can keep it updated. I've searched everything I can think and the best I can find is a custom list view which I do not think will provide the results needed. I've uploaded an example of what I'm trying to do to my google drive and linked to it below. I should also mention my background is completely C# and I've only been working with java for the last two weeks or so, so if anyone could provide a working code example I would be most appreciative.
https://drive.google.com/file/d/0B8alYNlu3SuoSEk0bE55cDhXWVE/view?usp=sharing
I think that basically what you need to do is to implement a RecyclerView using a LinearLayoutManager (this would represent basically a list) with CardViews as the items or just regular layouts designed by you, the CardView will just make your life easier if you need the Material Design cards appearance.
You have many different tutorials as how to implement this, as you can see here:
http://www.binpress.com/tutorial/android-l-recyclerview-and-cardview-tutorial/156
You'll see there that it's exactly what you need but with smaller Cards.
Let me know if this helps.
I'm quite new to the world of Android development, and I'm relatively comfortable working with Adapters and GridViews. However, I'm looking to build something a little more advanced with GridViews that seems to be proving quite difficult without using third-party libraries (impossible from what I've read). Even using a third-party library like Etsy StaggeredGridView (https://github.com/etsy/AndroidStaggeredGrid) I can't seem to get it right. The best I can get is having rows that bleed into other rows, Pinterest-style, but what I'd like is something along these lines:
Where every nth cell actually has the width of two cells and offsets the grid.
So what I'd like some direction on is:
How could I accomplish this repeating pattern using a GridView/ Adapter combo?
Or failing that, how could I do this more efficiently than nesting a bunch of LinearLayouts inside a ScrollView and doing some really messy logic?
You can't. GridView has no way of merging columns like that. You can try using a GridLayout or TabletLayout to obtain that look. However neither support an adapter. You're best bet is to look for 3rd party libraries.
If there isn't going to be a lot of scrollable content, I'd go with (Grid/Table)Layout. You may take a small hit with memory consumption but you'll save yourself a lot of time in implementing your own custom solution. Which just may be your only choice if no 3rd party library exists.
One possibility would be to looking into RecycleView. It's a new view coming out with Android L that will also be in the support library. It's basically a more advanced version of a ListView that allows you to build customizable layouts that scroll and recycle their content. From the looks of it, it appears it would allow you to build an easy solution for your case.
I want to add a header to my list view that will appear when I scroll up and disappear when I scroll down. This functionality is in the Facebook app. Is there any component in the ListView that I can call?
If you are comfortable using 3rd party libraries, here's a great one based on what you want.
https://github.com/LarsWerkman/QuickReturnListView
Also, I would really suggest you to take a look at Libraries for developers app. https://play.google.com/store/apps/details?id=com.desarrollodroide.repos
Very much useful for us developers! I happen to stumble upon a lot of useful libraries from this app!