Where is there android: titleCondensed attribute applicable in menu

Can anyone explain to me about this? I couldn't find enough information in the developer documentation. This also applies when the item is shown as an action and a long click on the icon displays a toast containing the title.

+3


source to share


2 answers


In short: it appears when space is pleasant to store.

I took pictures with Galaxy S4 4.4.2.

The first photo is a landscape with only three icons associated with the selection, you can see that a condensed name is used here: enter image description here however, if I don't put it titleCondensed

, it uses title

and it clearly fits: enter image description here

Full is title

used in any other places where space is not an issue, such as a "tooltip" (long press on an action bar icon, internally called a bypass sheet ) or an overflow menu: enter image description here



... and here's some of the code I used (c appcompat-v7

):

<menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto">
    <!-- Possibly more items like "Edit Item" and "Delete Item" below -->
    <item android:id="@+id/action_select_all"
        android:icon="@drawable/ic_action_select_all"
        android:title="Select All"
        android:titleCondensed="All"
        app:showAsAction="ifRoom|withText" />
    <!-- Same for Select None <-> None -->
    <!-- Same for Invert Selection <-> Invert -->
</menu>

      

All of the above is an empirical observation and therefore probably incomplete, but I was curious, so here are the Android code points implementing below:
Note the package internal

, and this is from the framework, not from the support library!

+8


source


http://developer.android.com/guide/topics/resources/menu-resource.html



In simple terms, titleCondensed is the title you want to show when the title bar is too long for the displayed device.

+3


source







All Articles