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

Commit fffce6fe authored by John Reck's avatar John Reck
Browse files

Fix calc visible to account for action bar

 Bug: 5425892

Change-Id: I15bc1779013dbb33511d9c5bff9b678115dec102
parent 92315491
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -22,16 +22,14 @@ import android.text.Editable;
import android.text.Selection;
import android.text.Spannable;
import android.text.TextWatcher;
import android.webkit.WebView;
import android.widget.EditText;
import android.widget.TextView;
import android.view.ActionMode;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;

class FindActionModeCallback implements ActionMode.Callback, TextWatcher,
        View.OnLongClickListener, View.OnClickListener {
@@ -203,6 +201,7 @@ class FindActionModeCallback implements ActionMode.Callback, TextWatcher,

    @Override
    public void onDestroyActionMode(ActionMode mode) {
        mActionMode = null;
        mWebView.notifyFindDialogDismissed();
        mInput.hideSoftInputFromWindow(mWebView.getWindowToken(), 0);
    }
@@ -255,4 +254,13 @@ class FindActionModeCallback implements ActionMode.Callback, TextWatcher,
        // Does nothing.  Needed to implement TextWatcher.
    }

    public int getActionModeHeight() {
        if (mActionMode == null) {
            return 0;
        }
        View parent = (View) mCustomView.getParent();
        return parent != null ? parent.getMeasuredHeight()
                : mCustomView.getMeasuredHeight();
    }

}
+2 −1
Original line number Diff line number Diff line
@@ -1456,7 +1456,8 @@ public class WebView extends AbsoluteLayout

    private int getVisibleTitleHeightImpl() {
        // need to restrict mScrollY due to over scroll
        return Math.max(getTitleHeight() - Math.max(0, mScrollY), 0);
        return Math.max(getTitleHeight() - Math.max(0, mScrollY),
                mFindCallback != null ? mFindCallback.getActionModeHeight() : 0);
    }

    /*