Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 943fbb4f authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "ActionBar overlay mode, height fetching, show/hide"

parents 73b77af8 6b336f83
Loading
Loading
Loading
Loading
+68 −2
Original line number Original line Diff line number Diff line
@@ -10580,6 +10580,17 @@
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="windowActionBarOverlay"
 type="int"
 transient="false"
 volatile="false"
 value="16843558"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="windowActionBarStyle"
<field name="windowActionBarStyle"
 type="int"
 type="int"
 transient="false"
 transient="false"
@@ -20936,6 +20947,17 @@
 visibility="public"
 visibility="public"
>
>
</method>
</method>
<method name="getHeight"
 return="int"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getNavigationMode"
<method name="getNavigationMode"
 return="int"
 return="int"
 abstract="true"
 abstract="true"
@@ -20980,6 +21002,17 @@
 visibility="public"
 visibility="public"
>
>
</method>
</method>
<method name="hide"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="insertTab"
<method name="insertTab"
 return="void"
 return="void"
 abstract="true"
 abstract="true"
@@ -20995,6 +21028,17 @@
<parameter name="position" type="int">
<parameter name="position" type="int">
</parameter>
</parameter>
</method>
</method>
<method name="isShowing"
 return="boolean"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="newTab"
<method name="newTab"
 return="android.app.ActionBar.Tab"
 return="android.app.ActionBar.Tab"
 abstract="true"
 abstract="true"
@@ -21287,6 +21331,17 @@
<parameter name="resId" type="int">
<parameter name="resId" type="int">
</parameter>
</parameter>
</method>
</method>
<method name="show"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<field name="DISPLAY_HIDE_HOME"
<field name="DISPLAY_HIDE_HOME"
 type="int"
 type="int"
 transient="false"
 transient="false"
@@ -201148,7 +201203,7 @@
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="FEATURE_ACTION_MODE_OVERLAY"
<field name="FEATURE_ACTION_BAR_OVERLAY"
 type="int"
 type="int"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
@@ -201159,6 +201214,17 @@
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="FEATURE_ACTION_MODE_OVERLAY"
 type="int"
 transient="false"
 volatile="false"
 value="10"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="FEATURE_CONTEXT_MENU"
<field name="FEATURE_CONTEXT_MENU"
 type="int"
 type="int"
 transient="false"
 transient="false"
@@ -201185,7 +201251,7 @@
 type="int"
 type="int"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
 value="10"
 value="11"
 static="true"
 static="true"
 final="true"
 final="true"
 deprecated="not deprecated"
 deprecated="not deprecated"
+29 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@ package android.app;


import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.View;
import android.view.Window;
import android.widget.SpinnerAdapter;
import android.widget.SpinnerAdapter;


/**
/**
@@ -382,6 +383,34 @@ public abstract class ActionBar {
     */
     */
    public abstract void selectTab(Tab tab);
    public abstract void selectTab(Tab tab);


    /**
     * Retrieve the current height of the ActionBar.
     *
     * @return The ActionBar's height
     */
    public abstract int getHeight();

    /**
     * Show the ActionBar if it is not currently showing.
     * If the window hosting the ActionBar does not have the feature
     * {@link Window#FEATURE_ACTION_BAR_OVERLAY} it will resize application
     * content to fit the new space available.
     */
    public abstract void show();

    /**
     * Hide the ActionBar if it is not currently showing.
     * If the window hosting the ActionBar does not have the feature
     * {@link Window#FEATURE_ACTION_BAR_OVERLAY} it will resize application
     * content to fit the new space available.
     */
    public abstract void hide();

    /**
     * @return <code>true</code> if the ActionBar is showing, <code>false</code> otherwise.
     */
    public abstract boolean isShowing();

    /**
    /**
     * Callback interface for ActionBar navigation events. 
     * Callback interface for ActionBar navigation events. 
     */
     */
