How To Make List Of Fragments In Android Programmatically? - android

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.

Related

Rendering complex ListView in android

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

How to Create Timeline UI on Android

I want to create android application that read RSS feed from some websites. My application should be like this picture below. I don't know how to create timeline UI like this. Should i use webView to create IU like this, or there's any other approach ?
Take a look at Card UI, this could get your job done.
https://developer.android.com/training/material/lists-cards.html
There is no significance of using a webView for a timeline layout. You would (almost) definitely be using a listView or (even better) recyclerView.
Additionally, to comply with new material design guidelines, you can use cardView. see Creating lists and cards.
These are basic design elements. You should at least be familiar with listView implementations if you intend to create such a UI. Here is a nice tutorial about using a listView.
Vogella - Using lists in Android

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.

Android app with multiple MasterFlow/Activities layouts example?

I know how to change the activity, without use of Master Detail Flow Template but I need to make an app with multiple Master Detail Flow layouts.
I think that a single Master Detail Flow Layout is already a little bit complex and confuse alone, but it must be more confuse when there's necessity of multiple app screens.
Someone knows a good tutorial on this?
I have the same need, did you ever get any response or found the solution? I have a List that is a Menu, with around 10 entries and each entry requires a different activity/screenlayout.
EDIT:
I have found this very good tutorial: http://www.michenux.net/android-fragment-swapping-325.html. After making the needed adjustments for my app, change until 10 different layouts in the detailFragment, based on item selected in masterFragment, it works perfect for me.

Android: Which adapterview and adapter to show a dynamic list of apps

For my thesis I'm trying to do a kind of market similar to the Android market. I did the db in mysql, now I'm thinking about the android client interface. I'm a beginner so i need your help.
I will have on my db a lot of app, I need to do a native app that call the db (there will be php in the middle) and show the list of the app as in the android market, so with a title, a icon, a rating and a cost. All this info are on the mysql db and I think that php will get me back to my phone a xml file with all the info I need.
This is what I suppose, but if for you should be different let me know. For example if the local SQLite should play a role in this (it will definitely have one to share metadata for apps I downloaded)
I read that for dynamic list of stuff it's better to use an adapterview that takes the elements of the list from an adapter, that is a kind of bridge with the datasource. But for example arrayadapter is based on textview only, other on imageviews only and so on...... instead my views are not so simple but are something complex with some images, some textviews, rating and so on.......
So I need to find the right adapterview and the right adapter.
Now for my purpose, for you:
Which adapterview should I use? I was thinking to use listview.
And the harder one, which adapter? Do I need to create a custom one extending the base adapter class or there are some adapters suitable for my purpose?
If textview is the base widget for arrayadapter, which one will be the base for mine? A complex widget so basically a viewgroup?
I read something about cursoradapter, but I don't know what is it and if it's what I'm looking for. If you know what google use for it's market, that would be useful :)
Explanations, examples or links are welcome
Sounds like a custom ListAdapter is what you're looking for. Here's a decent introduction.
you should take a look at aptoide and how it's build Hope it helped
http://www.aptoide.com

Categories

Resources