Backed out changeset d795db527abd (bug 1127901) for possible Android debug asserts/crashes.
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 04 May 2015 12:40:05 -0400
changeset 273590 18d878c18fa9b83f739c54ced7ff71ff8582cc40
parent 273589 920b1705a2428b262cd88117e97fd3e19cf5ab28
child 273591 42152093a51c12cc7ee450631a031d0d4f4667b8
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1127901
milestone40.0a1
backs outd795db527abd13331010bdc99f673075086f2800
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset d795db527abd (bug 1127901) for possible Android debug asserts/crashes. CLOSED TREE
mobile/android/base/ZoomedView.java
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/resources/layout/zoomed_view.xml
mobile/android/base/resources/values/dimens.xml
mobile/android/base/strings.xml.in
--- a/mobile/android/base/ZoomedView.java
+++ b/mobile/android/base/ZoomedView.java
@@ -12,113 +12,63 @@ import org.mozilla.gecko.gfx.PointUtils;
 import org.mozilla.gecko.mozglue.DirectBufferAllocator;
 import org.mozilla.gecko.util.GeckoEventListener;
 import org.mozilla.gecko.util.ThreadUtils;
 
 import org.json.JSONException;
 import org.json.JSONObject;
 
 import android.content.Context;
-import android.content.res.Resources;
 import android.content.res.Configuration;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
-import android.graphics.BitmapShader;
-import android.graphics.Canvas;
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.Matrix;
-import android.graphics.Paint;
 import android.graphics.Point;
 import android.graphics.PointF;
