Android dynamically load more rows in tableView - android

i have this table with dynamical table-row adding.
What I would like to do is not load the whole table because it sometimes has more than 10.000 rows.
I want to make a dynamically load the table is that possible?

For such thing, you must use ListView instead of TableLayout. Because with ListView, you can implement onScrollListener, with which you can load more iteam as and when required.

list view does have on scroll listener that will listen if you change focus of list view and you use simple logic to find when list view end is reached and respond accordingly

Related

List(with out scroll) inside a RecyclerView row

I want a list inside a recycler view, I don't want nested scroll, what is the best approach for this?
What I am considering now is that dynamically add the inner list rows.
If that is the case, let the adapter hold the whole data for the inner list. The number of list rows in each row of the recycler view row is not fixed.
Please voice your opinions with pros and cons.
NB:- I dont have any code to post since I am working on this.
Inside List View you need to Disable scrolling.
i.e listview.setNestedScrollingEnable(false);

Multiple HeaderView for ListView

I wanted to know that is there any way to have multiple HeaderViews for a ListView or on the other hand i want to implement a ListView with three static rows at top and other rows with an adapter which will loaded from AsyncTask,according to ListView recycling i can't make three first row static by using position in getView() function of my adapter body. is there any suggestion to this issue?
If your data is static and always visible, then just put it outside of your listview, above it. And you should have the effect you need.
I used this Library it was useful for implementing Multiple Header ListView, if the first three rows are static then you can add them statically first above the ListView then set the adapter for the ListView and in this case you don't need to use the library
Wrap three views inside a layout (For example a vertical LinearLayout), and add that layout as the list header.

Irregular Gridview, first row with one colum, rest id the rows with two columns

I'm trying to implement an irregular gridview for my Android app. I've defined the gridview to show 2 columns but I need to show just 1 column at the first row. Is it possible using a DataAdapter?
I don't think you can accomplish this with a gridview. The adapter simple provides the data, but the view decides how to lay it out. If your requirements allow you to make the number of columns constant, then maybe you can use the gridlayout instead. I'm thinking you could try to do you layout like the google currents app.
Gridview and ListView are super useful if you have 1000's of items since it reuses views as it scrolls. If you have lots a items in your grid, then I would probably try to use the GridView or ListView to accomplish your goal. Maybe you have to get your requirement changed. Another option is to use a ListView, but sub-divide each row into 2 columns.

Dynamically add column elements to a Android ListView

After reading Dynamically add elements to a listView Android , I understand clearly how to dynamically add row elements to a listView.
However, I have one idea that how to dynamically add column elements to a listview.
For example, there are 2 columns originally. After I click a button, I would like to add one one more column.
Can anyone provide example code?
Thank for all sharing.
Just add rows dynamically, but make a custom view with two different elements... So there'll be two elements on your every view of row. And first, set first items while seconds are invisible and after clicking button set others... So it'll seem that you're adding column...

Complex table or ListView layout

I need to implement in my android app a component that displays data like in the image bellow:
How I can do this? Behavior(scrolling and other) of this table-component must be as a ListView. Now I have a two-level ListView where "List 1 label" and "List 2 label" are parent nodes. I want place them to left side. Maybe I must use TableLayout where in right column place a ListView?
you can use listview as a main item. on the other side in the getview() method of adapter you can create a dynamic layout depending on the number of items to add to the right side. by going dynamic at runtime depending on the requirement you will be able to generate the ui and place it as a single item. or the other approach you are using is also correct i think, but in that case number of table rows to inflate would get fixed if you are not going for dynamic ui.

Categories

Resources