1bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell/* 2bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Copyright (C) 2012 The Android Open Source Project 3bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 4bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Licensed under the Apache License, Version 2.0 (the "License"); 5bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * you may not use this file except in compliance with the License. 6bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * You may obtain a copy of the License at 7bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 8bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * http://www.apache.org/licenses/LICENSE-2.0 9bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 10bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Unless required by applicable law or agreed to in writing, software 11bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * distributed under the License is distributed on an "AS IS" BASIS, 12bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * See the License for the specific language governing permissions and 14bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * limitations under the License. 15bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 16bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 17ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikaspackage androidx.appcompat.app; 18bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 19ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikasimport static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; 208e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas 21bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powellimport android.content.Context; 2249c78900da0d43140fb602431fb93212bd7f6c70Chris Banesimport android.content.res.Configuration; 23bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powellimport android.content.res.TypedArray; 24bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powellimport android.graphics.drawable.Drawable; 253de8a4e8305507475d7890205184946a25cf45e7Aurimas Liutikasimport android.util.AttributeSet; 263de8a4e8305507475d7890205184946a25cf45e7Aurimas Liutikasimport android.view.Gravity; 273de8a4e8305507475d7890205184946a25cf45e7Aurimas Liutikasimport android.view.KeyEvent; 283de8a4e8305507475d7890205184946a25cf45e7Aurimas Liutikasimport android.view.View; 293de8a4e8305507475d7890205184946a25cf45e7Aurimas Liutikasimport android.view.ViewGroup; 303de8a4e8305507475d7890205184946a25cf45e7Aurimas Liutikasimport android.view.Window; 313de8a4e8305507475d7890205184946a25cf45e7Aurimas Liutikasimport android.widget.SpinnerAdapter; 323de8a4e8305507475d7890205184946a25cf45e7Aurimas Liutikas 33ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikasimport androidx.annotation.DrawableRes; 34ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikasimport androidx.annotation.IntDef; 35ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikasimport androidx.annotation.NonNull; 36ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikasimport androidx.annotation.Nullable; 37ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikasimport androidx.annotation.RestrictTo; 38ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikasimport androidx.annotation.StringRes; 39ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikasimport androidx.appcompat.R; 40ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikasimport androidx.appcompat.view.ActionMode; 413de8a4e8305507475d7890205184946a25cf45e7Aurimas Liutikasimport androidx.core.view.GravityCompat; 423de8a4e8305507475d7890205184946a25cf45e7Aurimas Liutikasimport androidx.fragment.app.Fragment; 433de8a4e8305507475d7890205184946a25cf45e7Aurimas Liutikasimport androidx.fragment.app.FragmentTransaction; 44bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 4549c78900da0d43140fb602431fb93212bd7f6c70Chris Banesimport java.lang.annotation.Retention; 4649c78900da0d43140fb602431fb93212bd7f6c70Chris Banesimport java.lang.annotation.RetentionPolicy; 4749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes 48bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell/** 4913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * A primary toolbar within the activity that may display the activity title, application-level 5013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation affordances, and other interactive items. 5120ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns * 52d25af35061a9f20d59b25329d613c62c20184dadChris Banes * <p>The action bar appears at the top of an activity's window when the activity uses the 53d25af35061a9f20d59b25329d613c62c20184dadChris Banes * AppCompat's {@link R.style#Theme_AppCompat AppCompat} theme (or one of its descendant themes). 5413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * You may otherwise add the action bar by calling {@link 55d25af35061a9f20d59b25329d613c62c20184dadChris Banes * AppCompatDelegate#requestWindowFeature(int) requestFeature(FEATURE_SUPPORT_ACTION_BAR)} or by 56a777694569b333a4459606db6bc94a9e80fd25f3Chris Banes * declaring it in a custom theme with the 57a777694569b333a4459606db6bc94a9e80fd25f3Chris Banes * {@link R.styleable#AppCompatTheme_windowActionBar windowActionBar} property.</p> 589dcd2e58138ca4eb4b18f80b50e8979329e859d6Scott Main * 59d25af35061a9f20d59b25329d613c62c20184dadChris Banes * <p>The action bar may be represented by any Toolbar widget within the application layout. 60d25af35061a9f20d59b25329d613c62c20184dadChris Banes * The application may signal to the Activity which Toolbar should be treated as the Activity's 61d25af35061a9f20d59b25329d613c62c20184dadChris Banes * action bar. Activities that use this feature should use one of the supplied 62d25af35061a9f20d59b25329d613c62c20184dadChris Banes * <code>.NoActionBar</code> themes, set the 63a777694569b333a4459606db6bc94a9e80fd25f3Chris Banes * {@link R.styleable#AppCompatTheme_windowActionBar windowActionBar} attribute to 64a777694569b333a4459606db6bc94a9e80fd25f3Chris Banes * <code>false</code> or otherwise not request the window feature.</p> 6520ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns * 66d25af35061a9f20d59b25329d613c62c20184dadChris Banes * <p>If your activity has an options menu, you can make select items accessible directly from the 67d25af35061a9f20d59b25329d613c62c20184dadChris Banes * action bar as "action items". You can also modify various characteristics of the action bar or 68d25af35061a9f20d59b25329d613c62c20184dadChris Banes * remove it completely.</p> 6913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 70d25af35061a9f20d59b25329d613c62c20184dadChris Banes * <p>The navigation button (formerly "Home") takes over the space previously occupied by the 71d25af35061a9f20d59b25329d613c62c20184dadChris Banes * application icon. Apps wishing to express a stronger branding should use their brand colors 72d25af35061a9f20d59b25329d613c62c20184dadChris Banes * heavily in the action bar and other application chrome or use a {@link #setLogo(int) logo} 7313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * in place of their standard title text.</p> 7413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 75bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <p>From your activity, you can retrieve an instance of {@link ActionBar} by calling {@link 76d25af35061a9f20d59b25329d613c62c20184dadChris Banes * AppCompatActivity#getSupportActionBar()} getSupportActionBar()}.</p> 7720ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns * 78bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <p>In some cases, the action bar may be overlayed by another bar that enables contextual actions, 79d25af35061a9f20d59b25329d613c62c20184dadChris Banes * using an {@link ActionMode}. For example, when the user selects one or more items in 8013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * your activity, you can enable an action mode that offers actions specific to the selected 8113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * items, with a UI that temporarily replaces the action bar. Although the UI may occupy the 82d25af35061a9f20d59b25329d613c62c20184dadChris Banes * same space, the {@link ActionMode} APIs are distinct and independent from those for 8313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link ActionBar}.</p> 8420ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns * 85bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <div class="special reference"> 86bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <h3>Developer Guides</h3> 87bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <p>For information about how to use the action bar, including how to add action items, navigation 88bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * modes and more, read the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action 8913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Bar</a> developer guide.</p> 90bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * </div> 91bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 92bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powellpublic abstract class ActionBar { 9320ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns 94b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye /** @hide */ 958e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 96b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye @Retention(RetentionPolicy.SOURCE) 9713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes @IntDef({NAVIGATION_MODE_STANDARD, NAVIGATION_MODE_LIST, NAVIGATION_MODE_TABS}) 9813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public @interface NavigationMode {} 99b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye 100bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 10113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Standard navigation mode. Consists of either a logo or icon 10213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * and title text with an optional subtitle. Clicking any of these elements 10313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * will dispatch onOptionsItemSelected to the host Activity with 10413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * a MenuItem with item ID android.R.id.home. 10513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 10613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 10713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 10813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 10913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 110bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 111d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 112bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public static final int NAVIGATION_MODE_STANDARD = 0; 113bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 114bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 11513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * List navigation mode. Instead of static title text this mode 11613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * presents a list menu for navigation within the activity. 11713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * e.g. this might be presented to the user as a dropdown list. 11813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 11913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 12013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 12113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 12213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 123bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 124d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 125bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public static final int NAVIGATION_MODE_LIST = 1; 126bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 127bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 12813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Tab navigation mode. Instead of static title text this mode 12913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * presents a series of tabs for navigation within the activity. 13013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 13113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 13213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 13313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 13413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 135bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 136d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 137bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public static final int NAVIGATION_MODE_TABS = 2; 138bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 139b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye /** @hide */ 1408e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 141b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye @IntDef(flag=true, value={ 142b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye DISPLAY_USE_LOGO, 143b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye DISPLAY_SHOW_HOME, 144b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye DISPLAY_HOME_AS_UP, 145b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye DISPLAY_SHOW_TITLE, 146b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye DISPLAY_SHOW_CUSTOM 147b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye }) 148b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye @Retention(RetentionPolicy.SOURCE) 14913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public @interface DisplayOptions {} 150b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye 151bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 15213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Use logo instead of icon if available. This flag will cause appropriate 15313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation modes to use a wider logo in place of the standard icon. 154bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 155bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int) 156bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 157bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 15850b45b25e10ddbfd726b91910e00bce6a1c63904Aurimas Liutikas public static final int DISPLAY_USE_LOGO = android.app.ActionBar.DISPLAY_USE_LOGO; 159bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 160bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 16113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Show 'home' elements in this action bar, leaving more space for other 16213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation elements. This includes logo and icon. 163bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 164bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int) 165bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 166bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 16750b45b25e10ddbfd726b91910e00bce6a1c63904Aurimas Liutikas public static final int DISPLAY_SHOW_HOME = android.app.ActionBar.DISPLAY_SHOW_HOME; 168bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 169bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 17013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Display the 'home' element such that it appears as an 'up' affordance. 17113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * e.g. show an arrow to the left indicating the action that will be taken. 172bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 17313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set this flag if selecting the 'home' button in the action bar to return 17413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * up by a single level in your UI rather than back to the top level or front page. 175bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 17613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>Setting this option will implicitly enable interaction with the home/up 17713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * button. See {@link #setHomeButtonEnabled(boolean)}. 178bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 179bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int) 180bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 181bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 18250b45b25e10ddbfd726b91910e00bce6a1c63904Aurimas Liutikas public static final int DISPLAY_HOME_AS_UP = android.app.ActionBar.DISPLAY_HOME_AS_UP; 183bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 184bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 185bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Show the activity title and subtitle, if present. 186bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 187bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setTitle(CharSequence) 188bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setTitle(int) 189bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setSubtitle(CharSequence) 190bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setSubtitle(int) 191bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int) 192bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 193bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 19450b45b25e10ddbfd726b91910e00bce6a1c63904Aurimas Liutikas public static final int DISPLAY_SHOW_TITLE = android.app.ActionBar.DISPLAY_SHOW_TITLE; 195bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 196bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 197bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Show the custom view if one has been set. 19820ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns * 199bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setCustomView(View) 200bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int) 201bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 202bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 20350b45b25e10ddbfd726b91910e00bce6a1c63904Aurimas Liutikas public static final int DISPLAY_SHOW_CUSTOM = android.app.ActionBar.DISPLAY_SHOW_CUSTOM; 204bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 205bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 20613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the action bar into custom navigation mode, supplying a view 20713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * for custom navigation. 208bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 20913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Custom navigation views appear between the application icon and 21013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * any action buttons and may use any space available there. Common 21113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * use cases for custom navigation views might include an auto-suggesting 21213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * address bar for a browser or other navigation mechanisms that do not 213bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * translate well to provided navigation modes. 214bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 215bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param view Custom navigation view to place in the ActionBar. 216bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 217bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setCustomView(View view); 218bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 219bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 22013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the action bar into custom navigation mode, supplying a view 22113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * for custom navigation. 222bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 22313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>Custom navigation views appear between the application icon and 22413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * any action buttons and may use any space available there. Common 22513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * use cases for custom navigation views might include an auto-suggesting 22613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * address bar for a browser or other navigation mechanisms that do not 227bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * translate well to provided navigation modes.</p> 228bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 22913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>The display option {@link #DISPLAY_SHOW_CUSTOM} must be set for 23013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * the custom view to be displayed.</p> 231bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 23213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param view Custom navigation view to place in the ActionBar. 233bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param layoutParams How this custom view should layout in the bar. 23413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 235bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 236bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 237bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setCustomView(View view, LayoutParams layoutParams); 238bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 239bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 24013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the action bar into custom navigation mode, supplying a view 24113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * for custom navigation. 242bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 24313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>Custom navigation views appear between the application icon and 24413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * any action buttons and may use any space available there. Common 24513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * use cases for custom navigation views might include an auto-suggesting 24613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * address bar for a browser or other navigation mechanisms that do not 247bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * translate well to provided navigation modes.</p> 248bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 24913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>The display option {@link #DISPLAY_SHOW_CUSTOM} must be set for 25013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * the custom view to be displayed.</p> 251bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 252bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param resId Resource ID of a layout to inflate into the ActionBar. 25313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 254bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 255bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 25613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public abstract void setCustomView(int resId); 257bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 258bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 25913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the icon to display in the 'home' section of the action bar. 26013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * The action bar will use an icon specified by its style or the 26113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * activity icon by default. 262bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 26313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Whether the home section shows an icon or logo is controlled 26413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * by the display option {@link #DISPLAY_USE_LOGO}. 265bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 266bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param resId Resource ID of a drawable to show as an icon. 26713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 268bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayUseLogoEnabled(boolean) 269bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayShowHomeEnabled(boolean) 270bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 271b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye public abstract void setIcon(@DrawableRes int resId); 272bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 273bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 27413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the icon to display in the 'home' section of the action bar. 27513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * The action bar will use an icon specified by its style or the 27613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * activity icon by default. 277bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 27813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Whether the home section shows an icon or logo is controlled 27913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * by the display option {@link #DISPLAY_USE_LOGO}. 280bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 281bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param icon Drawable to show as an icon. 28213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 283bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayUseLogoEnabled(boolean) 284bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayShowHomeEnabled(boolean) 285bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 286bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setIcon(Drawable icon); 287bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 288bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 28913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the logo to display in the 'home' section of the action bar. 29013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * The action bar will use a logo specified by its style or the 29113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * activity logo by default. 292bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 29313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Whether the home section shows an icon or logo is controlled 29413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * by the display option {@link #DISPLAY_USE_LOGO}. 295bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 296bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param resId Resource ID of a drawable to show as a logo. 29713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 298bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayUseLogoEnabled(boolean) 299bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayShowHomeEnabled(boolean) 300bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 301b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye public abstract void setLogo(@DrawableRes int resId); 302bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 303bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 30413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the logo to display in the 'home' section of the action bar. 30513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * The action bar will use a logo specified by its style or the 30613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * activity logo by default. 307bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 30813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Whether the home section shows an icon or logo is controlled 30913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * by the display option {@link #DISPLAY_USE_LOGO}. 310bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 311bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param logo Drawable to show as a logo. 31213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 313bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayUseLogoEnabled(boolean) 314bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayShowHomeEnabled(boolean) 315bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 316bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setLogo(Drawable logo); 317bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 318bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 319bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Set the adapter and navigation callback for list navigation mode. 320bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 32113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * The supplied adapter will provide views for the expanded list as well as 32213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * the currently selected item. (These may be displayed differently.) 323bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 32413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * The supplied OnNavigationListener will alert the application when the user 32513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * changes the current list selection. 326bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 32713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param adapter An adapter that will provide views both to display 32813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * the current navigation selection and populate views 32913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * within the dropdown navigation menu. 33013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param callback An OnNavigationListener that will receive events when the user 33113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * selects a navigation item. 33213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 33313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 33413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 33513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 33613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 337bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 338d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 339bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setListNavigationCallbacks(SpinnerAdapter adapter, 340bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell OnNavigationListener callback); 341bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 342bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 343bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Set the selected navigation item in list or tabbed navigation modes. 344bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 345bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param position Position of the item to select. 34613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 34713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 34813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 34913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 35013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 351bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 352d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 353bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setSelectedNavigationItem(int position); 354bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 355bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 356bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Get the position of the selected navigation item in list or tabbed navigation modes. 357bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 358bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return Position of the selected item. 35913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 36013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 36113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 36213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 36313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 364bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 365d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 366bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract int getSelectedNavigationIndex(); 367bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 368bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 369bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Get the number of navigation items present in the current navigation mode. 370bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 371bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return Number of navigation items. 37213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 37313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 37413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 37513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 37613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 377bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 378d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 379bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract int getNavigationItemCount(); 380bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 381bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 38213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the action bar's title. This will only be displayed if 38313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link #DISPLAY_SHOW_TITLE} is set. 384bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 385bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param title Title to set 38613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 387bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setTitle(int) 388bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 389bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 390bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setTitle(CharSequence title); 391bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 392bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 39313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the action bar's title. This will only be displayed if 39413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link #DISPLAY_SHOW_TITLE} is set. 395bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 396bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param resId Resource ID of title string to set 39713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 398bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setTitle(CharSequence) 399bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 400bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 401b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye public abstract void setTitle(@StringRes int resId); 402bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 403bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 40413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the action bar's subtitle. This will only be displayed if 40513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link #DISPLAY_SHOW_TITLE} is set. Set to null to disable the 40613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * subtitle entirely. 407bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 408bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param subtitle Subtitle to set 40913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 410bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setSubtitle(int) 411bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 412bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 41313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public abstract void setSubtitle(CharSequence subtitle); 414bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 415bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 41613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the action bar's subtitle. This will only be displayed if 41713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link #DISPLAY_SHOW_TITLE} is set. 418bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 419bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param resId Resource ID of subtitle string to set 42013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 421bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setSubtitle(CharSequence) 422bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 423bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 42413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public abstract void setSubtitle(int resId); 425bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 426bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 42713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set display options. This changes all display option bits at once. To change 42813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * a limited subset of display options, see {@link #setDisplayOptions(int, int)}. 429bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 43013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param options A combination of the bits defined by the DISPLAY_ constants 43113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * defined in ActionBar. 432bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 433b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye public abstract void setDisplayOptions(@DisplayOptions int options); 434bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 435bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 43613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set selected display options. Only the options specified by mask will be changed. 43713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * To change all display option bits at once, see {@link #setDisplayOptions(int)}. 438bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 43913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>Example: setDisplayOptions(0, DISPLAY_SHOW_HOME) will disable the 44013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link #DISPLAY_SHOW_HOME} option. 44113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * setDisplayOptions(DISPLAY_SHOW_HOME, DISPLAY_SHOW_HOME | DISPLAY_USE_LOGO) 44213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * will enable {@link #DISPLAY_SHOW_HOME} and disable {@link #DISPLAY_USE_LOGO}. 443bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 44413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param options A combination of the bits defined by the DISPLAY_ constants 44513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * defined in ActionBar. 44613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param mask A bit mask declaring which display options should be changed. 447bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 44813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public abstract void setDisplayOptions(@DisplayOptions int options, @DisplayOptions int mask); 449bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 450bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 45113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set whether to display the activity logo rather than the activity icon. 45213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * A logo is often a wider, more detailed image. 453bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 454bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <p>To set several display options at once, see the setDisplayOptions methods. 455bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 456bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param useLogo true to use the activity logo, false to use the activity icon. 45713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 458bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int) 459bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 460bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 461bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setDisplayUseLogoEnabled(boolean useLogo); 462bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 463bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 46413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set whether to include the application home affordance in the action bar. 46513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Home is presented as either an activity icon or logo. 466bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 467bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <p>To set several display options at once, see the setDisplayOptions methods. 468bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 469bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param showHome true to show home, false otherwise. 47013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 471bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int) 472bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 473bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 474bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setDisplayShowHomeEnabled(boolean showHome); 475bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 476bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 47713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set whether home should be displayed as an "up" affordance. 47813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set this to true if selecting "home" returns up by a single level in your UI 47913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * rather than back to the top level or front page. 480bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 481bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <p>To set several display options at once, see the setDisplayOptions methods. 482bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 48313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param showHomeAsUp true to show the user that selecting home will return one 48413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * level up rather than to the top level of the app. 48513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 486bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int) 487bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 488bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 489bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setDisplayHomeAsUpEnabled(boolean showHomeAsUp); 490bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 491bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 492bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Set whether an activity title/subtitle should be displayed. 493bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 494bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <p>To set several display options at once, see the setDisplayOptions methods. 495bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 496bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param showTitle true to display a title/subtitle if present. 497bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int) 498bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 499bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 500bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setDisplayShowTitleEnabled(boolean showTitle); 501bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 502bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 503bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Set whether a custom view should be displayed, if set. 504bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 505bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <p>To set several display options at once, see the setDisplayOptions methods. 506bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 50713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param showCustom true if the currently set custom view should be displayed, false otherwise. 50813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 509bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int) 510bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setDisplayOptions(int, int) 511bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 512bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void setDisplayShowCustomEnabled(boolean showCustom); 513bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 514bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 51513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the ActionBar's background. This will be used for the primary 51613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * action bar. 517bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 518bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param d Background drawable 519bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setStackedBackgroundDrawable(Drawable) 520bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setSplitBackgroundDrawable(Drawable) 521bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 52213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public abstract void setBackgroundDrawable(@Nullable Drawable d); 523bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 524bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 52513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the ActionBar's stacked background. This will appear 52613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * in the second row/stacked bar on some devices and configurations. 527bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 528bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param d Background drawable for the stacked row 529bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 53013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public void setStackedBackgroundDrawable(Drawable d) { } 531bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 532bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 53313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the ActionBar's split background. This will appear in 53413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * the split action bar containing menu-provided action buttons 53513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * on some devices and configurations. 536bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <p>You can enable split action bar with {@link android.R.attr#uiOptions} 537bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 538bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param d Background drawable for the split bar 539bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 54013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public void setSplitBackgroundDrawable(Drawable d) { } 541bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 542bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 543bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current custom view. 544bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 545bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract View getCustomView(); 546bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 547bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 54813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Returns the current ActionBar title in standard mode. 54913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Returns null if {@link #getNavigationMode()} would not return 55013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link #NAVIGATION_MODE_STANDARD}. 551bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 552bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current ActionBar title or null. 553bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 554b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye @Nullable 555bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract CharSequence getTitle(); 556bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 557bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 55813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Returns the current ActionBar subtitle in standard mode. 55913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Returns null if {@link #getNavigationMode()} would not return 56013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link #NAVIGATION_MODE_STANDARD}. 561bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 562bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current ActionBar subtitle or null. 563bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 564b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye @Nullable 565bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract CharSequence getSubtitle(); 566bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 567bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 568bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Returns the current navigation mode. The result will be one of: 56913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <ul> 57013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <li>{@link #NAVIGATION_MODE_STANDARD}</li> 571bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <li>{@link #NAVIGATION_MODE_LIST}</li> 57213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <li>{@link #NAVIGATION_MODE_TABS}</li> 57313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * </ul> 574bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 575bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current navigation mode. 57613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 57713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 57813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 57913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 58013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 581bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 582d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 583b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye @NavigationMode 584bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract int getNavigationMode(); 585bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 586bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 587bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Set the current navigation mode. 588bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 589bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param mode The new mode to set. 590bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #NAVIGATION_MODE_STANDARD 591bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #NAVIGATION_MODE_LIST 592bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #NAVIGATION_MODE_TABS 59313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 59413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 59513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 59613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 59713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 598bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 599d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 600b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye public abstract void setNavigationMode(@NavigationMode int mode); 601bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 602bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 603bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current set of display options. 604bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 605b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye @DisplayOptions 606bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract int getDisplayOptions(); 607bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 608bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 60913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Create and return a new {@link Tab}. 61013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * This tab will not be included in the action bar until it is added. 611bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 612bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return A new Tab 61313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 614bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #addTab(Tab) 61513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 61613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 61713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 61813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 61913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 620bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 621d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 622bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract Tab newTab(); 623bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 624bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 62513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Add a tab for use in tabbed navigation mode. The tab will be added at the end of the list. 62613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * If this is the first tab to be added it will become the selected tab. 627bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 628bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param tab Tab to add 62913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 63013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 63113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 63213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 63313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 634bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 635d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 636bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void addTab(Tab tab); 637bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 638bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 639bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Add a tab for use in tabbed navigation mode. The tab will be added at the end of the list. 640bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 64113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param tab Tab to add 642bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param setSelected True if the added tab should become the selected tab. 64313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 64413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 64513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 64613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 64713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 648bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 649d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 650bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void addTab(Tab tab, boolean setSelected); 651bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 652bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 653bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Add a tab for use in tabbed navigation mode. The tab will be inserted at 65413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <code>position</code>. If this is the first tab to be added it will become 65513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * the selected tab. 656bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 65713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param tab The tab to add 658bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param position The new position of the tab 65913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 66013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 66113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 66213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 66313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 664bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 665d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 666bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void addTab(Tab tab, int position); 667bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 668bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 669c9a859537b0871f84afeeb706a5b425fe3f2b4ddAurimas Liutikas * Add a tab for use in tabbed navigation mode. The tab will be inserted at 670bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <code>position</code>. 671bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 67213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param tab The tab to add 67313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param position The new position of the tab 674bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param setSelected True if the added tab should become the selected tab. 67513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 67613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 67713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 67813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 67913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 680bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 681d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 682bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void addTab(Tab tab, int position, boolean setSelected); 683bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 684bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 68513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Remove a tab from the action bar. If the removed tab was selected it will be deselected 68613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * and another tab will be selected if present. 687bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 688bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param tab The tab to remove 68913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 69013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 69113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 69213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 69313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 694bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 695d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 696bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void removeTab(Tab tab); 697bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 698bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 69913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Remove a tab from the action bar. If the removed tab was selected it will be deselected 70013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * and another tab will be selected if present. 701bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 702bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param position Position of the tab to remove 70313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 70413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 70513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 70613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 70713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 708bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 709d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 710bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void removeTabAt(int position); 711bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 712bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 713bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Remove all tabs from the action bar and deselect the current tab. 71413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 71513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 71613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 71713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 71813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 719bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 720d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 721bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void removeAllTabs(); 722bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 723bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 724bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Select the specified tab. If it is not a child of this action bar it will be added. 725bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 726bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * <p>Note: If you want to select by index, use {@link #setSelectedNavigationItem(int)}.</p> 727bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 728bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param tab Tab to select 72913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 73013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 73113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 73213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 73313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 734bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 735d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 736bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void selectTab(Tab tab); 737bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 738bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 73913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Returns the currently selected tab if in tabbed navigation mode and there is at least 74013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * one tab present. 741bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 742bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The currently selected tab or null 74313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 74413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 74513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 74613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 74713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 748bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 749d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 750b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye @Nullable 751bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract Tab getSelectedTab(); 752bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 753bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 754bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Returns the tab at the specified index. 755bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 756bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param index Index value in the range 0-get 75713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @return 75813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 75913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 76013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 76113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 76213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 763bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 764d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 765bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract Tab getTabAt(int index); 766bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 767bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 768bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Returns the number of tabs currently registered with the action bar. 76920ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns * 770bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return Tab count 77113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 77213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 77313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 77413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 77513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 776bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 777d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 778bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract int getTabCount(); 779bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 780bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 781bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Retrieve the current height of the ActionBar. 782bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 783bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The ActionBar's height 784bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 785bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract int getHeight(); 786bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 787bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 78813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Show the ActionBar if it is not currently showing. 78913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * If the window hosting the ActionBar does not have the feature 79013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link Window#FEATURE_ACTION_BAR_OVERLAY} it will resize application 791bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * content to fit the new space available. 792bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 79313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>If you are hiding the ActionBar through 79413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link View#SYSTEM_UI_FLAG_FULLSCREEN View.SYSTEM_UI_FLAG_FULLSCREEN}, 79513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * you should not call this function directly. 796bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 797bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void show(); 798bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 799bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 80013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Hide the ActionBar if it is currently showing. 80113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * If the window hosting the ActionBar does not have the feature 80213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link Window#FEATURE_ACTION_BAR_OVERLAY} it will resize application 80313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * content to fit the new space available. 804bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 80513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>Instead of calling this function directly, you can also cause an 80613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * ActionBar using the overlay feature to hide through 80713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link View#SYSTEM_UI_FLAG_FULLSCREEN View.SYSTEM_UI_FLAG_FULLSCREEN}. 80813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Hiding the ActionBar through this system UI flag allows you to more 80913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * seamlessly hide it in conjunction with other screen decorations. 810bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 811bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void hide(); 812bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 813bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 814bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return <code>true</code> if the ActionBar is showing, <code>false</code> otherwise. 815bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 816bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract boolean isShowing(); 817bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 818bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 819bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Add a listener that will respond to menu visibility change events. 820bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 821bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param listener The new listener to add 822bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 823bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void addOnMenuVisibilityListener(OnMenuVisibilityListener listener); 824bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 825bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 82613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Remove a menu visibility listener. This listener will no longer receive menu 82713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * visibility change events. 828bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 829bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param listener A listener to remove that was previously added 830bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 831bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void removeOnMenuVisibilityListener(OnMenuVisibilityListener listener); 832bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 833bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 83413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Enable or disable the "home" button in the corner of the action bar. (Note that this 835c9a859537b0871f84afeeb706a5b425fe3f2b4ddAurimas Liutikas * is the application home/up affordance on the action bar, not the system wide home 83613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * button.) 837bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 83813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>This defaults to true for packages targeting < API 14. For packages targeting 83913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * API 14 or greater, the application should call this method to enable interaction 84013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * with the home/up affordance. 841bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 84213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>Setting the {@link #DISPLAY_HOME_AS_UP} display option will automatically enable 84313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * the home button. 844bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 845bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param enabled true to enable the home button, false to disable the home button. 846bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 84713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public void setHomeButtonEnabled(boolean enabled) { } 848bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 849bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 85013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Returns a {@link Context} with an appropriate theme for creating views that 85113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * will appear in the action bar. If you are inflating or instantiating custom views 85213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * that will appear in an action bar, you should use the Context returned by this method. 85313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * (This includes adapters used for list navigation mode.) 85413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * This will ensure that views contrast properly against the action bar. 855bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 856bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return A themed Context for creating views 857bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 85820ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns public Context getThemedContext() { 85920ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns return null; 86020ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns } 861bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 862bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 86313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Returns true if the Title field has been truncated during layout for lack 86413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * of available space. 86513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 86613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @return true if the Title field has been truncated 86713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @hide pending API approval 86813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes */ 8698e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 87013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public boolean isTitleTruncated() { return false; } 87113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 87213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** 873f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * Set an alternate drawable to display next to the icon/logo/title 874f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * when {@link #DISPLAY_HOME_AS_UP} is enabled. This can be useful if you are using 875f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * this mode to display an alternate selection for up navigation, such as a sliding drawer. 876f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 877f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * <p>If you pass <code>null</code> to this method, the default drawable from the theme 878f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * will be used.</p> 879f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 880f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * <p>If you implement alternate or intermediate behavior around Up, you should also 881f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * call {@link #setHomeActionContentDescription(int) setHomeActionContentDescription()} 882f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * to provide a correct description of the action for accessibility support.</p> 883f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 884f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @param indicator A drawable to use for the up indicator, or null to use the theme's default 885f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 886f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @see #setDisplayOptions(int, int) 887f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @see #setDisplayHomeAsUpEnabled(boolean) 888f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @see #setHomeActionContentDescription(int) 889f4a93d160fc696de65e103e7e078106ea8f818faChris Banes */ 890b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye public void setHomeAsUpIndicator(@Nullable Drawable indicator) {} 891f4a93d160fc696de65e103e7e078106ea8f818faChris Banes 892f4a93d160fc696de65e103e7e078106ea8f818faChris Banes /** 893f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * Set an alternate drawable to display next to the icon/logo/title 894f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * when {@link #DISPLAY_HOME_AS_UP} is enabled. This can be useful if you are using 895f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * this mode to display an alternate selection for up navigation, such as a sliding drawer. 896f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 897f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * <p>If you pass <code>0</code> to this method, the default drawable from the theme 898f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * will be used.</p> 899f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 900f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * <p>If you implement alternate or intermediate behavior around Up, you should also 901f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * call {@link #setHomeActionContentDescription(int) setHomeActionContentDescription()} 902f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * to provide a correct description of the action for accessibility support.</p> 903f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 9040dbe090bba314e72d65d5404c9fb15b7550a698dAndrei Stingaceanu * @param resId Resource ID of a drawable to use for the up indicator, or null 905f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * to use the theme's default 906f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 907f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @see #setDisplayOptions(int, int) 908f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @see #setDisplayHomeAsUpEnabled(boolean) 909f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @see #setHomeActionContentDescription(int) 910f4a93d160fc696de65e103e7e078106ea8f818faChris Banes */ 911b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye public void setHomeAsUpIndicator(@DrawableRes int resId) {} 912f4a93d160fc696de65e103e7e078106ea8f818faChris Banes 913f4a93d160fc696de65e103e7e078106ea8f818faChris Banes /** 914f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * Set an alternate description for the Home/Up action, when enabled. 915f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 916f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * <p>This description is commonly used for accessibility/screen readers when 917f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * the Home action is enabled. (See {@link #setDisplayHomeAsUpEnabled(boolean)}.) 918f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * Examples of this are, "Navigate Home" or "Navigate Up" depending on the 919f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * {@link #DISPLAY_HOME_AS_UP} display option. If you have changed the home-as-up 920f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * indicator using {@link #setHomeAsUpIndicator(int)} to indicate more specific 921f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * functionality such as a sliding drawer, you should also set this to accurately 922f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * describe the action.</p> 923f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 924f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * <p>Setting this to <code>null</code> will use the system default description.</p> 925f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 926f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @param description New description for the Home action when enabled 927f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @see #setHomeAsUpIndicator(int) 928f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @see #setHomeAsUpIndicator(android.graphics.drawable.Drawable) 929f4a93d160fc696de65e103e7e078106ea8f818faChris Banes */ 930b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye public void setHomeActionContentDescription(@Nullable CharSequence description) {} 931f4a93d160fc696de65e103e7e078106ea8f818faChris Banes 932f4a93d160fc696de65e103e7e078106ea8f818faChris Banes /** 933f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * Set an alternate description for the Home/Up action, when enabled. 934f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 935f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * <p>This description is commonly used for accessibility/screen readers when 936f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * the Home action is enabled. (See {@link #setDisplayHomeAsUpEnabled(boolean)}.) 937f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * Examples of this are, "Navigate Home" or "Navigate Up" depending on the 938f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * {@link #DISPLAY_HOME_AS_UP} display option. If you have changed the home-as-up 939f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * indicator using {@link #setHomeAsUpIndicator(int)} to indicate more specific 940f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * functionality such as a sliding drawer, you should also set this to accurately 941f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * describe the action.</p> 942f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 943f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * <p>Setting this to <code>0</code> will use the system default description.</p> 944f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * 945f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @param resId Resource ID of a string to use as the new description 946f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * for the Home action when enabled 947f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @see #setHomeAsUpIndicator(int) 948f4a93d160fc696de65e103e7e078106ea8f818faChris Banes * @see #setHomeAsUpIndicator(android.graphics.drawable.Drawable) 949f4a93d160fc696de65e103e7e078106ea8f818faChris Banes */ 950b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye public void setHomeActionContentDescription(@StringRes int resId) {} 951f4a93d160fc696de65e103e7e078106ea8f818faChris Banes 952f4a93d160fc696de65e103e7e078106ea8f818faChris Banes /** 95313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Enable hiding the action bar on content scroll. 95413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 95513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>If enabled, the action bar will scroll out of sight along with a 956e9fa476efa74bbcf2b10f82ba23ace88a4cd1e38Ben Murdoch * {@link View#setNestedScrollingEnabled(boolean) nested scrolling child} view's content. 95713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * The action bar must be in {@link Window#FEATURE_ACTION_BAR_OVERLAY overlay mode} 95813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * to enable hiding on content scroll.</p> 95913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 96013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>When partially scrolled off screen the action bar is considered 96113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link #hide() hidden}. A call to {@link #show() show} will cause it to return to full view. 96213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * </p> 96313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param hideOnContentScroll true to enable hiding on content scroll. 96413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes */ 96513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public void setHideOnContentScrollEnabled(boolean hideOnContentScroll) { 96613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes if (hideOnContentScroll) { 96713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes throw new UnsupportedOperationException("Hide on content scroll is not supported in " + 96813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes "this action bar configuration."); 96913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 97013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 97113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 97213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** 97313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Return whether the action bar is configured to scroll out of sight along with 97413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * a {@link View#setNestedScrollingEnabled(boolean) nested scrolling child}. 9759dcd2e58138ca4eb4b18f80b50e8979329e859d6Scott Main * 97613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @return true if hide-on-content-scroll is enabled 97713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @see #setHideOnContentScrollEnabled(boolean) 978bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 97913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public boolean isHideOnContentScrollEnabled() { 98013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes return false; 98113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 98213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 98313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** 98413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Return the current vertical offset of the action bar. 98513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 98613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>The action bar's current hide offset is the distance that the action bar is currently 98713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * scrolled offscreen in pixels. The valid range is 0 (fully visible) to the action bar's 98813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * current measured {@link #getHeight() height} (fully invisible).</p> 98913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 99013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @return The action bar's offset toward its fully hidden state in pixels 99113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes */ 99213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public int getHideOffset() { 99313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes return 0; 99413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 99513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 99613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** 99713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the current hide offset of the action bar. 99813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 99913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>The action bar's current hide offset is the distance that the action bar is currently 100013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * scrolled offscreen in pixels. The valid range is 0 (fully visible) to the action bar's 100113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * current measured {@link #getHeight() height} (fully invisible).</p> 100213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 100313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param offset The action bar's offset toward its fully hidden state in pixels. 100413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes */ 100513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public void setHideOffset(int offset) { 100613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes if (offset != 0) { 100713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes throw new UnsupportedOperationException("Setting an explicit action bar hide offset " + 100813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes "is not supported in this action bar configuration."); 100913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 101013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 101113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 101249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes /** 101349c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Set the Z-axis elevation of the action bar in pixels. 101449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * 101549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * <p>The action bar's elevation is the distance it is placed from its parent surface. Higher 101649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * values are closer to the user.</p> 101749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * 101849c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * @param elevation Elevation value in pixels 101949c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */ 102049c78900da0d43140fb602431fb93212bd7f6c70Chris Banes public void setElevation(float elevation) { 102149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes if (elevation != 0) { 102249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes throw new UnsupportedOperationException("Setting a non-zero elevation is " + 102349c78900da0d43140fb602431fb93212bd7f6c70Chris Banes "not supported in this action bar configuration."); 102449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes } 102549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes } 102649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes 102749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes /** 102849c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * Get the Z-axis elevation of the action bar in pixels. 102949c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * 103049c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * <p>The action bar's elevation is the distance it is placed from its parent surface. Higher 103149c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * values are closer to the user.</p> 103249c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * 103349c78900da0d43140fb602431fb93212bd7f6c70Chris Banes * @return Elevation value in pixels 103449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes */ 103549c78900da0d43140fb602431fb93212bd7f6c70Chris Banes public float getElevation() { 103649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes return 0; 103749c78900da0d43140fb602431fb93212bd7f6c70Chris Banes } 103849c78900da0d43140fb602431fb93212bd7f6c70Chris Banes 103913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** @hide */ 10408e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 104113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public void setDefaultDisplayHomeAsUpEnabled(boolean enabled) { 104213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 104313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 104413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** @hide */ 10458e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 104613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public void setShowHideAnimationEnabled(boolean enabled) { 104713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 104813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 104913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** @hide */ 10508e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 105113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public void onConfigurationChanged(Configuration config) { 105213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 105313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 105413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** @hide */ 10558e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 105613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public void dispatchMenuVisibilityChanged(boolean visible) { 105713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 105813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 105913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** @hide */ 10608e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 106113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public ActionMode startActionMode(ActionMode.Callback callback) { 106213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes return null; 106313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 106420ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns 106513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** @hide */ 10668e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 106713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public boolean openOptionsMenu() { 106813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes return false; 106913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 107013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 107113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** @hide */ 10728e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 107349b39d17068f2d6ff09378827b2a7d56163b6ffdEvan Rosky public boolean closeOptionsMenu() { 107449b39d17068f2d6ff09378827b2a7d56163b6ffdEvan Rosky return false; 107549b39d17068f2d6ff09378827b2a7d56163b6ffdEvan Rosky } 107649b39d17068f2d6ff09378827b2a7d56163b6ffdEvan Rosky 107749b39d17068f2d6ff09378827b2a7d56163b6ffdEvan Rosky /** @hide */ 107849b39d17068f2d6ff09378827b2a7d56163b6ffdEvan Rosky @RestrictTo(LIBRARY_GROUP) 107913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public boolean invalidateOptionsMenu() { 108013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes return false; 108113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 108213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 108313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** @hide */ 10848e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 108513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public boolean onMenuKeyEvent(KeyEvent event) { 108613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes return false; 108713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 108813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 1089d15ee7df01f2f48b536a610c4739f33b226d3f81Chris Banes /** @hide **/ 10908e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 1091d15ee7df01f2f48b536a610c4739f33b226d3f81Chris Banes public boolean onKeyShortcut(int keyCode, KeyEvent ev) { 1092d15ee7df01f2f48b536a610c4739f33b226d3f81Chris Banes return false; 1093d15ee7df01f2f48b536a610c4739f33b226d3f81Chris Banes } 1094d15ee7df01f2f48b536a610c4739f33b226d3f81Chris Banes 109513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** @hide */ 10968e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 109713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public boolean collapseActionView() { 109813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes return false; 109913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes } 110013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes 1101ca58f2ce7cd9f0e0f2c4a46c3bcc98013209f6b3Chris Banes /** @hide */ 11028e10080c914d1ad0784394fa3026b85535535847Aurimas Liutikas @RestrictTo(LIBRARY_GROUP) 1103ca58f2ce7cd9f0e0f2c4a46c3bcc98013209f6b3Chris Banes public void setWindowTitle(CharSequence title) { 1104ca58f2ce7cd9f0e0f2c4a46c3bcc98013209f6b3Chris Banes } 1105ca58f2ce7cd9f0e0f2c4a46c3bcc98013209f6b3Chris Banes 110613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes /** 1107a6d085f83e2aec7ebda1fbbc69a5fd63c5f2e235George Mount * Attempts to move focus to the ActionBar if it does not already contain the focus. 1108a6d085f83e2aec7ebda1fbbc69a5fd63c5f2e235George Mount * 1109a6d085f83e2aec7ebda1fbbc69a5fd63c5f2e235George Mount * @return {@code true} if focus changes or {@code false} if focus doesn't change. 11100dbe090bba314e72d65d5404c9fb15b7550a698dAndrei Stingaceanu * @hide 1111a6d085f83e2aec7ebda1fbbc69a5fd63c5f2e235George Mount */ 11120dbe090bba314e72d65d5404c9fb15b7550a698dAndrei Stingaceanu @RestrictTo(LIBRARY_GROUP) 1113a6d085f83e2aec7ebda1fbbc69a5fd63c5f2e235George Mount boolean requestFocus() { 1114a6d085f83e2aec7ebda1fbbc69a5fd63c5f2e235George Mount return false; 1115a6d085f83e2aec7ebda1fbbc69a5fd63c5f2e235George Mount } 1116a6d085f83e2aec7ebda1fbbc69a5fd63c5f2e235George Mount 1117a6d085f83e2aec7ebda1fbbc69a5fd63c5f2e235George Mount /** 1118733d0b2acb07ede7455b9d020901a10586053923Chris Banes * Clean up any resources 1119733d0b2acb07ede7455b9d020901a10586053923Chris Banes */ 1120733d0b2acb07ede7455b9d020901a10586053923Chris Banes void onDestroy() { 1121733d0b2acb07ede7455b9d020901a10586053923Chris Banes } 1122733d0b2acb07ede7455b9d020901a10586053923Chris Banes 1123733d0b2acb07ede7455b9d020901a10586053923Chris Banes /** 112413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Listener interface for ActionBar navigation events. 112513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * 112613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 112713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 112813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 112913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 113013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes */ 1131d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 113213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public interface OnNavigationListener { 1133bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 113413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * This method is called whenever a navigation item in your action bar 113513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * is selected. 1136bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1137bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param itemPosition Position of the item clicked. 113813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param itemId ID of the item clicked. 1139bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return True if the event was handled, false otherwise. 1140bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1141bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public boolean onNavigationItemSelected(int itemPosition, long itemId); 1142bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell } 1143bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1144bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 114513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Listener for receiving events when action bar menus are shown or hidden. 1146bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1147bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public interface OnMenuVisibilityListener { 114820ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns 1149bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 115013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Called when an action bar menu is shown or hidden. Applications may want to use 115113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * this to tune auto-hiding behavior for the action bar or pause/resume video playback, 115213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * gameplay, or other activity within the main content area. 1153bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 115413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param isVisible True if an action bar menu is now visible, false if no action bar 115513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * menus are visible. 1156bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1157bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public void onMenuVisibilityChanged(boolean isVisible); 1158bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell } 1159bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1160bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 116113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * A tab in the action bar. 1162bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 116313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <p>Tabs manage the hiding and showing of {@link Fragment}s. 11649dcd2e58138ca4eb4b18f80b50e8979329e859d6Scott Main * 116513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 116613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 116713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 116813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 1169bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1170d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 1171bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public static abstract class Tab { 117220ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns 1173bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1174bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * An invalid position for a tab. 1175bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1176bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #getPosition() 1177bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1178bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public static final int INVALID_POSITION = -1; 1179bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1180bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1181bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Return the current position of this tab in the action bar. 1182bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1183bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return Current position, or {@link #INVALID_POSITION} if this tab is not currently in 1184bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * the action bar. 1185bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1186bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract int getPosition(); 1187bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1188bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1189bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Return the icon associated with this tab. 1190bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1191bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The tab's icon 1192bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1193bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract Drawable getIcon(); 1194bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1195bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1196bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Return the text of this tab. 1197bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1198bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The tab's text 1199bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1200bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract CharSequence getText(); 1201bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1202bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1203bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Set the icon displayed on this tab. 1204bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1205bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param icon The drawable to use as an icon 1206bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current instance for call chaining 1207bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1208bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract Tab setIcon(Drawable icon); 1209bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1210bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1211bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Set the icon displayed on this tab. 1212bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1213bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param resId Resource ID referring to the drawable to use as an icon 1214bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current instance for call chaining 1215bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1216b933f9c89bbe890ff6753559b83c0ecf236472ddTor Norbye public abstract Tab setIcon(@DrawableRes int resId); 1217bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1218bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 121913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the text displayed on this tab. Text may be truncated if there is not 122013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * room to display the entire string. 1221bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1222bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param text The text to display 1223bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current instance for call chaining 1224bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1225bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract Tab setText(CharSequence text); 1226bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1227bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 122813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the text displayed on this tab. Text may be truncated if there is not 122913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * room to display the entire string. 1230bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1231bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param resId A resource ID referring to the text that should be displayed 1232bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current instance for call chaining 1233bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 123413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public abstract Tab setText(int resId); 1235bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1236bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 123713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set a custom view to be used for this tab. This overrides values set by 123813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link #setText(CharSequence)} and {@link #setIcon(Drawable)}. 1239bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1240bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param view Custom view to be used as a tab. 1241bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current instance for call chaining 1242bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1243bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract Tab setCustomView(View view); 1244bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1245bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 124613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set a custom view to be used for this tab. This overrides values set by 124713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * {@link #setText(CharSequence)} and {@link #setIcon(Drawable)}. 1248bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1249bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param layoutResId A layout resource to inflate and use as a custom tab view 1250bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current instance for call chaining 1251bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 125213ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public abstract Tab setCustomView(int layoutResId); 1253bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1254bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1255bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Retrieve a previously set custom view for this tab. 1256bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1257bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The custom view set by {@link #setCustomView(View)}. 1258bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1259bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract View getCustomView(); 1260bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1261bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1262bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Give this Tab an arbitrary object to hold for later use. 1263bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1264bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param obj Object to store 1265bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current instance for call chaining 1266bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1267bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract Tab setTag(Object obj); 1268bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1269bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1270bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return This Tab's tag object. 1271bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1272bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract Object getTag(); 1273bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1274bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 127513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set the {@link TabListener} that will handle switching to and from this tab. 127613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * All tabs must have a TabListener set before being added to the ActionBar. 1277bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1278bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param listener Listener to handle tab selection events 1279bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current instance for call chaining 1280bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1281bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract Tab setTabListener(TabListener listener); 1282bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1283bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1284bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Select this tab. Only valid if the tab has been added to the action bar. 1285bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1286bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract void select(); 1287bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1288bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 128913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set a description of this tab's content for use in accessibility support. 129013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * If no content description is provided the title will be used. 1291bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1292bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param resId A resource ID referring to the description text 1293bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current instance for call chaining 1294bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setContentDescription(CharSequence) 1295bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #getContentDescription() 1296bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 12970dbe090bba314e72d65d5404c9fb15b7550a698dAndrei Stingaceanu public abstract Tab setContentDescription(@StringRes int resId); 1298bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1299bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 130013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Set a description of this tab's content for use in accessibility support. 130113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * If no content description is provided the title will be used. 1302bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1303bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param contentDesc Description of this tab's content 1304bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return The current instance for call chaining 1305bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setContentDescription(int) 1306bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #getContentDescription() 1307bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1308bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract Tab setContentDescription(CharSequence contentDesc); 1309bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1310bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1311bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Gets a brief description of this tab's content for use in accessibility support. 1312bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1313bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @return Description of this tab's content 1314bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setContentDescription(CharSequence) 1315bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see #setContentDescription(int) 1316bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1317bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public abstract CharSequence getContentDescription(); 1318bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell } 1319bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1320bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 132113ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Callback interface invoked when a tab is focused, unfocused, added, or removed. 13229dcd2e58138ca4eb4b18f80b50e8979329e859d6Scott Main * 132313ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @deprecated Action bar navigation modes are deprecated and not supported by inline 132413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * toolbar action bars. Consider using other 132513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * <a href="http://developer.android.com/design/patterns/navigation.html">common 132613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * navigation patterns</a> instead. 1327bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1328d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 1329bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public interface TabListener { 133020ac724a3a836bfd362c911f7dc55a61c02b4d44Trevor Johns 1331bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1332bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Called when a tab enters the selected state. 1333bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1334bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param tab The tab that was selected 133513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param ft A {@link FragmentTransaction} for queuing fragment operations to execute 133613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * during a tab switch. The previous tab's unselect and this tab's select will be 133713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * executed in a single transaction. This FragmentTransaction does not support 133813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * being added to the back stack. 1339bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1340bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public void onTabSelected(Tab tab, FragmentTransaction ft); 1341bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1342bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1343bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Called when a tab exits the selected state. 1344bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1345bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param tab The tab that was unselected 134613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param ft A {@link FragmentTransaction} for queuing fragment operations to execute 134713ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * during a tab switch. This tab's unselect and the newly selected tab's select 134813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * will be executed in a single transaction. This FragmentTransaction does not 134913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * support being added to the back stack. 1350bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1351bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public void onTabUnselected(Tab tab, FragmentTransaction ft); 1352bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1353bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 135413ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Called when a tab that is already selected is chosen again by the user. 135513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * Some applications may use this action to return to the top level of a category. 1356bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1357bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @param tab The tab that was reselected. 135813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * @param ft A {@link FragmentTransaction} for queuing fragment operations to execute 135913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * once this method returns. This FragmentTransaction does not support 136013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes * being added to the back stack. 1361bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 1362bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public void onTabReselected(Tab tab, FragmentTransaction ft); 1363bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell } 1364bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1365bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1366bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Per-child layout information associated with action bar custom views. 1367bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 136813ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public static class LayoutParams extends ViewGroup.MarginLayoutParams { 1369bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell /** 1370bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * Gravity for the view associated with these LayoutParams. 1371bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * 1372bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell * @see android.view.Gravity 1373bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell */ 137449c78900da0d43140fb602431fb93212bd7f6c70Chris Banes public int gravity = Gravity.NO_GRAVITY; 1375bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 137613ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes public LayoutParams(@NonNull Context c, AttributeSet attrs) { 1377bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell super(c, attrs); 1378bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 137913ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes TypedArray a = c.obtainStyledAttributes(attrs, R.styleable.ActionBarLayout); 138013ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes gravity = a.getInt(R.styleable.ActionBarLayout_android_layout_gravity, Gravity.NO_GRAVITY); 1381bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell a.recycle(); 1382bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell } 1383bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1384bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public LayoutParams(int width, int height) { 1385bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell super(width, height); 138649c78900da0d43140fb602431fb93212bd7f6c70Chris Banes this.gravity = Gravity.CENTER_VERTICAL | GravityCompat.START; 1387bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell } 1388bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1389bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public LayoutParams(int width, int height, int gravity) { 1390bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell super(width, height); 1391bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell this.gravity = gravity; 1392bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell } 1393bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1394bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public LayoutParams(int gravity) { 139513ab4aa8a1d337c414c887a81b9829f2286cdd37Chris Banes this(WRAP_CONTENT, MATCH_PARENT, gravity); 1396bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell } 1397bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1398bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public LayoutParams(LayoutParams source) { 1399bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell super(source); 1400bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1401bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell this.gravity = source.gravity; 1402bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell } 1403bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell 1404bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell public LayoutParams(ViewGroup.LayoutParams source) { 1405bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell super(source); 1406bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell } 1407bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell } 1408bbbb8f39d1b1d1b317c5f9237f20fe6b1d9eb17fAdam Powell} 1409