-import android.graphics.RectF;
-import android.graphics.Shader;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewTreeObserver;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.RelativeLayout;
-import android.widget.TextView;
 
 import java.nio.ByteBuffer;
 import java.text.DecimalFormat;
 
 public class ZoomedView extends FrameLayout implements LayerView.OnMetricsChangedListener,
         LayerView.ZoomedViewListener, GeckoEventListener {
     private static final String LOGTAG = "Gecko" + ZoomedView.class.getSimpleName();
 
-    private static final float[] ZOOM_FACTORS_LIST = {2.0f, 3.0f, 1.5f};
-    private static final int W_CAPTURED_VIEW_IN_PERCENT = 50;
+    private static final int DEFAULT_ZOOM_FACTOR = 3;
+    private static final int W_CAPTURED_VIEW_IN_PERCENT = 80;
     private static final int H_CAPTURED_VIEW_IN_PERCENT = 50;
     private static final int MINIMUM_DELAY_BETWEEN_TWO_RENDER_CALLS_NS = 1000000;
     private static final int DELAY_BEFORE_NEXT_RENDER_REQUEST_MS = 2000;
 
-    private float zoomFactor;
-    private int currentZoomFactorIndex;
+    private int zoomFactor;
     private ImageView zoomedImageView;
     private LayerView layerView;
     private int viewWidth;
-    private int viewHeight; // Only the zoomed view height, no toolbar, no shadow ...
-    private int viewContainerWidth;
-    private int viewContainerHeight; // Zoomed view height with toolbar and other elements like shadow, ...
-    private int containterSize; // shadow, margin, ...
+    private int viewHeight;
     private Point lastPosition;
     private boolean shouldSetVisibleOnUpdate;
     private PointF returnValue;
-    private ImageView closeButton;
-    private TextView changeZoomFactorButton;
-    private boolean toolbarOnTop;
-    private float offsetDueToToolBarPosition;
-    private int toolbarHeight;
-    private int cornerRadius;
 
     private boolean stopUpdateView;
 
     private int lastOrientation;
 
     private ByteBuffer buffer;
     private Runnable requestRenderRunnable;
     private long startTimeReRender;
     private long lastStartTimeReRender;
 
-    private class RoundedBitmapDrawable extends BitmapDrawable {
-        private Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG | Paint.DITHER_FLAG);
-        final float cornerRadius;
-        final boolean squareOnTopOfDrawable;
-
-        RoundedBitmapDrawable(Resources res, Bitmap bitmap, boolean squareOnTop, int radius) {
-            super(res, bitmap);
-            squareOnTopOfDrawable = squareOnTop;
-            final BitmapShader shader = new BitmapShader(bitmap, Shader.TileMode.CLAMP,
-                Shader.TileMode.CLAMP);
-            paint.setAntiAlias(true);
-            paint.setShader(shader);
-            cornerRadius = radius;
-        }
-
-        @Override
-        public void draw(Canvas canvas) {
-            int height = getBounds().height();
-            int width = getBounds().width();
-            RectF rect = new RectF(0.0f, 0.0f, width, height);
-            canvas.drawRoundRect(rect, cornerRadius, cornerRadius, paint);
-
-            //draw rectangles over the corners we want to be square
-            if (squareOnTopOfDrawable) {
-                canvas.drawRect(0, 0, cornerRadius, cornerRadius, paint);
-                canvas.drawRect(width - cornerRadius, 0, width, cornerRadius, paint);
-            } else {
-                canvas.drawRect(0, height - cornerRadius, cornerRadius, height, paint);
-                canvas.drawRect(width - cornerRadius, height - cornerRadius, width, height, paint);
-            }
-        }
-    }
-
     private class ZoomedViewTouchListener implements View.OnTouchListener {
         private float originRawX;
         private float originRawY;
         private boolean dragged;
         private MotionEvent actionDownEvent;
 
         @Override
         public boolean onTouch(View view, MotionEvent event) {
@@ -132,49 +82,42 @@ public class ZoomedView extends FrameLay
                     dragged = true;
                 }
                 break;
 
             case MotionEvent.ACTION_UP:
                 if (dragged) {
                     dragged = false;
                 } else {
-                    if (isClickInZoomedView(event.getY())) {
-                        GeckoEvent eClickInZoomedView = GeckoEvent.createBroadcastEvent("Gesture:ClickInZoomedView", "");
-                        GeckoAppShell.sendEventToGecko(eClickInZoomedView);
-                        layerView.dispatchTouchEvent(actionDownEvent);
-                        actionDownEvent.recycle();
-                        PointF convertedPosition = getUnzoomedPositionFromPointInZoomedView(event.getX(), event.getY());
-                        MotionEvent e = MotionEvent.obtain(event.getDownTime(), event.getEventTime(),
-                                MotionEvent.ACTION_UP, convertedPosition.x, convertedPosition.y,
-                                event.getMetaState());
-                        layerView.dispatchTouchEvent(e);
-                        e.recycle();
-                    }
+                    GeckoEvent eClickInZoomedView = GeckoEvent.createBroadcastEvent("Gesture:ClickInZoomedView", "");
+                    GeckoAppShell.sendEventToGecko(eClickInZoomedView);
+                    layerView.dispatchTouchEvent(actionDownEvent);
+                    actionDownEvent.recycle();
+                    PointF convertedPosition = getUnzoomedPositionFromPointInZoomedView(event.getX(), event.getY());
+                    MotionEvent e = MotionEvent.obtain(event.getDownTime(), event.getEventTime(),
+                            MotionEvent.ACTION_UP, convertedPosition.x, convertedPosition.y,
+                            event.getMetaState());
+                    layerView.dispatchTouchEvent(e);
+                    e.recycle();
                 }
                 break;
 
             case MotionEvent.ACTION_DOWN:
                 dragged = false;
                 originRawX = event.getRawX();
                 originRawY = event.getRawY();
                 PointF convertedPosition = getUnzoomedPositionFromPointInZoomedView(event.getX(), event.getY());
                 actionDownEvent = MotionEvent.obtain(event.getDownTime(), event.getEventTime(),
                         MotionEvent.ACTION_DOWN, convertedPosition.x, convertedPosition.y,
                         event.getMetaState());
                 break;
             }
             return true;
         }
 
-        private boolean isClickInZoomedView(float y) {
-            return ((toolbarOnTop && y > toolbarHeight) ||
-                (!toolbarOnTop && y < ZoomedView.this.viewHeight));
-        }
-
         private boolean moveZoomedView(MotionEvent event) {
             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.
                 // In this case, the move is ignored if the delta is lower than 1 unit.
                 return false;
             }
