Merge change 8677 into donut
* changes: DO NOT MERGE.
This commit is contained in:
@@ -545,7 +545,6 @@ public class WebView extends AbsoluteLayout
|
|||||||
|
|
||||||
private ZoomButtonsController mZoomButtonsController;
|
private ZoomButtonsController mZoomButtonsController;
|
||||||
private ImageView mZoomOverviewButton;
|
private ImageView mZoomOverviewButton;
|
||||||
private ImageView mZoomFitPageButton;
|
|
||||||
|
|
||||||
// These keep track of the center point of the zoom. They are used to
|
// These keep track of the center point of the zoom. They are used to
|
||||||
// determine the point around which we should zoom.
|
// determine the point around which we should zoom.
|
||||||
@@ -617,6 +616,16 @@ public class WebView extends AbsoluteLayout
|
|||||||
// Create the buttons controller
|
// Create the buttons controller
|
||||||
mZoomButtonsController = new ZoomButtonsController(this);
|
mZoomButtonsController = new ZoomButtonsController(this);
|
||||||
mZoomButtonsController.setOnZoomListener(mZoomListener);
|
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
|
// Create the accessory buttons
|
||||||
LayoutInflater inflater =
|
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() {
|
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
|
// Hide the zoom in and out buttons, as well as the fit to page
|
||||||
// button, if the page cannot zoom
|
// button, if the page cannot zoom
|
||||||
mZoomButtonsController.getZoomControls().setVisibility(View.GONE);
|
mZoomButtonsController.getZoomControls().setVisibility(View.GONE);
|
||||||
mZoomFitPageButton.setVisibility(View.GONE);
|
|
||||||
} else {
|
} else {
|
||||||
// Bring back the hidden zoom controls.
|
// Bring back the hidden zoom controls.
|
||||||
mZoomButtonsController.getZoomControls()
|
mZoomButtonsController.getZoomControls()
|
||||||
.setVisibility(View.VISIBLE);
|
.setVisibility(View.VISIBLE);
|
||||||
mZoomFitPageButton.setVisibility(View.VISIBLE);
|
|
||||||
// Set each one individually, as a page may be able to zoom in
|
// Set each one individually, as a page may be able to zoom in
|
||||||
// or out.
|
// or out.
|
||||||
mZoomButtonsController.setZoomInEnabled(canZoomIn);
|
mZoomButtonsController.setZoomInEnabled(canZoomIn);
|
||||||
mZoomButtonsController.setZoomOutEnabled(canZoomOut);
|
mZoomButtonsController.setZoomOutEnabled(canZoomOut);
|
||||||
mZoomFitPageButton.setEnabled(mActualScale != mDefaultScale);
|
|
||||||
}
|
}
|
||||||
mZoomOverviewButton.setVisibility(canZoomScrollOut() ? View.VISIBLE:
|
mZoomOverviewButton.setVisibility(canZoomScrollOut() ? View.VISIBLE:
|
||||||
View.GONE);
|
View.GONE);
|
||||||
|
|||||||
@@ -18,18 +18,11 @@
|
|||||||
*/
|
*/
|
||||||
-->
|
-->
|
||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<ImageView android:id="@+id/zoom_fit_page"
|
<ImageView android:id="@+id/zoom_page_overview"
|
||||||
android:background="@android:drawable/btn_browser_zoom_fit_page"
|
android:background="@android:drawable/btn_browser_zoom_page_overview"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom|left"
|
android:layout_gravity="bottom|left"
|
||||||
android:layout_marginLeft="7dip"
|
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"
|
|
||||||
/>
|
|
||||||
</merge>
|
</merge>
|
||||||
|
|||||||
Reference in New Issue
Block a user