ListView with a gridView within infinite height - android

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

Related

Draggable / Expandable RecyclerView?

What is the newest and simplest way to do this?
All I want is the ability to drag parent items around and click them to expand to show their child items, with efficient operations if you delete or add.
Is there a library that does this and is simple to use? I tried Googling but everyone keeps saying this and that is outdated or inefficient but offer no alternatives.
Or can I just make one myself somehow? Is ItemTouchHelper what I need for expanding and moving stuff around?
Or is this built in somewhere? I'm using the support library.
I spent a long time in order to find a way to implement such a list. Check out my github project:
https://github.com/XxGoliathusxX/LightWeightExpandableDragAndSwipeRecyclerView
If you have any questions: Just ask me ;) Hope I can safe you a lot of time and trouble.
You can try this library. It allows an expandable, draggable and swipeable RecyclerView with many other features.

Any idea if ExpandableListView is going to be deprecated in the near future ?

I hope my question doesn't violate the rules of StackOverFlow. I am writing an android app and want to implement a list view that is expandable. I am aware of expandableLisView and 3rd party libraries of different versions of expandable recycler view such as this or this . Although, I am trying to avoid using libraries and be as native as possible. knowing that recyclerView is more recent and potentially more efficient than listViews, I am afraid that expandableListView gets deprecated at some point in the near future and google comes up with something like that for recycler view.
Just wondering if anyone is aware of such a thing or if expandableListView would be a safe bet to go with. Thanks a lot for your input.

Android Custom GridView with Masonry Logic

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.

Scrollview with paging in android

is there a simple/native way to implement paging/pagination on scrollviews?
By simple, I mean with a short piece of code mainly using classes from Android SDK, like, when programming on iPhone, writing "pagingEnabled = YES".
When I was looking for the topic on the Internet, I saw people putting pieces of code about that matter, but these pieces of code were very large, and I can't help myself to believe Google did put a simple way to do it in their SDK. I also think that the code to implement it could be much easier than what I saw when looking for it. I'm currently working on it, but in the meantime, if anyone know a easier way to do it, I would be delighted to know about it.
Thanks for reading!
I think that there is not a fast solution to do this.
But what you can do is to take the gallery component and override the layout. The gallery component has paging :)
Another solution could be:
Horizontal Pager - https://github.com/ysamlan/horizontalpager
Real View Switcher http://marcreichelt.blogspot.com/2010/09/android-use-realviewswitcher-to-switch.html
Hope this helps...

making custom component in android

I am new in android, I dont have that much of experience. I want to know making a custom component. I followed http://developer.android.com/guide/topics/ui/custom-components.html. But many things are not getting cleared. Recently I visited a link http://code.google.com/p/android-wheel/source/browse/trunk/wheel/src/kankan/wheel/widget/WheelView.java?r=4. There they have made custom component.
Please suggest me a well documented tutorial where I will get a clear picture about making custom component where onMeasure(int,int), onDraw(Canvas) all methods will be used and all the things will be documented well, why we are using this?
Please suggest me such a link or tutorial. I really want to be confident in it.
The question is somewhat unclear. What kind of custom components do you want to make. Just regular views? Viewgroups or perhaps custom adapters? You will probably find plenty of good material if you search more precise.
But to start you of with some:
http://www.anddev.org/creating_custom_views_-_the_togglebutton-t310.html
http://www.anddev.org/advanced-tutorials-f21/custom-views-t1891.html
Since I am a new user I can't post more links.

Categories

Resources