Center box text vertically
Apply Gravity.CENTER_VERTICAL for single-line editable text Bug: 5267547 Change-Id: Ie81354214e6eb97554d1f9e8e47377a2b0e73df6
This commit is contained in:
@@ -1092,4 +1092,11 @@ import junit.framework.Assert;
|
||||
|
||||
return url != null ? url.getProtocol() + "://" + url.getHost() + url.getPath() : null;
|
||||
}
|
||||
|
||||
public void setGravityForRtl(boolean rtl) {
|
||||
int gravity = rtl ? Gravity.RIGHT : Gravity.LEFT;
|
||||
gravity |= mSingle ? Gravity.CENTER_VERTICAL : Gravity.TOP;
|
||||
setGravity(gravity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4760,12 +4760,12 @@ public class WebView extends AbsoluteLayout
|
||||
}
|
||||
String text = nativeFocusCandidateText();
|
||||
int nodePointer = nativeFocusCandidatePointer();
|
||||
mWebTextView.setGravity(nativeFocusCandidateIsRtlText() ?
|
||||
Gravity.RIGHT : Gravity.NO_GRAVITY);
|
||||
// This needs to be called before setType, which may call
|
||||
// requestFormData, and it needs to have the correct nodePointer.
|
||||
mWebTextView.setNodePointer(nodePointer);
|
||||
mWebTextView.setType(nativeFocusCandidateType());
|
||||
// Gravity needs to be set after setType
|
||||
mWebTextView.setGravityForRtl(nativeFocusCandidateIsRtlText());
|
||||
updateWebTextViewPadding();
|
||||
if (null == text) {
|
||||
if (DebugFlags.WEB_VIEW) {
|
||||
|
||||
Reference in New Issue
Block a user