@@ -195,74 +138,54 @@ public class ZoomedView extends FrameLay
 
     public ZoomedView(Context context, AttributeSet attrs) {
         this(context, attrs, 0);
     }
 
     public ZoomedView(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
         returnValue = new PointF();
-        currentZoomFactorIndex = 0;
-        zoomFactor = ZOOM_FACTORS_LIST[currentZoomFactorIndex];
         requestRenderRunnable = new Runnable() {
             @Override
             public void run() {
                 requestZoomedViewRender();
             }
         };
-        EventDispatcher.getInstance().registerGeckoThreadListener(this,
+        EventDispatcher.getInstance().registerGeckoThreadListener(this, "Gesture:nothingDoneOnLongPress",
                 "Gesture:clusteredLinksClicked", "Window:Resize", "Content:LocationChange");
     }
 
     void destroy() {
         ThreadUtils.removeCallbacksFromUiThread(requestRenderRunnable);
-        EventDispatcher.getInstance().unregisterGeckoThreadListener(this,
+        EventDispatcher.getInstance().unregisterGeckoThreadListener(this, "Gesture:nothingDoneOnLongPress",
                 "Gesture:clusteredLinksClicked", "Window:Resize", "Content:LocationChange");
     }
 
     // This method (onFinishInflate) is called only when the zoomed view class is used inside
     // an xml structure <org.mozilla.gecko.ZoomedView ...
     // It won't be called if the class is used from java code like "new  ZoomedView(context);"
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        closeButton = (ImageView) findViewById(R.id.dialog_close);
+        ImageView closeButton = (ImageView) findViewById(R.id.dialog_close);
         closeButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View view) {
                 stopZoomDisplay();
             }
         });
 
-        changeZoomFactorButton = (TextView) findViewById(R.id.change_zoom_factor);
-        changeZoomFactorButton.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View view) {
-                changeZoomFactor();
-            }
-        });
-        setTextInZoomFactorButton(ZOOM_FACTORS_LIST[0]);
-
         zoomedImageView = (ImageView) findViewById(R.id.zoomed_image_view);
-        this.setOnTouchListener(new ZoomedViewTouchListener());
-
-        toolbarHeight = getResources().getDimensionPixelSize(R.dimen.zoomed_view_toolbar_height);
-        containterSize = getResources().getDimensionPixelSize(R.dimen.drawable_dropshadow_size);
-        cornerRadius = getResources().getDimensionPixelSize(R.dimen.button_corner_radius);
-
-        moveToolbar(true);
+        zoomedImageView.setOnTouchListener(new ZoomedViewTouchListener());
     }
 
     /*
      * Convert a click from ZoomedView. Return the position of the click in the
      * LayerView
      */
     private PointF getUnzoomedPositionFromPointInZoomedView(float x, float y) {
-        if (toolbarOnTop && y > toolbarHeight) {
-           y = y - toolbarHeight;
-        }
-
         ImmutableViewportMetrics metrics = layerView.getViewportMetrics();
         PointF offset = metrics.getMarginOffset();
         final float parentWidth = metrics.getWidth();
         final float parentHeight = metrics.getHeight();
         RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) getLayoutParams();
 
         returnValue.x = (int) ((x / zoomFactor) +     // Conversion of the x offset inside the zoomed view (using the scale factor)
 
@@ -271,25 +194,24 @@ public class ZoomedView extends FrameLay
                         /* Conversion of the left side position of the zoomed view
                          *   Minimum value for the left side of the zoomed view is 0
                          *     and we return 0 after conversion
                          *   Maximum value for the left side of the zoomed view is (parentWidth - offset.x - viewWidth)
                          *     and we return (parentWidth - offset.x - (viewWidth / zoomFactor)) after conversion.
                          */
                         (((float) params.leftMargin) - offset.x) *
                             ((parentWidth - offset.x - (viewWidth / zoomFactor)) /
-                            (parentWidth - offset.x - viewContainerWidth)));
+                            (parentWidth - offset.x - viewWidth)));
 
         // Same comments here vertically
         returnValue.y = (int) ((y / zoomFactor) +
-                        offset.y -
-                        offsetDueToToolBarPosition +
+                        offset.y +
                         (((float) params.topMargin) - offset.y) *
-                            ((parentHeight - offset.y + offsetDueToToolBarPosition - (viewHeight / zoomFactor)) /
-                            (parentHeight - offset.y - viewContainerHeight)));
+                            ((parentHeight - offset.y - (viewHeight / zoomFactor)) /
+                            (parentHeight - offset.y - viewHeight)));
 
         return returnValue;
     }
 
     /*
      * A touch point (x,y) occurs in LayerView, this point should be displayed
      * in the center of the zoomed view. The returned point is the position of
      * the Top-Left zoomed view point on the screen device
@@ -305,24 +227,24 @@ public class ZoomedView extends FrameLay
 
                         /* Conversion of the left side position of the zoomed view.
                          * See the comment in getUnzoomedPositionFromPointInZoomedView.
                          * The proportional factor is the same. It is used in a division
                          * and not in a multiplication to convert the position from
                          * the LayerView to the ZoomedView.
                          */
                         ((parentWidth - offset.x - (viewWidth / zoomFactor)) /
-                        (parentWidth - offset.x - viewContainerWidth)))
+                        (parentWidth - offset.x - viewWidth)))
 
                 + offset.x);     // The offset of the layerView
 
         // Same comments here vertically
