Android Action Bar Two Line Text Labels - android

Is there a way (perhaps some special character along the lines of non-breaking spaces) that I can force the menu items in my Action Bar to have two line labels? I think this just looks better than long, single-line tab labels...
Thanks,
R.
Edit, additional info: My apologies, I have so far managed to avoid needing the overflow menu, probably because I'm developing for a Nexus 7 with a nice large screen. To clarify, one of my menu tabs (in the action bar proper) is "Restore Defaults", but I think it would look better if it was:
Restore
Defaults
Is there something I can incorporate into my Strings.xml file to force the Action Bar to display the item like that? When I used longer names for all five menu items, "Restore Defaults" DID display on two lines (but it was the only one). Anyway, I know it's possible, just not how to do it on purpose.

Since toadzky does not make an answer of his comment, I will:
Insert a '\n' in the title of your menu item. that should make it wrap.
As soon as he puts it up as an answer, I will delete mine and you can accept his, but this way at least the question can be officially closed.

Related

Material design conventions: toolbar text content

Preface: while this may seem like a question based on personal preference, I am fairly sure there are set guidelines for material layouts, providing rules to adhere to. (I just cant seem to find them)
In order to prepare for an upcoming exam, I've made a simple quiz app for me and my classmates that goes through questions that will likely be asked on said exam. The layout of the main question screen is displayed below.
As you can see, rather than using the toolbar to display a title ("quiz screen") I have used it to display the entire question, and question number. In addition, I've disabled the back button. Now for the question: is this layout, and use of the toolbar specifically, in concordance with the material design guidelines? I have looked through https://www.google.com/design/spec/material-design/introduction.html, where one would expect to find such information, rather extensively, but have found no answer to this question.
Thanks in advance.
As far as I know the toolbar is used to provide hint of what the data in the current screen is about. It should not contain more than more two lines of text.(For two lines of text, use a collapsing toolbar and for a single line use the ordinary toolbar). Coming to your app, I'd suggest you put the question number in the toolbar i.e "Question 3" and the question should be an ordinary textview with about 24sp in text size. Moreover, remove the FAB from the screen and use a flat button instead. The FAB button must not be abused

Android Spinners with different Display text from the list values

I'm playing around with Android spinners. I'm not 100% sure if I can get the behavior I want using a spinner, but it's the most obvious choice that comes to mind.
I need something of a dropdown view, the title of which says "x of y selected".
The options in the dropdown would look like:
-All
-None
-Special items only
On clicking one of the dropdown items, the title is reconfigured such that 'x' changes.
It would be ideal to use a spinner, but somehow, it seems that android puts in the first value of the spinner to always be the first values in the list of strings you pass it, and I clearly don't want the title item to be shown in the dropdown list for my case.
Another approach that I came across was to perhaps use a button with a popup with these items in the popup.
Would that be a better approach, or can I actually achieve the behavior using a spinner, or is there another view that would better serve my purpose?
I'm going to redirect to this post, after a lot of searching I found what I was looking for:
How to hide one item in an Android Spinner
The answer by Aebsubis, and make sure to set the text view height to 0. I'll update this answer with more code, once I'm done with tweaking it for my purposes.

Android drop down menu

How do we create a drop down menu in android which is not focusable when we select an item from drop down list?
Previously I created a drop-down menu which is combo box. Everytime I selected an item from drop down list, the drop down menu is focusable. It shouldn't. Which is fixed by changing it to Option menu. I got an advice from this thread Combo box not focusable
Now, the problem is, Option menu doesn't work in android. It works perfectly on IOS only.
Note: I am developing using Livecode.
You're not supposed to use menu buttons on mobile devices. It is bad GUI design.
This is an example for Android:
global gCurrentSelectedValue
on mouseUp
put "One,Two,Three,Four,Five,Size,Seve,Eight,Nine,Then" into myOptionList
put 4 into gCurrentSelectedValue // sometimes you need more lines for this
mobilePick myOptionList,gCurrentSelectedValue,"checkmark","cancelDone"
put the result into rslt
if rslt > 0 then
put rslt into gCurrentSelectedValue
// do something with gCurrentSelectedValue
end if
end mouseUp
Spinners are available in LC:
http://forums.runrev.com/phpBB2/viewtopic.php?f=53&t=14543
But they may be overkill for your needs. Have you thought about using a set of grouped buttons? Combined with a "move" command you can add the animation.
Simon

Drop Down Text Display using Android Action Bar

Can anyone point me to an example of displaying text in a view that "unrolls" down from the Android Action bar when the corresponding item is touched?
In my case, I want to display GPS state information such number of visible satellites, but that's not really important, it's just text data. The distinction, in this case, is that I don't want to display a drop-down menu, just text data -- that changes over time, but has no function.
I'll keep searching, but at this point, I'm not even sure what to use for a search phrase.
Thanks,
R.
I got some assistance at one point with how to add a spinner to my ActionBar. The spinner display DOES allow me to temporarily drop below the "normal" Action Bar space, but I don't know how to fix its label at the top. Does this make any sense? If could use a spinner without losing the Action Bar label, it would probably be perfect. Does anybody know how I might do that? Does anybody think I probably should have opened a separate case??
Thanks, R.
Try this...
View customeView = getLayoutInflater().inflate(R.layout.custom_action_bar_layout, null);
getActionBar().setDisplayShowCustomEnabled(true)
getActionBar().setCustomView(addView);
Also refer: https://groups.google.com/forum/#!msg/android-developers/mDUJ1yYcVPQ/ATwHNLg1OA0J

Honeycomb launcher title truncated

I am working on my first honeycomb application. The name of the app is fairly long and the launcher title is getting truncated/faded. I'm having trouble finding out whether it's possible to break this into multiple lines so that the entire title is visible. Anyone know?
Thank you.
AFAIK you cannot control how the application label is displayed by the Launcher, that is up the Launcher.
So you'll either have to shorten the name you use as the label for the Launcher, or accept the fading/truncating of your label.
You could try adding a \n at the point where you want a line-break in your String, but I doubt this would have any effect.
Unfortunately there is not a way to prevent truncation of the action bar title. The solution is to make the action bar title short.

Categories

Resources