Merge "Avoid NPE in WebTextView.lineUpScroll -> Touch.getMaxScrollX" into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
59993d9bc5
@@ -28,6 +28,7 @@ import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.Layout;
|
||||
import android.text.Selection;
|
||||
import android.text.Spannable;
|
||||
import android.text.TextPaint;
|
||||
@@ -292,8 +293,9 @@ import java.util.ArrayList;
|
||||
* Ensure that the underlying textfield is lined up with the WebTextView.
|
||||
*/
|
||||
private void lineUpScroll() {
|
||||
if (mWebView != null) {
|
||||
float maxScrollX = Touch.getMaxScrollX(this, getLayout(), mScrollY);
|
||||
Layout layout = getLayout();
|
||||
if (mWebView != null && layout != null) {
|
||||
float maxScrollX = Touch.getMaxScrollX(this, layout, mScrollY);
|
||||
if (DebugFlags.WEB_TEXT_VIEW) {
|
||||
Log.v(LOGTAG, "onTouchEvent x=" + mScrollX + " y="
|
||||
+ mScrollY + " maxX=" + maxScrollX);
|
||||
|
||||
Reference in New Issue
Block a user