+12 −2
Original line number Original line Diff line number Diff line
@@ -63,15 +63,25 @@ public abstract class Window {
     * for an on-screen menu button on some devices.
     * for an on-screen menu button on some devices.
     */
     */
    public static final int FEATURE_ACTION_BAR = 8;
    public static final int FEATURE_ACTION_BAR = 8;
    /**
     * Flag for requesting an Action Bar that overlays window content.
     * Normally an Action Bar will sit in the space above window content, but if this
     * feature is requested along with {@link #FEATURE_ACTION_BAR} it will be layered over
     * the window content itself. This is useful if you would like your app to have more control
     * over how the Action Bar is displayed, such as letting application content scroll beneath
     * an Action Bar with a transparent background or otherwise displaying a transparent/translucent
     * Action Bar over application content.
     */
    public static final int FEATURE_ACTION_BAR_OVERLAY = 9;
    /**
    /**
     * Flag for specifying the behavior of action modes when an Action Bar is not present.
     * Flag for specifying the behavior of action modes when an Action Bar is not present.
     * If overlay is enabled, the action mode UI will be allowed to cover existing window content.
     * If overlay is enabled, the action mode UI will be allowed to cover existing window content.
     */
     */
    public static final int FEATURE_ACTION_MODE_OVERLAY = 9;
    public static final int FEATURE_ACTION_MODE_OVERLAY = 10;
    /**
    /**
     * Flag for requesting this window to be hardware accelerated, if possible. 
     * Flag for requesting this window to be hardware accelerated, if possible. 
     */
     */
    public static final int FEATURE_HARDWARE_ACCELERATED = 10;
    public static final int FEATURE_HARDWARE_ACCELERATED = 11;
    /** Flag for setting the progress bar's visibility to VISIBLE */
    /** Flag for setting the progress bar's visibility to VISIBLE */
    public static final int PROGRESS_VISIBILITY_ON = -1;
    public static final int PROGRESS_VISIBILITY_ON = -1;
    /** Flag for setting the progress bar's visibility to GONE */
    /** Flag for setting the progress bar's visibility to GONE */
+21 −0
Original line number Original line Diff line number Diff line
@@ -397,6 +397,27 @@ public class ActionBarImpl extends ActionBar {
        trans.commit();
        trans.commit();
    }
    }


    @Override
    public int getHeight() {
        return mActionView.getHeight();
    }

    @Override
    public void show() {
        // TODO animate!
        mAnimatorView.setVisibility(View.VISIBLE);
    }

    @Override
    public void hide() {
        // TODO animate!
        mAnimatorView.setVisibility(View.GONE);
    }

    public boolean isShowing() {
        return mAnimatorView.getVisibility() == View.VISIBLE;
    }

    /**
    /**
     * @hide 
     * @hide 
     */
     */
+3 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.ViewGroup;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.LinearLayout;
@@ -82,6 +83,7 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo
        if (p instanceof LayoutParams) {
        if (p instanceof LayoutParams) {
            LayoutParams lp = (LayoutParams) p;
            LayoutParams lp = (LayoutParams) p;
            return lp.leftMargin == mItemMargin && lp.rightMargin == mItemMargin &&
            return lp.leftMargin == mItemMargin && lp.rightMargin == mItemMargin &&
                    lp.gravity == Gravity.CENTER_VERTICAL &&
                    lp.width == LayoutParams.WRAP_CONTENT && lp.height == LayoutParams.WRAP_CONTENT;
                    lp.width == LayoutParams.WRAP_CONTENT && lp.height == LayoutParams.WRAP_CONTENT;
        }
        }
        return false;
        return false;
@@ -93,6 +95,7 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo
                LayoutParams.WRAP_CONTENT);
                LayoutParams.WRAP_CONTENT);
        params.leftMargin = mItemMargin;
        params.leftMargin = mItemMargin;
        params.rightMargin = mItemMargin;
        params.rightMargin = mItemMargin;
        params.gravity = Gravity.CENTER_VERTICAL;
        return params;
        return params;
    }
    }
    
    
Loading