diff options
| author | 2011-01-20 12:08:13 -0800 | |
|---|---|---|
| committer | 2011-01-20 13:25:08 -0800 | |
| commit | 1264c33163146d6088675d197551a63b3f9d360b (patch) | |
| tree | 05203060fd9421a7c0a5921b8203b788d07dc9b5 | |
| parent | 292f39c1201f2f08ac90d5562a7fd7070e9b32a0 (diff) | |
Fix bug 3362375 - API REVIEW: remove unused public 'up' id
Fix bug 3362453 - API REVIEW: android.app.ActionBar
Change-Id: I4e0233cd9355a47682bfe7b4a7fda39801586f1a
| -rw-r--r-- | api/11.xml | 122 | ||||
| -rw-r--r-- | api/current.xml | 122 | ||||
| -rw-r--r-- | core/java/android/app/ActionBar.java | 91 | ||||
| -rw-r--r-- | core/java/android/app/FragmentBreadCrumbs.java | 6 | ||||
| -rw-r--r-- | core/java/android/preference/PreferenceActivity.java | 4 | ||||
| -rw-r--r-- | core/java/com/android/internal/app/ActionBarImpl.java | 48 | ||||
| -rw-r--r-- | core/java/com/android/internal/widget/ActionBarView.java | 6 | ||||
| -rwxr-xr-x | core/res/res/values/attrs.xml | 2 | ||||
| -rw-r--r-- | core/res/res/values/public.xml | 1 | ||||
| -rw-r--r-- | docs/html/guide/topics/ui/actionbar.jd | 2 |
10 files changed, 7 insertions, 397 deletions
diff --git a/api/11.xml b/api/11.xml index 5f3cd5115bbd..bfd637ecde2f 100644 --- a/api/11.xml +++ b/api/11.xml @@ -13977,17 +13977,6 @@ visibility="public" > </field> -<field name="up" - type="int" - transient="false" - volatile="false" - value="16908334" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="widget_frame" type="int" transient="false" @@ -21602,17 +21591,6 @@ <parameter name="setSelected" type="boolean"> </parameter> </method> -<method name="getCustomNavigationView" - return="android.view.View" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -</method> <method name="getCustomView" return="android.view.View" abstract="true" @@ -21679,17 +21657,6 @@ visibility="public" > </method> -<method name="getSelectedNavigationItem" - return="int" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -</method> <method name="getSelectedTab" return="android.app.ActionBar.Tab" abstract="true" @@ -21856,19 +21823,6 @@ <parameter name="d" type="android.graphics.drawable.Drawable"> </parameter> </method> -<method name="setCustomNavigationMode" - return="void" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -<parameter name="view" type="android.view.View"> -</parameter> -</method> <method name="setCustomView" return="void" abstract="true" @@ -22003,38 +21957,6 @@ <parameter name="useLogo" type="boolean"> </parameter> </method> -<method name="setDropdownNavigationMode" - return="void" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -<parameter name="adapter" type="android.widget.SpinnerAdapter"> -</parameter> -<parameter name="callback" type="android.app.ActionBar.OnNavigationListener"> -</parameter> -</method> -<method name="setDropdownNavigationMode" - return="void" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -<parameter name="adapter" type="android.widget.SpinnerAdapter"> -</parameter> -<parameter name="callback" type="android.app.ActionBar.OnNavigationListener"> -</parameter> -<parameter name="defaultSelectedPosition" type="int"> -</parameter> -</method> <method name="setListNavigationCallbacks" return="void" abstract="true" @@ -22076,17 +21998,6 @@ <parameter name="position" type="int"> </parameter> </method> -<method name="setStandardNavigationMode" - return="void" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -</method> <method name="setSubtitle" return="void" abstract="true" @@ -22113,17 +22024,6 @@ <parameter name="resId" type="int"> </parameter> </method> -<method name="setTabNavigationMode" - return="void" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -</method> <method name="setTitle" return="void" abstract="true" @@ -22161,17 +22061,6 @@ visibility="public" > </method> -<field name="DISPLAY_HIDE_HOME" - type="int" - transient="false" - volatile="false" - value="4096" - static="true" - final="true" - deprecated="deprecated" - visibility="public" -> -</field> <field name="DISPLAY_HOME_AS_UP" type="int" transient="false" @@ -22227,17 +22116,6 @@ visibility="public" > </field> -<field name="NAVIGATION_MODE_DROPDOWN_LIST" - type="int" - transient="false" - volatile="false" - value="1" - static="true" - final="true" - deprecated="deprecated" - visibility="public" -> -</field> <field name="NAVIGATION_MODE_LIST" type="int" transient="false" diff --git a/api/current.xml b/api/current.xml index 5f3cd5115bbd..bfd637ecde2f 100644 --- a/api/current.xml +++ b/api/current.xml @@ -13977,17 +13977,6 @@ visibility="public" > </field> -<field name="up" - type="int" - transient="false" - volatile="false" - value="16908334" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="widget_frame" type="int" transient="false" @@ -21602,17 +21591,6 @@ <parameter name="setSelected" type="boolean"> </parameter> </method> -<method name="getCustomNavigationView" - return="android.view.View" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -</method> <method name="getCustomView" return="android.view.View" abstract="true" @@ -21679,17 +21657,6 @@ visibility="public" > </method> -<method name="getSelectedNavigationItem" - return="int" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -</method> <method name="getSelectedTab" return="android.app.ActionBar.Tab" abstract="true" @@ -21856,19 +21823,6 @@ <parameter name="d" type="android.graphics.drawable.Drawable"> </parameter> </method> -<method name="setCustomNavigationMode" - return="void" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -<parameter name="view" type="android.view.View"> -</parameter> -</method> <method name="setCustomView" return="void" abstract="true" @@ -22003,38 +21957,6 @@ <parameter name="useLogo" type="boolean"> </parameter> </method> -<method name="setDropdownNavigationMode" - return="void" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -<parameter name="adapter" type="android.widget.SpinnerAdapter"> -</parameter> -<parameter name="callback" type="android.app.ActionBar.OnNavigationListener"> -</parameter> -</method> -<method name="setDropdownNavigationMode" - return="void" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -<parameter name="adapter" type="android.widget.SpinnerAdapter"> -</parameter> -<parameter name="callback" type="android.app.ActionBar.OnNavigationListener"> -</parameter> -<parameter name="defaultSelectedPosition" type="int"> -</parameter> -</method> <method name="setListNavigationCallbacks" return="void" abstract="true" @@ -22076,17 +21998,6 @@ <parameter name="position" type="int"> </parameter> </method> -<method name="setStandardNavigationMode" - return="void" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -</method> <method name="setSubtitle" return="void" abstract="true" @@ -22113,17 +22024,6 @@ <parameter name="resId" type="int"> </parameter> </method> -<method name="setTabNavigationMode" - return="void" - abstract="true" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -</method> <method name="setTitle" return="void" abstract="true" @@ -22161,17 +22061,6 @@ visibility="public" > </method> -<field name="DISPLAY_HIDE_HOME" - type="int" - transient="false" - volatile="false" - value="4096" - static="true" - final="true" - deprecated="deprecated" - visibility="public" -> -</field> <field name="DISPLAY_HOME_AS_UP" type="int" transient="false" @@ -22227,17 +22116,6 @@ visibility="public" > </field> -<field name="NAVIGATION_MODE_DROPDOWN_LIST" - type="int" - transient="false" - volatile="false" - value="1" - static="true" - final="true" - deprecated="deprecated" - visibility="public" -> -</field> <field name="NAVIGATION_MODE_LIST" type="int" transient="false" diff --git a/core/java/android/app/ActionBar.java b/core/java/android/app/ActionBar.java index 8d5a6da9a090..fc5fac650db0 100644 --- a/core/java/android/app/ActionBar.java +++ b/core/java/android/app/ActionBar.java @@ -49,12 +49,6 @@ public abstract class ActionBar { * e.g. this might be presented to the user as a dropdown list. */ public static final int NAVIGATION_MODE_LIST = 1; - - /** - * @deprecated use NAVIGATION_MODE_LIST - */ - @Deprecated - public static final int NAVIGATION_MODE_DROPDOWN_LIST = 1; /** * Tab navigation mode. Instead of static title text this mode @@ -81,13 +75,6 @@ public abstract class ActionBar { public static final int DISPLAY_SHOW_HOME = 0x2; /** - * @deprecated Display flags are now positive for consistency - 'show' instead of 'hide'. - * Use DISPLAY_SHOW_HOME. - */ - @Deprecated - public static final int DISPLAY_HIDE_HOME = 0x1000; - - /** * Display the 'home' element such that it appears as an 'up' affordance. * e.g. show an arrow to the left indicating the action that will be taken. * @@ -173,28 +160,6 @@ public abstract class ActionBar { public abstract void setCustomView(int resId); /** - * @param view - * @deprecated Use {@link #setCustomView(View)} and {@link #setDisplayOptions(int)} instead. - */ - @Deprecated - public abstract void setCustomNavigationMode(View view); - - /** - * Set the action bar into dropdown navigation mode and supply an adapter - * that will provide views for navigation choices. - * - * @param adapter An adapter that will provide views both to display - * the current navigation selection and populate views - * within the dropdown navigation menu. - * @param callback A OnNavigationListener that will receive events when the user - * selects a navigation item. - * @deprecated See setListNavigationCallbacks. - */ - @Deprecated - public abstract void setDropdownNavigationMode(SpinnerAdapter adapter, - OnNavigationListener callback); - - /** * Set the adapter and navigation callback for list navigation mode. * * The supplied adapter will provide views for the expanded list as well as @@ -213,23 +178,6 @@ public abstract class ActionBar { OnNavigationListener callback); /** - * Set the action bar into dropdown navigation mode and supply an adapter that will - * provide views for navigation choices. - * - * @param adapter An adapter that will provide views both to display the current - * navigation selection and populate views within the dropdown - * navigation menu. - * @param callback A OnNavigationListener that will receive events when the user - * selects a navigation item. - * @param defaultSelectedPosition Position within the provided adapter that should be - * selected from the outset. - * @deprecated See setListNavigationCallbacks and setSelectedNavigationItem. - */ - @Deprecated - public abstract void setDropdownNavigationMode(SpinnerAdapter adapter, - OnNavigationListener callback, int defaultSelectedPosition); - - /** * Set the selected navigation item in list or tabbed navigation modes. * * @param position Position of the item to select. @@ -240,15 +188,6 @@ public abstract class ActionBar { * Get the position of the selected navigation item in list or tabbed navigation modes. * * @return Position of the selected item. - * @deprecated Use {@link #getSelectedNavigationIndex()} instead. - */ - @Deprecated - public abstract int getSelectedNavigationItem(); - - /** - * Get the position of the selected navigation item in list or tabbed navigation modes. - * - * @return Position of the selected item. */ public abstract int getSelectedNavigationIndex(); @@ -260,17 +199,6 @@ public abstract class ActionBar { public abstract int getNavigationItemCount(); /** - * Set the action bar into standard navigation mode, using the currently set title - * and/or subtitle. - * - * Standard navigation mode is default. The title is automatically set to the name of - * your Activity on startup if an action bar is present. - * @deprecated See setNavigationMode - */ - @Deprecated - public abstract void setStandardNavigationMode(); - - /** * Set the action bar's title. This will only be displayed if * {@link #DISPLAY_SHOW_TITLE} is set. * @@ -410,13 +338,6 @@ public abstract class ActionBar { * @param d Background drawable */ public abstract void setBackgroundDrawable(Drawable d); - - /** - * @return The current custom navigation view. - * @deprecated Method has been renamed. Use {@link #getCustomView()}. - */ - @Deprecated - public abstract View getCustomNavigationView(); /** * @return The current custom view. @@ -476,18 +397,6 @@ public abstract class ActionBar { public abstract int getDisplayOptions(); /** - * Set the action bar into tabbed navigation mode. - * - * @see #addTab(Tab) - * @see #insertTab(Tab, int) - * @see #removeTab(Tab) - * @see #removeTabAt(int) - * - * @deprecated See {@link #setNavigationMode(int)} - */ - public abstract void setTabNavigationMode(); - - /** * Create and return a new {@link Tab}. * This tab will not be included in the action bar until it is added. * diff --git a/core/java/android/app/FragmentBreadCrumbs.java b/core/java/android/app/FragmentBreadCrumbs.java index 72a8e9a6feee..3f045ac288f9 100644 --- a/core/java/android/app/FragmentBreadCrumbs.java +++ b/core/java/android/app/FragmentBreadCrumbs.java @@ -29,9 +29,9 @@ import android.widget.TextView; /** * Helper class for showing "bread crumbs" representing the fragment * stack in an activity. This is intended to be used with - * {@link ActionBar#setCustomNavigationMode(View) - * ActionBar.setCustomNavigationMode(View)} to place the bread crumbs in - * the navigation area of the action bar. + * {@link ActionBar#setCustomView(View) + * ActionBar.setCustomView(View)} to place the bread crumbs in + * the action bar. * * <p>The default style for this view is * {@link android.R.style#Widget_FragmentBreadCrumbs}. diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java index 3883451e4b23..2b609ea7ed6c 100644 --- a/core/java/android/preference/PreferenceActivity.java +++ b/core/java/android/preference/PreferenceActivity.java @@ -998,7 +998,9 @@ public abstract class PreferenceActivity extends ListActivity implements mFragmentBreadCrumbs = new FragmentBreadCrumbs(this); ActionBar actionBar = getActionBar(); if (actionBar != null) { - actionBar.setCustomNavigationMode(mFragmentBreadCrumbs); + actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, + ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_CUSTOM); + actionBar.setCustomView(mFragmentBreadCrumbs); } } mFragmentBreadCrumbs.setMaxVisible(2); diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java index a8eb6fe04047..b1b5d7158284 100644 --- a/core/java/com/android/internal/app/ActionBarImpl.java +++ b/core/java/com/android/internal/app/ActionBarImpl.java @@ -277,36 +277,6 @@ public class ActionBarImpl extends ActionBar { setSubtitle(mContext.getString(resId)); } - public void setCustomNavigationMode(View view) { - cleanupTabs(); - setCustomView(view); - setDisplayOptions(DISPLAY_SHOW_CUSTOM, DISPLAY_SHOW_CUSTOM | DISPLAY_SHOW_TITLE); - mActionView.setNavigationMode(NAVIGATION_MODE_STANDARD); - mActionView.setCallback(null); - } - - public void setDropdownNavigationMode(SpinnerAdapter adapter, OnNavigationListener callback) { - setDropdownNavigationMode(adapter, callback, -1); - } - - public void setDropdownNavigationMode(SpinnerAdapter adapter, OnNavigationListener callback, - int defaultSelectedPosition) { - cleanupTabs(); - setDisplayOptions(0, DISPLAY_SHOW_CUSTOM | DISPLAY_SHOW_TITLE); - mActionView.setNavigationMode(NAVIGATION_MODE_LIST); - setListNavigationCallbacks(adapter, callback); - if (defaultSelectedPosition >= 0) { - mActionView.setDropdownSelectedPosition(defaultSelectedPosition); - } - } - - public void setStandardNavigationMode() { - cleanupTabs(); - setDisplayOptions(DISPLAY_SHOW_TITLE, DISPLAY_SHOW_TITLE | DISPLAY_SHOW_CUSTOM); - mActionView.setNavigationMode(NAVIGATION_MODE_STANDARD); - mActionView.setCallback(null); - } - public void setSelectedNavigationItem(int position) { switch (mActionView.getNavigationMode()) { case NAVIGATION_MODE_TABS: @@ -321,10 +291,6 @@ public class ActionBarImpl extends ActionBar { } } - public int getSelectedNavigationItem() { - return getSelectedNavigationIndex(); - } - public void removeAllTabs() { cleanupTabs(); } @@ -359,10 +325,6 @@ public class ActionBarImpl extends ActionBar { mContainerView.setBackgroundDrawable(d); } - public View getCustomNavigationView() { - return getCustomView(); - } - public View getCustomView() { return mActionView.getCustomNavigationView(); } @@ -477,16 +439,6 @@ public class ActionBarImpl extends ActionBar { } @Override - public void setTabNavigationMode() { - if (mActivity == null) { - throw new IllegalStateException( - "Tab navigation mode cannot be used outside of an Activity"); - } - setDisplayOptions(0, DISPLAY_SHOW_TITLE | DISPLAY_SHOW_CUSTOM); - mActionView.setNavigationMode(NAVIGATION_MODE_TABS); - } - - @Override public void selectTab(Tab tab) { if (getNavigationMode() != NAVIGATION_MODE_TABS) { mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION; diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java index 297dde78254b..d44d4a556286 100644 --- a/core/java/com/android/internal/widget/ActionBarView.java +++ b/core/java/com/android/internal/widget/ActionBarView.java @@ -370,12 +370,6 @@ public class ActionBarView extends ViewGroup { } public void setDisplayOptions(int options) { - // TODO Remove this once DISPLAY_HIDE_HOME is removed - if ((options & ActionBar.DISPLAY_HIDE_HOME) != 0) { - options &= ~(ActionBar.DISPLAY_HIDE_HOME | ActionBar.DISPLAY_SHOW_HOME); - } - // End TODO - final int flagsChanged = options ^ mDisplayOptions; mDisplayOptions = options; if ((flagsChanged & DISPLAY_RELAYOUT_MASK) != 0) { diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index b9caeb38d12d..fbd5b5e81234 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -4648,8 +4648,6 @@ <flag name="homeAsUp" value="0x4" /> <flag name="showTitle" value="0x8" /> <flag name="showCustom" value="0x10" /> - <!-- DEPRECATED - Remove this later!! --> - <flag name="hideHome" value="0x1000" /> </attr> <!-- Specifies title text used for navigationMode="normal" --> <attr name="title" /> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index a30e31689ac9..786c4d080acf 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1468,7 +1468,6 @@ <!-- Context menu ID for the "Select text..." menu item to switch to text selection context mode in text views. --> <public type="id" name="selectTextMode" /> - <public type="id" name="up" /> <public type="dimen" name="dialog_min_width_major" /> <public type="dimen" name="dialog_min_width_minor" /> diff --git a/docs/html/guide/topics/ui/actionbar.jd b/docs/html/guide/topics/ui/actionbar.jd index c17fc3cc9493..376bf6a9c844 100644 --- a/docs/html/guide/topics/ui/actionbar.jd +++ b/docs/html/guide/topics/ui/actionbar.jd @@ -425,7 +425,7 @@ to call {@link android.app.FragmentTransaction#commit} for these transactions. Y <p>If your activity is stopped, you should retain the currently selected tab with the saved state so that when the user returns to your application, you can open the tab. When it's time to save the state, you can query the currently selected tab with {@link -android.app.ActionBar#getSelectedNavigationItem()}. This returns the index position of the selected +android.app.ActionBar#getSelectedNavigationIndex()}. This returns the index position of the selected tab.</p> <p class="caution"><strong>Caution:</strong> It's important that you save |