-        returnValue.y = (int) ((((y + offsetDueToToolBarPosition - (viewHeight / (2 * zoomFactor)))) /
-                        ((parentHeight - offset.y + offsetDueToToolBarPosition - (viewHeight / zoomFactor)) /
-                        (parentHeight - offset.y - viewContainerHeight)))
+        returnValue.y = (int) ((((y - (viewHeight / (2 * zoomFactor)))) /
+                        ((parentHeight - offset.y - (viewHeight / zoomFactor)) /
+                        (parentHeight - offset.y - viewHeight)))
                 + offset.y);
 
         return returnValue;
     }
 
     private void moveZoomedView(ImmutableViewportMetrics metrics, float newLeftMargin, float newTopMargin) {
         final float parentWidth = metrics.getWidth();
         final float parentHeight = metrics.getHeight();
@@ -332,69 +254,32 @@ public class ZoomedView extends FrameLay
         int topMarginMin;
         int leftMarginMin;
         PointF offset = metrics.getMarginOffset();
         topMarginMin = (int) offset.y;
         leftMarginMin = (int) offset.x;
 
         if (newTopMargin < topMarginMin) {
             newLayoutParams.topMargin = topMarginMin;
-        } else if (newTopMargin + viewContainerHeight > parentHeight) {
-            newLayoutParams.topMargin = (int) (parentHeight - viewContainerHeight);
+        } else if (newTopMargin + viewHeight > parentHeight) {
+            newLayoutParams.topMargin = (int) (parentHeight - viewHeight);
         }
 
         if (newLeftMargin < leftMarginMin) {
             newLayoutParams.leftMargin = leftMarginMin;
-        } else if (newLeftMargin + viewContainerWidth > parentWidth) {
-            newLayoutParams.leftMargin = (int) (parentWidth - viewContainerWidth);
-        }
-
-        if (newLayoutParams.topMargin < topMarginMin + 1) {
-            moveToolbar(false);
-        } else if (newLayoutParams.topMargin + viewContainerHeight > parentHeight - 1) {
-            moveToolbar(true);
+        } else if (newLeftMargin + viewWidth > parentWidth) {
+            newLayoutParams.leftMargin = (int) (parentWidth - viewWidth);
         }
 
         setLayoutParams(newLayoutParams);
         PointF convertedPosition = getUnzoomedPositionFromPointInZoomedView(0, 0);
         lastPosition = PointUtils.round(convertedPosition);
         requestZoomedViewRender();
     }
 
