Introducing the split action bar.

Apply (or extend) the theme Theme.Holo.SplitActionBarWhenNarrow or
Theme.Holo.Light.SplitActionBarWhenNarrow to enable splitting the
action bar across both the top and bottom of the screen. This places
the action menu along the bottom, leaving more room at the top for
titles, navigation, and custom views and more room at the bottom for
menu items.

TODO: Refine layout of the action menu when placed at the bottom of
the screen. Make action modes split as well.

Change-Id: I92c91f99c533f26aecf6b828ed041386c4f16922
diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java
index dccfa6c..57df259 100644
--- a/core/java/com/android/internal/app/ActionBarImpl.java
+++ b/core/java/com/android/internal/app/ActionBarImpl.java
@@ -71,7 +71,7 @@
     private ActionBarContainer mContainerView;
     private ActionBarView mActionView;
     private ActionBarContextView mUpperContextView;
-    private LinearLayout mLowerContextView;
+    private LinearLayout mLowerView;
     private View mContentView;
     private ViewGroup mExternalTabView;
 
@@ -106,8 +106,8 @@
             new AnimatorListenerAdapter() { // NORMAL_VIEW
                 @Override
                 public void onAnimationEnd(Animator animation) {
-                    if (mLowerContextView != null) {
-                        mLowerContextView.removeAllViews();
+                    if (mLowerView != null) {
+                        mLowerView.removeAllViews();
                     }
                     mCurrentModeAnim = null;
                     hideAllExcept(NORMAL_VIEW);
@@ -162,7 +162,7 @@
         mActionView = (ActionBarView) decor.findViewById(com.android.internal.R.id.action_bar);
         mUpperContextView = (ActionBarContextView) decor.findViewById(
                 com.android.internal.R.id.action_context_bar);
-        mLowerContextView = (LinearLayout) decor.findViewById(
+        mLowerView = (LinearLayout) decor.findViewById(
                 com.android.internal.R.id.lower_action_context_bar);
         mContainerView = (ActionBarContainer) decor.findViewById(
                 com.android.internal.R.id.action_bar_container);
@@ -173,8 +173,8 @@
         }
 
         mActionView.setContextView(mUpperContextView);
-        mContextDisplayMode = mLowerContextView == null ?
-                CONTEXT_DISPLAY_NORMAL : CONTEXT_DISPLAY_SPLIT;
+        mContextDisplayMode = mActionView.isSplitActionBar() ?
+                CONTEXT_DISPLAY_SPLIT : CONTEXT_DISPLAY_NORMAL;
 
         if (!mActionView.hasEmbeddedTabs()) {
             HorizontalScrollView tabScroller = new HorizontalScrollView(mContext);
@@ -348,9 +348,9 @@
             mode.invalidate();
             mUpperContextView.initForMode(mode);
             animateTo(CONTEXT_VIEW);
-            if (mLowerContextView != null) {
+            if (mLowerView != null) {
                 // TODO animate this
-                mLowerContextView.setVisibility(View.VISIBLE);
+                mLowerView.setVisibility(View.VISIBLE);
             }
             mActionMode = mode;
             return mode;
@@ -616,9 +616,9 @@
 
             // Clear out the context mode views after the animation finishes
             mUpperContextView.closeMode();
-            if (mLowerContextView != null && mLowerContextView.getVisibility() != View.GONE) {
+            if (mLowerView != null && mLowerView.getVisibility() != View.GONE) {
                 // TODO Animate this
-                mLowerContextView.setVisibility(View.GONE);
+                mLowerView.setVisibility(View.GONE);
             }
             mActionMode = null;