Bug 1106935 - Remove NewTabletUI branch in ActionBarViewFlipper. r=mhaigh
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 02 Apr 2015 16:18:01 -0700
changeset 256505 c1befe2261fcebc08dd7df6b22c5a927308cbe0c
parent 256504 e581a1f5129743549dc83c9e9875e2648716456e
child 256506 57c22ce3666a5f0774b3c9101e843bfb4f0495e2
push id1483
push usermichael.l.comella@gmail.com
push dateFri, 10 Apr 2015 15:12:05 +0000
reviewersmhaigh
bugs1106935
milestone40.0a1
Bug 1106935 - Remove NewTabletUI branch in ActionBarViewFlipper. r=mhaigh
mobile/android/base/moz.build
mobile/android/base/resources/layout/gecko_app.xml
mobile/android/base/resources/values-large-v11/dimens.xml
mobile/android/base/resources/values/dimens.xml
mobile/android/base/toolbar/ActionBarViewFlipper.java
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -440,17 +440,16 @@ gbjar.sources += [
     'tabs/TabsPanel.java',
     'Telemetry.java',
     'TelemetryContract.java',
     'TextSelection.java',
     'TextSelectionHandle.java',
     'ThumbnailHelper.java',
     'tiles/Tile.java',
     'tiles/TilesRecorder.java',
-    'toolbar/ActionBarViewFlipper.java',
     'toolbar/AutocompleteHandler.java',
     'toolbar/BackButton.java',
     'toolbar/BrowserToolbar.java',
     'toolbar/BrowserToolbarPhone.java',
     'toolbar/BrowserToolbarPhoneBase.java',
     'toolbar/BrowserToolbarPreHC.java',
     'toolbar/BrowserToolbarTablet.java',
     'toolbar/BrowserToolbarTabletBase.java',
--- a/mobile/android/base/resources/layout/gecko_app.xml
+++ b/mobile/android/base/resources/layout/gecko_app.xml
@@ -93,20 +93,20 @@
 
             <ViewStub android:id="@+id/new_tablet_tab_strip"
                       android:inflatedId="@id/new_tablet_tab_strip"
                       android:layout="@layout/new_tablet_tab_strip"
                       android:layout_width="match_parent"
                       android:layout_height="@dimen/new_tablet_tab_strip_height"
                       android:visibility="gone"/>
 
-            <org.mozilla.gecko.toolbar.ActionBarViewFlipper
+            <org.mozilla.gecko.widget.GeckoViewFlipper
                 android:id="@+id/browser_actionbar"
                 android:layout_width="match_parent"
-                android:layout_height="@dimen/browser_toolbar_height"
+                android:layout_height="@dimen/browser_toolbar_height_flipper"
                 android:clickable="true"
                 android:focusable="true">
 
                 <org.mozilla.gecko.toolbar.BrowserToolbar
                     android:id="@+id/browser_toolbar"
                     style="@style/BrowserToolbar"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
@@ -114,17 +114,17 @@
                     android:focusable="true"
                     android:background="@drawable/url_bar_bg"/>
 
                 <org.mozilla.gecko.ActionModeCompatView android:id="@+id/actionbar"
                                                         android:layout_height="match_parent"
                                                         android:layout_width="match_parent"
                                                         style="@style/GeckoActionBar"/>
 
-            </org.mozilla.gecko.toolbar.ActionBarViewFlipper>
+            </org.mozilla.gecko.widget.GeckoViewFlipper>
 
         </LinearLayout>
 
         <org.mozilla.gecko.toolbar.ToolbarProgressView android:id="@+id/progress"
                                                        android:layout_width="match_parent"
                                                        android:layout_height="14dp"
                                                        android:layout_marginTop="-8dp"
                                                        android:layout_below="@id/browser_chrome"
--- a/mobile/android/base/resources/values-large-v11/dimens.xml
+++ b/mobile/android/base/resources/values-large-v11/dimens.xml
@@ -4,16 +4,17 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <resources>
 
     <dimen name="arrow_popup_container_width">400dp</dimen>
     <dimen name="doorhanger_offsetY">2dp</dimen>
 
     <dimen name="browser_toolbar_height">56dp</dimen>
+    <dimen name="browser_toolbar_height_flipper">60dp</dimen>
     <dimen name="browser_toolbar_button_padding">16dp</dimen>
     <dimen name="browser_toolbar_favicon_size">16dp</dimen>
 
     <dimen name="browser_toolbar_site_security_height">60dp</dimen>
     <dimen name="browser_toolbar_site_security_width">34dp</dimen>
     <dimen name="browser_toolbar_site_security_margin_right">1dp</dimen>
     <!-- We primarily use padding (instead of margins) to increase the hit area. -->
     <dimen name="browser_toolbar_site_security_padding_vertical">21dp</dimen>
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -6,16 +6,19 @@
 <resources>
 
     <dimen name="button_corner_radius">3dp</dimen>
 
     <dimen name="autocomplete_min_width">200dp</dimen>
     <dimen name="autocomplete_row_height">32dp</dimen>
 
     <dimen name="browser_toolbar_height">48dp</dimen>
+    <!-- We use two different values for browser_toolbar_height on tablet
+         which is inconsistent. Temporary value until bug 1150730 is fixed. -->
+    <dimen name="browser_toolbar_height_flipper">48dp</dimen>
     <dimen name="browser_toolbar_button_padding">12dp</dimen>
     <dimen name="browser_toolbar_icon_width">48dp</dimen>
 
     <!-- favicon_size includes 4dp of right padding. We can't use margin (which would allow us to
          specify the actual size) because that would decrease the size of our hit target. -->
     <dimen name="browser_toolbar_favicon_size">21.33dip</dimen>
     <dimen name="browser_toolbar_shadow_size">2dp</dimen>
 