-    private void moveToolbar(boolean moveTop) {
-        if (toolbarOnTop == moveTop) {
-            return;
-        }
-        toolbarOnTop = moveTop;
-        if (toolbarOnTop) {
-            offsetDueToToolBarPosition = toolbarHeight;
-        } else {
-            offsetDueToToolBarPosition = 0;
-        }
-
-        RelativeLayout.LayoutParams p = (RelativeLayout.LayoutParams) zoomedImageView.getLayoutParams();
-        RelativeLayout.LayoutParams pChangeZoomFactorButton = (RelativeLayout.LayoutParams) changeZoomFactorButton.getLayoutParams();
-        RelativeLayout.LayoutParams pCloseButton = (RelativeLayout.LayoutParams) closeButton.getLayoutParams();
-
-        if (moveTop) {
-            p.addRule(RelativeLayout.BELOW, R.id.change_zoom_factor);
-            pChangeZoomFactorButton.addRule(RelativeLayout.BELOW, 0);
-            pCloseButton.addRule(RelativeLayout.BELOW, 0);
-        } else {
-            p.addRule(RelativeLayout.BELOW, 0);
-            pChangeZoomFactorButton.addRule(RelativeLayout.BELOW, R.id.zoomed_image_view);
-            pCloseButton.addRule(RelativeLayout.BELOW, R.id.zoomed_image_view);
-        }
-        pChangeZoomFactorButton.addRule(RelativeLayout.ALIGN_LEFT, R.id.zoomed_image_view);
-        pCloseButton.addRule(RelativeLayout.ALIGN_RIGHT, R.id.zoomed_image_view);
-        zoomedImageView.setLayoutParams(p);
-        changeZoomFactorButton.setLayoutParams(pChangeZoomFactorButton);
-        closeButton.setLayoutParams(pCloseButton);
-    }
-
     @Override
     public void onConfigurationChanged(Configuration newConfig) {
         super.onConfigurationChanged(newConfig);
         // In case of orientation change, the zoomed view update is stopped until the orientation change
         // is completed. At this time, the function onMetricsChanged is called and the
         // zoomed view update is restarted again.
         if (lastOrientation != newConfig.orientation) {
             shouldBlockUpdate(true);
@@ -409,22 +294,23 @@ public class ZoomedView extends FrameLay
 
         RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) getLayoutParams();
         setCapturedSize(viewport);
         moveZoomedView(viewport, params.leftMargin, params.topMargin);
     }
 
     private void setCapturedSize(ImmutableViewportMetrics metrics) {
         float parentMinSize = Math.min(metrics.getWidth(), metrics.getHeight());
-        viewWidth = (int) ((parentMinSize * W_CAPTURED_VIEW_IN_PERCENT / (zoomFactor * 100.0)) * zoomFactor);
-        viewHeight = (int) ((parentMinSize * H_CAPTURED_VIEW_IN_PERCENT / (zoomFactor * 100.0)) * zoomFactor);
-        viewContainerHeight = viewHeight + toolbarHeight +
-                2 * containterSize; // Top and bottom shadows
-        viewContainerWidth = viewWidth +
-                2 * containterSize; // Right and left shadows
+        // For metrics.zoomFactor lower than 1, the zoom factor of the zoomed view is calculated
+        // to get always the same size for the content in the zoomed view.
+        // For metrics.zoomFactor greater than 1, the zoom factor is always set to the default
+        // value DEFAULT_ZOOM_FACTOR, thus the zoomed view is always a zoom of the normal view.
+        zoomFactor = Math.max(DEFAULT_ZOOM_FACTOR, (int) (DEFAULT_ZOOM_FACTOR / metrics.zoomFactor));
+        viewWidth = (int) (parentMinSize * W_CAPTURED_VIEW_IN_PERCENT / (zoomFactor * 100.0)) * zoomFactor;
+        viewHeight = (int) (parentMinSize * H_CAPTURED_VIEW_IN_PERCENT / (zoomFactor * 100.0)) * zoomFactor;
         // Display in zoomedview is corrupted when width is an odd number
         // More details about this issue here: bug 776906 comment 11
         viewWidth &= ~0x1;
     }
 
     private void shouldBlockUpdate(boolean shouldBlockUpdate) {
         stopUpdateView = shouldBlockUpdate;
     }
@@ -452,41 +338,23 @@ public class ZoomedView extends FrameLay
         ThreadUtils.removeCallbacksFromUiThread(requestRenderRunnable);
         if (layerView != null) {
             layerView.setOnMetricsChangedZoomedViewportListener(null);
             layerView.removeZoomedViewListener(this);
             layerView = null;
         }
     }
 
