Android- Contact details UI layout - android

I'm building a contacts app and wanted to know what the best way of building something like the image below(Jessica is not too shabby...) in terms of using a list view, scrollview, etc.
Ideally, all of my data is in the sql database so a cursor adapter wouldn't be an issue. Is it better to have a listview with separators, or a scrollview where you add views. Since all contacts won't have exactly the same information, what can we do to make that? Any ideas would be greatly appreciated.

If you plan to have interactive elements inside of the items (e.g. the message button in the screenshot above) I'd recommend a ScrollView. Actually, since you probably don't have that many items I would again recommend a ScrollView. Then it's justa matter of having a set of layouts that you dynamically add depending on the information you have for the contact.

Related

How to create listview and title (dynamically) in Android programmatically?

I am really confused, which among GridView, Tableview or multiple listview to be used to develop a UI as shown in below image.
I don't know how much list data (categories and its sub categories) is in web. It is dynamically added from wed, and sent to my android app.
Please suggest me, what view is best for developing above UI.
Note: I want to make it programmatically.
Thank you in advance for your co-operation.
Keep in mind that the image you have shown as an example is quite large and such an implementation would make for a cluttered UI on smaller screen sizes. That being said, the example you provided could be achieved in Android by using a GridView. Each major category (Automotive, Jobs, etc.) would be a grid item, with the sub element implemented as either a TextView or even a ListView within the grid item. Something like this:
As both #PedroHawk and #bryan mentioned, you could also use an ExpandableListView; in this scenario, the major categories (Automotive, Jobs, etc.) would be header items and the sub elements would be children of the header. Something like this:
However, with this implementation you would be limited to a one-dimensional list - that is you would not be able to have major categories next to each other as shown in your example.
With both of these implementations (ExpandableListView and GridView) you can dynamically add more elements as you receive data.
Like PedroHawk said, ExpandableListView is an option. But also consider because of the screen size, you may not want to try and port the UI directly over. What about a single ListView with just the main categories and the user can drill down?

How can I make the content of listview be horizontally arrange?

What should I use or do in the listview to make its content horizontally arrange? What I'm trying to do with listview is like a normal table table with header, each row is the information about the employee.I will populate the listview with the data from the database but I don't know how to make it that way that all the information of an employee should be in a row. Is it possible?
try to use 2 webview, one for the header and the other one is for the details,just concatenate the details for each employee. That works for me!
I recently wanted to create a horizontal ListView in Android. However, there was no obvious way to implement this. I ended up using a Gallery instead.
Note that the Gallery is deprecated in API level 16. The documentation points to a couple of other widgets that offer horizontal scrolling features.

Data Entry Activity form

i'm trying to create an activity that looks similar to this (circled in red):
I'm wondering if they're using a Listview to do this?
I also am wondering, how did they do the "reminders" section where it expands and retracts based on how many reminders you put in.
Thanks
I'm wondering if they're using a Listview to do this?
Unlikely. That is probably a GridLayout, perhaps wrapped in a ScrollView.
I also am wondering, how did they do the "reminders" section where it expands and retracts based on how many reminders you put in.
Add more children to the GridLayout in the appropriate positions.

Need to make a table: which is better for performances?

In my app I download from the net some data I need to arrange in a table way.
I already know dimensions: about 26 rows and 6 columns, anyway data can change across subsequent calls so I have to create this table in a dynamic way.
As it is a table I though using a TableLayout (never used before), on the other hand I could simply use a list view, using for the single item a 6 elements linear layout with horizontal orientation.
ListView intrigues me because it is an adapter view (I think I'll store this data in a sqllite db, later) so populating it is quite simple and straightforward, anyway I don't know if it is the best for my problem.
What is your opinion?TableLayout, ListView or other?
When it comes to performance, I think you should use ListView because ListView support Recycling of view and you can check this and this post for more detail regarding Recycling of view.
Hope it helps :)
A ListView is a collection of layouts that are automatically displayed one below the other. The developer adds new items through a piece of code in the Activity. An example is the address book where you have lots of contacts one after the other.
A TableView on the other hand is defined in the layout file and does not only need to contain elements below or above each other but can also arrange elements on the left or on the right. A TableView is exactly what it says: A table with rows and columns.
here's a similar question that might answer what you want to know

Efficiency of Listview with the flexibility of the ScrollView

I am trying to figure out the best approach for a particular UI for a particular data capture application, where I have a bunch of form widgets (EditText's and Spinner's) at the top of a vertical scrolling view, then a number of checked entries (10-200), and then a number of additional widgets at the end.
I am trying to think of the best way to get utilise the efficiency of the ListView (with the view recycling and option of the custom adapter for the checked entries), but the flexibility to include the other widgets before and after the list.
I have eliminated the idea of putting a ListView inside a Scrollview, for the well documented reasons.
I have also considered breaking it into multiple views and using the ViewFlipper, but this does not flow as well for the user experience.
The only other idea I have encountered is to put my non-listview items in as the Listview header and footer. This way I can still use my custom adapter for the listview checked entries, and the rest of the widgets are where I want.
Does this sound like the most efficient and sensible approach? Any comments and advice appreciated.
I have a custom listview with widgets above and below it in my app. ListView without ListActivity
Just put the listview in it's own LinearLayout and it should work perfectly.

Categories

Resources