@@ -27,17 +30,16 @@
     <!-- This is the system default for the vertical padding for the divider of the TabWidget.
          Used to mimic the divider padding on the tablet tabs panel back button. -->
     <dimen name="new_tablet_tab_panel_divider_vertical_padding">12dp</dimen>
 
     <dimen name="new_tablet_tab_strip_height">48dp</dimen>
     <dimen name="new_tablet_tab_strip_item_width">208dp</dimen>
     <dimen name="new_tablet_tab_strip_item_margin">-28dp</dimen>
     <dimen name="new_tablet_tab_strip_fading_edge_size">15dp</dimen>
-    <dimen name="new_tablet_browser_toolbar_height">60dp</dimen>
     <dimen name="new_tablet_browser_toolbar_menu_item_width">56dp</dimen>
     <!-- Padding combines with an 18dp image to form the menu item width and height. -->
     <dimen name="new_tablet_browser_toolbar_menu_item_padding_horizontal">19dp</dimen>
     <dimen name="new_tablet_browser_toolbar_menu_item_inset_vertical">5dp</dimen>
     <dimen name="new_tablet_browser_toolbar_menu_item_inset_horizontal">3dp</dimen>
     <dimen name="new_tablet_browser_toolbar_menu_item_corner_radius">5dp</dimen>
     <dimen name="new_tablet_tab_strip_button_inset">5dp</dimen>
     <dimen name="forward_default_offset">-13dip</dimen>
deleted file mode 100644
--- a/mobile/android/base/toolbar/ActionBarViewFlipper.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.toolbar;
-
-import org.mozilla.gecko.NewTabletUI;
-import org.mozilla.gecko.R;
-import org.mozilla.gecko.widget.GeckoViewFlipper;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.ViewGroup;
-
-//TODO: (bug 1058909) Remove this class when old tablet is removed.
-/**
- * A temporary view that sets its height based on whether we are on new tablet or not.
- * Note that this view should be removed when the old tablet is removed and replaced with using
- * browser_toolbar_height directly.
- */
-public class ActionBarViewFlipper extends GeckoViewFlipper {
-
-    public ActionBarViewFlipper(final Context context, final AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    @Override
-    public void onAttachedToWindow() {
-        super.onAttachedToWindow();
-
-        if (NewTabletUI.isEnabled(getContext())) {
-            final ViewGroup.LayoutParams lp = getLayoutParams();
-            lp.height = getResources().getDimensionPixelSize(R.dimen.new_tablet_browser_toolbar_height);
-            setLayoutParams(lp);
-        }
-    }
-}