I need to create a UI that allows the user to rearrange its elements and store the configuration of that arrangement somewhere. And when the user opens the application the UI would load as the user arranged it.
Just like you would rearrange the icons and widgets on the homescreen. Is there a tutorial for that? What approach would you suggest?
Thanks
This question is farly near rearranging items on a ListView. You should check this question:
reordering of listview items by drag and drop using android
Related
I am developing an android app which will allow users to create polls. A user can create a question and provide a set of options.
I wanted to provide a feature in which users can add or remove options dynamically.
I can't decide which layout would be best.
TableLayout - Each row can contain an option.
Vs
RecyclerView - Each item can be an option.
(Note that each option actually would be an EditText View where the user has to enter the option content.)
I have seen people generally use the RecyclerView for very large data sets but for my use case, a user can add a maximum of 5 or 6 options. Apart from that, I'll be using a recycler view to collect the data.
For such a use case, is it a good option to use the RecyclerView or something else?
Please provide suggestions
Definitely RecyclerView.
With a RecyclerView you can easily add and remove items dynamically.
Use the TableLayout if you have a static amount of rows (TableRow), that you declare in XML.
Use RecyclerView even if your rows are such little (5 or 6). By doing that, you will facilitate navigation for user with just one screen.
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?
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.
I'm relatively new to Android development, so bear with me. I'm creating an app that features many calculations and formulas for weather, distance, speed, etc. Anyway, I'm looking to create the main menu with rows of buttons similar to how the iPhone does it, i.e. you press one button row and it takes you to the next page of a rows of buttons.
Sort of like:
Is this done using layouts and controls or a menu?
Your best bet would be to use a list view. I did this where you would have a list of items, similar to your home, About Drupal, Typography, etc., and then when the user clicked on one of those buttons, you would be taken to a detail page, or in Android's case, another Activity. Here is a great tutorial that will show you how to implement the list view:
http://www.ezzylearning.com/tutorial.aspx?tid=1763429
Hope this helps.
I would like to design an item like this that opens a subset of other items when clicked, I have only seen it in other applications I've used, and I can't find any resources on how to create it. Does anyone know how to?
Thanks.
Its not clear if you want to created Nested listviews that look like this
-Item1
-Item2
---Item2A
---Item2B
-Item3
or if you want to open a completely new list when the user clicks on an item.
If you want to use a nested listview look at this question: android nested listview
And if you want to open a new activity, then create a 2nd activity with a listview and open that on an item click
Perhaps you should try to have a look at the ExpandableListView.
Documentation is available from here:
http://developer.android.com/reference/android/widget/ExpandableListView.html
If you wanted to add a ListView that opens another list, you can do it in several ways. I've successfully done it by adding an OnItemClickListener to the ListView and then simply load a new set of data in the ListView and update it using invalidate() or by setting a new Adapter.
You could even add some cool transitions or animations, and create a listener for when the animation is completed. Lots of cool ideas :-)