Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -3159,6 +3159,7 @@ package android.app { method public abstract deprecated void addTab(android.app.ActionBar.Tab, int, boolean); method public abstract android.view.View getCustomView(); method public abstract int getDisplayOptions(); method public float getElevation(); method public abstract int getHeight(); method public int getHideOffset(); method public abstract deprecated int getNavigationItemCount(); Loading Loading @@ -3190,6 +3191,7 @@ package android.app { method public abstract void setDisplayShowHomeEnabled(boolean); method public abstract void setDisplayShowTitleEnabled(boolean); method public abstract void setDisplayUseLogoEnabled(boolean); method public void setElevation(float); method public void setHideOffset(int); method public void setHideOnContentScrollEnabled(boolean); method public void setHomeActionContentDescription(java.lang.CharSequence); core/java/android/app/ActionBar.java +27 −0 Original line number Diff line number Diff line Loading @@ -993,6 +993,33 @@ public abstract class ActionBar { } } /** * Set the Z-axis elevation of the action bar in pixels. * * <p>The action bar's elevation is the distance it is placed from its parent surface. Higher * values are closer to the user.</p> * * @param elevation Elevation value in pixels */ public void setElevation(float elevation) { if (elevation != 0) { throw new UnsupportedOperationException("Setting a non-zero elevation is " + "not supported in this action bar configuration."); } } /** * Get the Z-axis elevation of the action bar in pixels. * * <p>The action bar's elevation is the distance it is placed from its parent surface. Higher * values are closer to the user.</p> * * @return Elevation value in pixels */ public float getElevation() { return 0; } /** @hide */ public void setDefaultDisplayHomeAsUpEnabled(boolean enabled) { } Loading core/java/com/android/internal/app/ToolbarActionBar.java +10 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,16 @@ public class ToolbarActionBar extends ActionBar { // If the nav button on a Toolbar is present, it's enabled. No-op. } @Override public void setElevation(float elevation) { mToolbar.setElevation(elevation); } @Override public float getElevation() { return mToolbar.getElevation(); } @Override public Context getThemedContext() { return mToolbar.getContext(); Loading core/java/com/android/internal/app/WindowDecorActionBar.java +17 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,10 @@ public class WindowDecorActionBar extends ActionBar implements if (a.getBoolean(R.styleable.ActionBar_hideOnContentScroll, false)) { setHideOnContentScrollEnabled(true); } final int elevation = a.getDimensionPixelSize(R.styleable.ActionBar_elevation, 0); if (elevation != 0) { setElevation(elevation); } a.recycle(); } Loading @@ -236,6 +240,19 @@ public class WindowDecorActionBar extends ActionBar implements } } @Override public void setElevation(float elevation) { mContainerView.setElevation(elevation); if (mSplitView != null) { mSplitView.setElevation(elevation); } } @Override public float getElevation() { return mContainerView.getElevation(); } public void onConfigurationChanged(Configuration newConfig) { setHasEmbeddedTabs(ActionBarPolicy.get(mContext).hasEmbeddedTabs()); } Loading core/res/res/values/attrs.xml +10 −0 Original line number Diff line number Diff line Loading @@ -6783,10 +6783,20 @@ <attr name="itemPadding" format="dimension" /> <!-- Set true to hide the action bar on a vertical nested scroll of content. --> <attr name="hideOnContentScroll" format="boolean" /> <!-- Minimum inset for content views within a bar. Navigation buttons and menu views are excepted. Only valid for some themes and configurations. --> <attr name="contentInsetStart" format="dimension" /> <!-- Minimum inset for content views within a bar. Navigation buttons and menu views are excepted. Only valid for some themes and configurations. --> <attr name="contentInsetEnd" format="dimension" /> <!-- Minimum inset for content views within a bar. Navigation buttons and menu views are excepted. Only valid for some themes and configurations. --> <attr name="contentInsetLeft" format="dimension" /> <!-- Minimum inset for content views within a bar. Navigation buttons and menu views are excepted. Only valid for some themes and configurations. --> <attr name="contentInsetRight" format="dimension" /> <!-- Elevation for the action bar itself --> <attr name="elevation" /> </declare-styleable> <declare-styleable name="ActionMode"> Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -3159,6 +3159,7 @@ package android.app { method public abstract deprecated void addTab(android.app.ActionBar.Tab, int, boolean); method public abstract android.view.View getCustomView(); method public abstract int getDisplayOptions(); method public float getElevation(); method public abstract int getHeight(); method public int getHideOffset(); method public abstract deprecated int getNavigationItemCount(); Loading Loading @@ -3190,6 +3191,7 @@ package android.app { method public abstract void setDisplayShowHomeEnabled(boolean); method public abstract void setDisplayShowTitleEnabled(boolean); method public abstract void setDisplayUseLogoEnabled(boolean); method public void setElevation(float); method public void setHideOffset(int); method public void setHideOnContentScrollEnabled(boolean); method public void setHomeActionContentDescription(java.lang.CharSequence);
core/java/android/app/ActionBar.java +27 −0 Original line number Diff line number Diff line Loading @@ -993,6 +993,33 @@ public abstract class ActionBar { } } /** * Set the Z-axis elevation of the action bar in pixels. * * <p>The action bar's elevation is the distance it is placed from its parent surface. Higher * values are closer to the user.</p> * * @param elevation Elevation value in pixels */ public void setElevation(float elevation) { if (elevation != 0) { throw new UnsupportedOperationException("Setting a non-zero elevation is " + "not supported in this action bar configuration."); } } /** * Get the Z-axis elevation of the action bar in pixels. * * <p>The action bar's elevation is the distance it is placed from its parent surface. Higher * values are closer to the user.</p> * * @return Elevation value in pixels */ public float getElevation() { return 0; } /** @hide */ public void setDefaultDisplayHomeAsUpEnabled(boolean enabled) { } Loading
core/java/com/android/internal/app/ToolbarActionBar.java +10 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,16 @@ public class ToolbarActionBar extends ActionBar { // If the nav button on a Toolbar is present, it's enabled. No-op. } @Override public void setElevation(float elevation) { mToolbar.setElevation(elevation); } @Override public float getElevation() { return mToolbar.getElevation(); } @Override public Context getThemedContext() { return mToolbar.getContext(); Loading
core/java/com/android/internal/app/WindowDecorActionBar.java +17 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,10 @@ public class WindowDecorActionBar extends ActionBar implements if (a.getBoolean(R.styleable.ActionBar_hideOnContentScroll, false)) { setHideOnContentScrollEnabled(true); } final int elevation = a.getDimensionPixelSize(R.styleable.ActionBar_elevation, 0); if (elevation != 0) { setElevation(elevation); } a.recycle(); } Loading @@ -236,6 +240,19 @@ public class WindowDecorActionBar extends ActionBar implements } } @Override public void setElevation(float elevation) { mContainerView.setElevation(elevation); if (mSplitView != null) { mSplitView.setElevation(elevation); } } @Override public float getElevation() { return mContainerView.getElevation(); } public void onConfigurationChanged(Configuration newConfig) { setHasEmbeddedTabs(ActionBarPolicy.get(mContext).hasEmbeddedTabs()); } Loading
core/res/res/values/attrs.xml +10 −0 Original line number Diff line number Diff line Loading @@ -6783,10 +6783,20 @@ <attr name="itemPadding" format="dimension" /> <!-- Set true to hide the action bar on a vertical nested scroll of content. --> <attr name="hideOnContentScroll" format="boolean" /> <!-- Minimum inset for content views within a bar. Navigation buttons and menu views are excepted. Only valid for some themes and configurations. --> <attr name="contentInsetStart" format="dimension" /> <!-- Minimum inset for content views within a bar. Navigation buttons and menu views are excepted. Only valid for some themes and configurations. --> <attr name="contentInsetEnd" format="dimension" /> <!-- Minimum inset for content views within a bar. Navigation buttons and menu views are excepted. Only valid for some themes and configurations. --> <attr name="contentInsetLeft" format="dimension" /> <!-- Minimum inset for content views within a bar. Navigation buttons and menu views are excepted. Only valid for some themes and configurations. --> <attr name="contentInsetRight" format="dimension" /> <!-- Elevation for the action bar itself --> <attr name="elevation" /> </declare-styleable> <declare-styleable name="ActionMode"> Loading