diff options
| -rw-r--r-- | core/java/android/webkit/WebView.java | 23 | ||||
| -rw-r--r-- | core/res/res/layout/zoom_browser_accessory_buttons.xml | 11 |
2 files changed, 12 insertions, 22 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index fcf946f7d12a..69364350690b 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -545,7 +545,6 @@ public class WebView extends AbsoluteLayout private ZoomButtonsController mZoomButtonsController; private ImageView mZoomOverviewButton; - private ImageView mZoomFitPageButton; // These keep track of the center point of the zoom. They are used to // determine the point around which we should zoom. @@ -617,6 +616,16 @@ public class WebView extends AbsoluteLayout // Create the buttons controller mZoomButtonsController = new ZoomButtonsController(this); mZoomButtonsController.setOnZoomListener(mZoomListener); + // ZoomButtonsController positions the buttons at the bottom, but in + // the middle. Change their layout parameters so they appear on the + // right. + View controls = mZoomButtonsController.getZoomControls(); + ViewGroup.LayoutParams params = controls.getLayoutParams(); + if (params instanceof FrameLayout.LayoutParams) { + FrameLayout.LayoutParams frameParams = (FrameLayout.LayoutParams) + params; + frameParams.gravity = Gravity.RIGHT; + } // Create the accessory buttons LayoutInflater inflater = @@ -636,15 +645,6 @@ public class WebView extends AbsoluteLayout } } }); - mZoomFitPageButton = - (ImageView) container.findViewById(com.android.internal.R.id.zoom_fit_page); - mZoomFitPageButton.setOnClickListener( - new View.OnClickListener() { - public void onClick(View v) { - zoomWithPreview(mDefaultScale); - updateZoomButtonsEnabled(); - } - }); } private void updateZoomButtonsEnabled() { @@ -654,17 +654,14 @@ public class WebView extends AbsoluteLayout // Hide the zoom in and out buttons, as well as the fit to page // button, if the page cannot zoom mZoomButtonsController.getZoomControls().setVisibility(View.GONE); - mZoomFitPageButton.setVisibility(View.GONE); } else { // Bring back the hidden zoom controls. mZoomButtonsController.getZoomControls() .setVisibility(View.VISIBLE); - mZoomFitPageButton.setVisibility(View.VISIBLE); // Set each one individually, as a page may be able to zoom in // or out. mZoomButtonsController.setZoomInEnabled(canZoomIn); mZoomButtonsController.setZoomOutEnabled(canZoomOut); - mZoomFitPageButton.setEnabled(mActualScale != mDefaultScale); } mZoomOverviewButton.setVisibility(canZoomScrollOut() ? View.VISIBLE: View.GONE); diff --git a/core/res/res/layout/zoom_browser_accessory_buttons.xml b/core/res/res/layout/zoom_browser_accessory_buttons.xml index 4bf2bdf8a158..69afca9003d3 100644 --- a/core/res/res/layout/zoom_browser_accessory_buttons.xml +++ b/core/res/res/layout/zoom_browser_accessory_buttons.xml @@ -18,18 +18,11 @@ */ --> <merge xmlns:android="http://schemas.android.com/apk/res/android"> - <ImageView android:id="@+id/zoom_fit_page" - android:background="@android:drawable/btn_browser_zoom_fit_page" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="bottom|left" - android:layout_marginLeft="7dip" - /> <ImageView android:id="@+id/zoom_page_overview" android:background="@android:drawable/btn_browser_zoom_page_overview" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="bottom|right" - android:layout_marginRight="7dip" + android:layout_gravity="bottom|left" + android:layout_marginLeft="7dip" /> </merge> |