diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index 48214eb8259d..000d60dcea05 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -1378,7 +1378,7 @@ public class BrowserApp extends GeckoApp } private void setToolbarMargin(int margin) { - ((ViewGroup.MarginLayoutParams) mGeckoLayout.getLayoutParams()).topMargin = margin; + ((RelativeLayout.LayoutParams) mGeckoLayout.getLayoutParams()).topMargin = margin; mGeckoLayout.requestLayout(); } diff --git a/mobile/android/base/FormAssistPopup.java b/mobile/android/base/FormAssistPopup.java index 0fca6192806c..dea75681ed83 100644 --- a/mobile/android/base/FormAssistPopup.java +++ b/mobile/android/base/FormAssistPopup.java @@ -5,7 +5,6 @@ package org.mozilla.gecko; -import android.widget.FrameLayout; import org.mozilla.gecko.animation.ViewHelper; import org.mozilla.gecko.gfx.FloatSize; import org.mozilla.gecko.gfx.ImmutableViewportMetrics; @@ -361,7 +360,7 @@ public class FormAssistPopup extends RelativeLayout implements GeckoEventListene } } - final FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(popupWidth, popupHeight); + LayoutParams layoutParams = new LayoutParams(popupWidth, popupHeight); layoutParams.setMargins(popupLeft, popupTop, 0, 0); setLayoutParams(layoutParams); requestLayout(); diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 62153c97c018..01f4238e9766 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -170,10 +170,10 @@ public abstract class GeckoApp // after a version upgrade. private static final int CLEANUP_DEFERRAL_SECONDS = 15; - protected View mRootLayout; + protected RelativeLayout mRootLayout; protected RelativeLayout mMainLayout; - protected View mGeckoLayout; + protected RelativeLayout mGeckoLayout; private View mCameraView; private OrientationEventListener mCameraOrientationEventListener; public List mAppStateListeners = new LinkedList(); @@ -1385,8 +1385,8 @@ public abstract class GeckoApp setContentView(getLayout()); // Set up Gecko layout. - mRootLayout = findViewById(android.R.id.content); - mGeckoLayout = findViewById(R.id.gecko_layout); + mRootLayout = (RelativeLayout) findViewById(R.id.root_layout); + mGeckoLayout = (RelativeLayout) findViewById(R.id.gecko_layout); mMainLayout = (RelativeLayout) findViewById(R.id.main_layout); mLayerView = (LayerView) findViewById(R.id.layer_view); diff --git a/mobile/android/base/TextSelectionHandle.java b/mobile/android/base/TextSelectionHandle.java index a21da31256c5..ae5e31c8328b 100644 --- a/mobile/android/base/TextSelectionHandle.java +++ b/mobile/android/base/TextSelectionHandle.java @@ -4,7 +4,6 @@ package org.mozilla.gecko; -import android.view.ViewGroup; import org.mozilla.gecko.animation.ViewHelper; import org.mozilla.gecko.gfx.ImmutableViewportMetrics; import org.mozilla.gecko.gfx.LayerView; @@ -20,6 +19,7 @@ import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.widget.ImageView; +import android.widget.RelativeLayout; /** * Text selection handles enable a user to change position of selected text in @@ -57,7 +57,7 @@ class TextSelectionHandle extends ImageView implements View.OnTouchListener { private PointF mGeckoPoint; private PointF mTouchStart; - private ViewGroup.MarginLayoutParams mLayoutParams; + private RelativeLayout.LayoutParams mLayoutParams; private static final int IMAGE_LEVEL_LTR = 0; private static final int IMAGE_LEVEL_RTL = 1; @@ -204,7 +204,7 @@ class TextSelectionHandle extends ImageView implements View.OnTouchListener { private void setLayoutPosition() { if (mLayoutParams == null) { - mLayoutParams = (ViewGroup.MarginLayoutParams) getLayoutParams(); + mLayoutParams = (RelativeLayout.LayoutParams) getLayoutParams(); // Set negative right/bottom margins so that the handles can be dragged outside of // the content area (if they are dragged to the left/top, the dyanmic margins set // below will take care of that). diff --git a/mobile/android/base/ZoomedView.java b/mobile/android/base/ZoomedView.java index 86d2aea660c9..76b976f98ede 100644 --- a/mobile/android/base/ZoomedView.java +++ b/mobile/android/base/ZoomedView.java @@ -200,7 +200,7 @@ public class ZoomedView extends FrameLayout implements LayerView.DynamicToolbarL } private boolean moveZoomedView(MotionEvent event) { - final MarginLayoutParams params = (MarginLayoutParams) ZoomedView.this.getLayoutParams(); + RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) ZoomedView.this.getLayoutParams(); if ((!dragged) && (Math.abs((int) (event.getRawX() - originRawX)) < PanZoomController.CLICK_THRESHOLD) && (Math.abs((int) (event.getRawY() - originRawY)) < PanZoomController.CLICK_THRESHOLD)) { // When the user just touches the screen ACTION_MOVE can be detected for a very small delta on position. @@ -315,7 +315,7 @@ public class ZoomedView extends FrameLayout implements LayerView.DynamicToolbarL ImmutableViewportMetrics metrics = layerView.getViewportMetrics(); final float parentWidth = metrics.getWidth(); final float parentHeight = metrics.getHeight(); - final MarginLayoutParams params = (MarginLayoutParams) getLayoutParams(); + RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) getLayoutParams(); // The number of unzoomed content pixels that can be displayed in the // zoomed area. @@ -382,7 +382,7 @@ public class ZoomedView extends FrameLayout implements LayerView.DynamicToolbarL private void moveZoomedView(ImmutableViewportMetrics metrics, float newLeftMargin, float newTopMargin, StartPointUpdate animateStartPoint) { - final MarginLayoutParams newLayoutParams = (MarginLayoutParams) getLayoutParams(); + RelativeLayout.LayoutParams newLayoutParams = (RelativeLayout.LayoutParams) getLayoutParams(); newLayoutParams.leftMargin = (int) newLeftMargin; newLayoutParams.topMargin = (int) newTopMargin; int topMarginMin = (int)(layerView.getSurfaceTranslation() + dynamicToolbarOverlap); @@ -478,7 +478,7 @@ public class ZoomedView extends FrameLayout implements LayerView.DynamicToolbarL return; } - final MarginLayoutParams params = (MarginLayoutParams) getLayoutParams(); + RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) getLayoutParams(); setCapturedSize(viewport); moveZoomedView(viewport, params.leftMargin, params.topMargin, StartPointUpdate.NO_CHANGE); } diff --git a/mobile/android/base/resources/layout/gecko_app.xml b/mobile/android/base/resources/layout/gecko_app.xml index 0315b661f8c0..a9023495d8a0 100644 --- a/mobile/android/base/resources/layout/gecko_app.xml +++ b/mobile/android/base/resources/layout/gecko_app.xml @@ -3,7 +3,10 @@ - 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/. --> - + - + @@ -61,7 +64,7 @@ android:alpha="0" android:layerType="hardware"/> - + - + diff --git a/mobile/android/base/resources/layout/shared_ui_components.xml b/mobile/android/base/resources/layout/shared_ui_components.xml index 358deb093678..4ccb3e22161d 100644 --- a/mobile/android/base/resources/layout/shared_ui_components.xml +++ b/mobile/android/base/resources/layout/shared_ui_components.xml @@ -30,7 +30,8 @@ + android:layout_alignParentRight="true" + android:layout_alignParentBottom="true"> diff --git a/mobile/android/base/resources/layout/web_app.xml b/mobile/android/base/resources/layout/web_app.xml index 5cd732e62033..58ed42987b1d 100644 --- a/mobile/android/base/resources/layout/web_app.xml +++ b/mobile/android/base/resources/layout/web_app.xml @@ -20,10 +20,10 @@ - + @@ -50,7 +50,7 @@ - + @drawable/toast_background match_parent wrap_content + true + true bottom|center_horizontal 64dp 0dp