Component for large choice buttons - android

What type of component is used in samsung s health main window for items (like in attached photo)? I want similar functionality. Main think is that i want to define N number of buttons. And then display it to users. Usually there will be 2 or 3 choises. So, what is best component for this task? I must add some text and maybe an picture.

Related

Android What's the best way to display several layers of varying types of nested data?

I've read several SO posts and gone through some tutorials and now I'm trying to re-create this: http://i.imgur.com/on2xi72.png However, I'm not sure if what I propose to do is the best way to re-create this layout.
Here's what I'm proposing to do:
I'm working with this well nested JSONArray and JSONObject and vice versa API response (example data: https://jsonblob.com/5525b47ae4b0599c1fbd338b). I was thinking that I would create 3 different types of fragments to show the bullet point data. For example, one fragment would display "High Knees .. 25 yards" Another one could be a hyperlink type like in the case of "Shoulder Shrugs", and the final one would display the chart like the one at the bottom of the image. Since the API response separates data by a title like "Warmup" , "Upper Body Circuit", I was going to create a "block" activity that could contain the title and its related fragments/bullet point data. All of these "block" activities separated by the horizontal black lines would then be placed in another "full view" activity that would display stacked top to bottom. This "full view" activity would then be stored in another array because there are different dates to swipe through (if you notice at the top, it says Tuesday). Also, for each of these layers, there could be any type of variation and amount of data depending on the API call made. I hope this makes some sort of sense, haha.
Thank you for reading my post.
You can have only one activity per screen view in an android app, but can have several fragments per activity. Visual separation of your screen sections does not mean you need to have different fragments per sections in your activity. The reason you would want to use separate fragments is to be able to switch out the content of each fragment independently based on some application logic.
However, - if I understand it correctly - in your case, there is no reason why you would want to use multiple fragments per activity, as all your data is going to be changed as a whole based on the user/calendar day. Therefore, you can just use a single activity, or even better, use one fragment in your activity.
For your reference, this CodePath guide on Fragments may help you better understand fragments and how to use them. If you would like to read up on Activities more as well, you can do so on the android developer guides.

Adding dynamic content in Linear Layout

I'm working on an Android app, which when the user taps on an icon, a Layout defined (for now) in the main layout slides up with some information.
The problem is that I have icons of different types, so when one clicks on one type of icon or another, the information in the pop up should be different (there are different objects with different structures behind those icons).
What possibilities do I have? The programmatic way just does not seem elegant enough. Are there any templating frameworks in Android? Please provide some examples, too.
You could sub-class your icons (that means the types that are shown with each icon), like having each one it's own fragment sub-class, an then you can use a different layout on fragment.
Here is more info about Fragments

android dialogs UX experience - two list views or spinners in one dialog

I'm working on one dialog. It should have two listviews either two spinners either one spinner and one listview. The list on items in the second depends on the choice in the first one. And now I have dilemma concerning graphical user interface.
When I put two elements (ex. spinner and listview) in one dialog window it's looks awful and it's difficult for using. How to solve that? What would you recommend? If I use two different dialog windows, it will be difficult to switch between two lists, as I imagine that the user can change few times the selected option in the first list until he/she decides what to select from the second list.
Any suggestion? Perhaps you saw some nice solution in one of apps in the market?
you can either show it in two different dialogs without disturbing the UX
or
Why not try something like This or This
There are a lot of widgets out there (both from android itself and custom ones) that would solve your needs for showing the info. However I think that your problem is not the 2 lists but the dialog.
For a better user experience I recommend using an appearing/sliding-in layout or a prompt screen. An appearing layout is the one that appears below your "change this" title. It's not so disturbing as you can keep using the whole screen, you can add animations, you can customize it a lot to fit your app design... If your space is limited, you can always show a hidden layout containing your views. this method is a little more disturbing so fits better if you are starting a separate action, not filling information as the underlying views.

Android layout design for many menu options

What is the best way to go about designing an Android application that features quite a bit of formulas and conversions? I was thinking that multiple Activities with ListViews sort of like a tree with the leaves being the actual calculations. However, after reading Android design principles it's better to avoid a pure navigational structure and try to reduce the deepness of the app.
For example:
Main Menu
Conversions
Weight
Distance
Distance - Speed - Time
Calculate air speed
Calculate distance traveled
Weather
METAR
TAF
So by the 3rd or 4th screen we've reached the actual individual calculator. Does this make sense? And if it does, is there a better way of designing this (maybe using action bars or tabs)?
By using a very simple UI concept of Expandable Listviews, in which there is more than one child row for each section of the parent row, by tapping on the "Conversions", could expand into sub-rows, likewise for each section as you see fit, and treat that as a Main Menu in a sense of a word, that is, your main application screen.
The nice advantage is that the nesting of the menus in the Android way, is eliminated and can accomodate as many as you wish.
The third or forth screen sounds like it's too deep down the rabbit hole, how about instead having multiple tabs for each "type"?
For example;
[Conversions][Distances][Weather]
If you add an ActionBar to it, you could have a type of filter as the GMAIL app has (where you select the account) and use it to toggle the different "modes" so to speak.
Another approach would be to have it all in one screen, just that you switch the active layout (or perhaps Fragment) via the filter I mentioned above.
Check out the GMAIL app, and you'll see what I mean in terms of the filter. :-)

Android TitleBar / NavBar?

I am not sure what the proper term is, but I am trying to add a "TitleBar" to the top of one of the windows in my App. Much like the Contacts App, I have several Tabs along the top of the screen. When you select an item from the list, it loads the next Activity, but that Activity no longer has the Tabs at the top of the screen.
I don't know if it is called a TitleBar or what. The Contacts App has this TitleBar along the top of the screen when you select a person from the list of Contacts.
I am trying to mimick the Grey Bar that says "George Washington"
The Contacts app is open source (as are most of the core Android system apps). I suggest checking it out and looking at the layout you want to emulate. In general, poking around a lot of that code is a good idea to get a handle on some best practices, or just to borrow a few tricks.
In this particular case, they're using a custom View called ContactHeaderWidget, which is actually a FrameLayout wrapping a TextView and Checkbox (styled to look like a star), along with the photo view (which has some special behavior to bind with the multiple contact source data on click and so on).
If you just want the look and not the functionality, though, just adding a LinearLayout with a GradientDrawable background containing an ImageView, a TextView, and a Checkbox styled as a star to your activity's layout should get you there a lot more easily without requiring custom widgets.

Categories

Resources