Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16bd9372 authored by Steve Howard's avatar Steve Howard
Browse files

Hide zoom buttons when a view gets hidden, i.e. by a TabHost

When a View uses a ZoomButtonsController, it needs to explicitly hide
the zoom controls when it gets hidden itself, such as when it's within
a TabHost.  Add a note to the javadoc to do this via
onVisibilityChanged(), and update WebView to follow the instructions.

Thanks to Ross Levinsky for discovering and tracking this one down.

Bug: 2582718
Change-Id: Ia0c9ea4efcb29eb1f321be54f3d8ae1e056df6b7
CC: rosslevinsky@google.com
parent aedb01dc
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3951,6 +3951,14 @@ public class WebView extends AbsoluteLayout
        super.onDetachedFromWindow();
    }

    @Override
    protected void onVisibilityChanged(View changedView, int visibility) {
        super.onVisibilityChanged(changedView, visibility);
        if (visibility != View.VISIBLE) {
            dismissZoomControl();
        }
    }

    /**
     * @deprecated WebView no longer needs to implement
     * ViewGroup.OnHierarchyChangeListener.  This method does nothing now.
+3 −2
Original line number Diff line number Diff line
@@ -66,8 +66,9 @@ import android.view.WindowManager.LayoutParams;
 * {@link #setZoomInEnabled(boolean)} and {@link #setZoomOutEnabled(boolean)}.
 * <p>
 * If you are using this with a custom View, please call
 * {@link #setVisible(boolean) setVisible(false)} from the
 * {@link View#onDetachedFromWindow}.
 * {@link #setVisible(boolean) setVisible(false)} from
 * {@link View#onDetachedFromWindow} and from {@link View#onVisibilityChanged}
 * when <code>visibility != View.VISIBLE</code>.
 *
 */
public class ZoomButtonsController implements View.OnTouchListener {