Bug 1107636 - Change gecko_layout to FrameLayout. r=sebastian
☠☠ backed out by 5f9371f97e1e ☠ ☠
authorMichael Comella <michael.l.comella@gmail.com>
Fri, 06 Nov 2015 16:17:48 -0800
changeset 308408 2b6f2bcfe767c326e67e8d89b2b3cb7d9f9ec849
parent 308407 014b8c296cec893ebad9df2c18b874360d99e74b
child 308409 c575729788a7bb3c6632a4a29063c0d5c4150629
push id7470
push users.kaspari@gmail.com
push dateThu, 12 Nov 2015 12:51:02 +0000
reviewerssebastian
bugs1107636
milestone45.0a1
Bug 1107636 - Change gecko_layout to FrameLayout. r=sebastian Changes on first three measure passes (CPU time): 1) 13.149ms -> 11.934ms 2) .827ms -> .582ms 3) 11.602 -> 12.199ms
mobile/android/base/GeckoApp.java
mobile/android/base/resources/layout/gecko_app.xml
mobile/android/base/resources/layout/shared_ui_components.xml
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -168,17 +168,17 @@ public abstract class GeckoApp
 
     // Delay before running one-time "cleanup" tasks that may be needed
     // after a version upgrade.
     private static final int CLEANUP_DEFERRAL_SECONDS = 15;
 
     protected View mRootLayout;
     protected RelativeLayout mMainLayout;
 
-    protected RelativeLayout mGeckoLayout;
+    protected View mGeckoLayout;
     private View mCameraView;
     private OrientationEventListener mCameraOrientationEventListener;
     public List<GeckoAppShell.AppStateListener> mAppStateListeners = new LinkedList<GeckoAppShell.AppStateListener>();
     protected MenuPanel mMenuPanel;
     protected Menu mMenu;
     protected GeckoProfile mProfile;
     protected boolean mIsRestoringActivity;
 
@@ -1381,17 +1381,17 @@ public abstract class GeckoApp
         super.onCreate(savedInstanceState);
 
         GeckoScreenOrientation.getInstance().update(getResources().getConfiguration().orientation);
 
         setContentView(getLayout());
 
         // Set up Gecko layout.
         mRootLayout = findViewById(android.R.id.content);
-        mGeckoLayout = (RelativeLayout) findViewById(R.id.gecko_layout);
+        mGeckoLayout = findViewById(R.id.gecko_layout);
         mMainLayout = (RelativeLayout) findViewById(R.id.main_layout);
         mLayerView = (LayerView) findViewById(R.id.layer_view);
 
         // Use global layout state change to kick off additional initialization
         mMainLayout.getViewTreeObserver().addOnGlobalLayoutListener(this);
 
         // Determine whether we should restore tabs.
         mShouldRestore = getSessionRestoreState(savedInstanceState);
--- a/mobile/android/base/resources/layout/gecko_app.xml
+++ b/mobile/android/base/resources/layout/gecko_app.xml
@@ -11,21 +11,21 @@
               android:layout_height="match_parent"/>
 
    <view class="org.mozilla.gecko.GeckoApp$MainLayout"
          android:id="@+id/main_layout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@android:color/transparent">
 
-        <RelativeLayout android:id="@+id/gecko_layout"
-                        android:layout_width="match_parent"
-                        android:layout_height="match_parent"
-                        android:layout_below="@+id/tablet_tab_strip"
-                        android:layout_above="@+id/find_in_page">
+        <FrameLayout android:id="@+id/gecko_layout"
+                     android:layout_width="match_parent"
+                     android:layout_height="match_parent"
+                     android:layout_below="@+id/tablet_tab_strip"
+                     android:layout_above="@+id/find_in_page">
 
             <include layout="@layout/shared_ui_components"/>
 
             <ViewStub android:id="@+id/zoomed_view_stub"
                       android:inflatedId="@+id/zoomed_view"
                       android:layout="@layout/zoomed_view"
                       android:layout_width="wrap_content"
                       android:layout_height="wrap_content" />
@@ -56,17 +56,17 @@
             <View android:id="@+id/doorhanger_overlay"
                   android:layout_width="match_parent"
                   android:layout_height="match_parent"
                   android:background="@color/dark_transparent_overlay"
                   android:visibility="gone"
                   android:alpha="0"
                   android:layerType="hardware"/>
 
-        </RelativeLayout>
+        </FrameLayout>
 
         <org.mozilla.gecko.FindInPageBar android:id="@+id/find_in_page"
                                          android:layout_width="match_parent"
                                          android:layout_height="wrap_content"
                                          android:layout_alignParentBottom="true"
                                          style="@style/FindBar"
                                          android:visibility="gone"/>
 
--- a/mobile/android/base/resources/layout/shared_ui_components.xml
+++ b/mobile/android/base/resources/layout/shared_ui_components.xml
@@ -25,13 +25,12 @@
                                        android:layout_height="match_parent"
                                        android:visibility="gone"/>
 
     <include layout="@layout/text_selection_handles"/>
 
     <FrameLayout android:id="@+id/camera_layout"
                  android:layout_height="wrap_content"
                  android:layout_width="wrap_content"
-                 android:layout_alignParentRight="true"
-                 android:layout_alignParentBottom="true">
+                 android:layout_gravity="bottom|right">
     </FrameLayout>
 
 </merge>