-    private void changeZoomFactor() {
-        if (currentZoomFactorIndex < ZOOM_FACTORS_LIST.length - 1) {
-            currentZoomFactorIndex++;
-        } else {
-            currentZoomFactorIndex = 0;
-        }
-        zoomFactor = ZOOM_FACTORS_LIST[currentZoomFactorIndex];
-
-        ImmutableViewportMetrics metrics = layerView.getViewportMetrics();
-        refreshZoomedViewSize(metrics);
-        setTextInZoomFactorButton(zoomFactor);
-    }
-
-    private void setTextInZoomFactorButton(float zoom) {
-        final String percentageValue = Integer.toString((int) (100*zoom));
-        changeZoomFactorButton.setText(getResources().getString(R.string.percent, percentageValue));
-    }
-
     @Override
     public void handleMessage(final String event, final JSONObject message) {
         ThreadUtils.postToUiThread(new Runnable() {
             @Override
             public void run() {
                 try {
-                    if (event.equals("Gesture:clusteredLinksClicked")) {
+                    if (event.equals("Gesture:nothingDoneOnLongPress") || event.equals("Gesture:clusteredLinksClicked")) {
                         final JSONObject clickPosition = message.getJSONObject("clickPosition");
                         int left = clickPosition.getInt("x");
                         int top = clickPosition.getInt("y");
                         // Start to display inside the zoomedView
                         LayerView geckoAppLayerView = GeckoAppShell.getLayerView();
                         if (geckoAppLayerView != null) {
                             startZoomDisplay(geckoAppLayerView, left, top);
                         }
@@ -500,20 +368,16 @@ public class ZoomedView extends FrameLay
                     Log.e(LOGTAG, "JSON exception", e);
                 }
             }
         });
     }
 
     private void moveUsingGeckoPosition(int leftFromGecko, int topFromGecko) {
         ImmutableViewportMetrics metrics = layerView.getViewportMetrics();
-        final float parentHeight = metrics.getHeight();
-        // moveToolbar is called before getZoomedViewTopLeftPositionFromTouchPosition in order to
-        // correctly center vertically the zoomed area
-        moveToolbar((topFromGecko * metrics.zoomFactor > parentHeight / 2));
         PointF convertedPosition = getZoomedViewTopLeftPositionFromTouchPosition((leftFromGecko * metrics.zoomFactor),
                 (topFromGecko * metrics.zoomFactor));
         moveZoomedView(metrics, convertedPosition.x, convertedPosition.y);
     }
 
     @Override
     public void onMetricsChanged(final ImmutableViewportMetrics viewport) {
         // It can be called from a Gecko thread (forceViewportMetrics in GeckoLayerClient).
@@ -537,18 +401,18 @@ public class ZoomedView extends FrameLay
         final Bitmap sb3 = Bitmap.createBitmap(viewWidth, viewHeight, getBitmapConfig());
         if (sb3 != null) {
             data.rewind();
             try {
                 sb3.copyPixelsFromBuffer(data);
             } catch (Exception iae) {
                 Log.w(LOGTAG, iae.toString());
             }
+            BitmapDrawable ob3 = new BitmapDrawable(getResources(), sb3);
             if (zoomedImageView != null) {
-                RoundedBitmapDrawable ob3 = new RoundedBitmapDrawable(getResources(), sb3, toolbarOnTop, cornerRadius);
                 zoomedImageView.setImageDrawable(ob3);
             }
         }
         if (shouldSetVisibleOnUpdate) {
             this.setVisibility(View.VISIBLE);
             shouldSetVisibleOnUpdate = false;
         }
         lastStartTimeReRender = startTimeReRender;
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -609,24 +609,16 @@ just addresses the organization to follo
 <!-- Miscellaneous -->
 <!-- LOCALIZATION NOTE (ellipsis): This text is appended to a piece of text that does not fit in the
      designated space. Use the unicode ellipsis char, \u2026, or use "..." if \u2026 doesn't suit
      traditions in your locale. -->
 <!ENTITY ellipsis "…">
 
 <!ENTITY colon ":">
 
-<!-- LOCALIZATION NOTE (percent): The percent sign is appended after a number to
-     display a percentage value. formatS is the number, #37 is the code to display a percent sign.
-     This format string is typically used by getString method, in such method the percent sign
-     is a reserved caracter. In order to display one percent sign in the result of getString,
-     double percent signs must be inserted in the format string.
-     This entity is used in the zoomed view to display the zoom factor-->
-<!ENTITY percent "&formatS;&#37;&#37;">
-
 <!-- These are only used for accessibility for the done and overflow-menu buttons in the actionbar.
      They are never shown to users -->
 <!ENTITY actionbar_menu "Menu">
 <!ENTITY actionbar_done "Done">
 
 <!-- Voice search in the awesome bar -->
 <!ENTITY voicesearch_prompt "Speak now">
 <!ENTITY voicesearch_failed_title "&brandShortName; Voice Search">
--- a/mobile/android/base/resources/layout/zoomed_view.xml
+++ b/mobile/android/base/resources/layout/zoomed_view.xml
@@ -5,42 +5,29 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/.
 -->
 
 <org.mozilla.gecko.ZoomedView xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:gecko="http://schemas.android.com/apk/res-auto"
     android:id="@+id/zoomed_view_container"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
-    android:background="@drawable/dropshadow"
-    android:padding="@dimen/drawable_dropshadow_size"
-    android:visibility="gone">
+    android:layout_alignParentLeft="true"
+    android:layout_alignParentTop="true"
+    android:background="@android:color/white"
+    android:visibility="gone" >
 
-    <RelativeLayout
+
+    <ImageView
+        android:id="@+id/zoomed_image_view"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_alignParentTop="true"
-        android:background="@drawable/toolbar_grey_round">
-        <TextView
-            android:id="@+id/change_zoom_factor"
-            android:layout_width="wrap_content"
-            android:layout_height="@dimen/zoomed_view_toolbar_height"
-            android:background="@android:color/transparent"
-            android:padding="12dip"
-            android:layout_alignLeft="@+id/zoomed_image_view"
-            android:textSize="16sp"
-            android:textColor="@color/text_and_tabs_tray_grey"/>
-        <ImageView
-            android:id="@+id/dialog_close"
-            android:scaleType="center"
-            android:layout_width="@dimen/zoomed_view_toolbar_height"
-            android:layout_height="@dimen/zoomed_view_toolbar_height"
-            android:layout_alignRight="@id/zoomed_image_view"
-            android:src="@drawable/close_edit_mode_selector"/>
-        <ImageView
-            android:id="@id/zoomed_image_view"
-            android:layout_below="@id/change_zoom_factor"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"/>
-    </RelativeLayout>
+        android:background="#000000"
+        android:padding="1dip" />
+
+    <ImageView
+        android:id="@+id/dialog_close"
+        android:background="@drawable/close"
+        android:layout_height="20dp"
+        android:layout_width="20dp"
+        android:layout_gravity ="top|right" />
 
 </org.mozilla.gecko.ZoomedView>
\ No newline at end of file
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -200,20 +200,16 @@
     <dimen name="tab_history_title_fading_width">50dp</dimen>
     <dimen name="tab_history_title_margin_right">15dp</dimen>
     <dimen name="tab_history_title_text_size">14sp</dimen>
     <dimen name="tab_history_bg_width">2dp</dimen>
     <dimen name="tab_history_border_padding">2dp</dimen>
 
     <dimen name="horizontal_drag_area">256dp</dimen>
 
-    <!-- ZoomedView dimensions. -->
-    <dimen name="zoomed_view_toolbar_height">44dp</dimen>
-    <dimen name="drawable_dropshadow_size">3dp</dimen>
-
     <!-- Find-In-Page dialog dimensions. -->
     <dimen name="find_in_page_text_margin_left">5dip</dimen>
     <dimen name="find_in_page_text_margin_right">12dip</dimen>
     <dimen name="find_in_page_text_padding_left">10dip</dimen>
     <dimen name="find_in_page_text_padding_right">10dip</dimen>
     <dimen name="find_in_page_status_margin_right">10dip</dimen>
     <dimen name="find_in_page_matchcase_padding">10dip</dimen>
     <dimen name="find_in_page_control_margin_top">2dip</dimen>
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -523,12 +523,10 @@
   <string name="voicesearch_failed_message_recoverable">&voicesearch_failed_message_recoverable;</string>
   <string name="voicesearch_failed_retry">&voicesearch_failed_retry;</string>
 
   <!-- Miscellaneous -->
   <string name="ellipsis">&ellipsis;</string>
 
   <string name="colon">&colon;</string>
 
-  <string name="percent">&percent;</string>
-
   <string name="remote_tabs_last_synced">&remote_tabs_last_synced;</string>
 </resources>