Merge "Center box text vertically"
This commit is contained in:
committed by
Android (Google) Code Review
commit
e4255b1769
@@ -1092,4 +1092,11 @@ import junit.framework.Assert;
|
|||||||
|
|
||||||
return url != null ? url.getProtocol() + "://" + url.getHost() + url.getPath() : null;
|
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();
|
String text = nativeFocusCandidateText();
|
||||||
int nodePointer = nativeFocusCandidatePointer();
|
int nodePointer = nativeFocusCandidatePointer();
|
||||||
mWebTextView.setGravity(nativeFocusCandidateIsRtlText() ?
|
|
||||||
Gravity.RIGHT : Gravity.NO_GRAVITY);
|
|
||||||
// This needs to be called before setType, which may call
|
// This needs to be called before setType, which may call
|
||||||
// requestFormData, and it needs to have the correct nodePointer.
|
// requestFormData, and it needs to have the correct nodePointer.
|
||||||
mWebTextView.setNodePointer(nodePointer);
|
mWebTextView.setNodePointer(nodePointer);
|
||||||
mWebTextView.setType(nativeFocusCandidateType());
|
mWebTextView.setType(nativeFocusCandidateType());
|
||||||
|
// Gravity needs to be set after setType
|
||||||
|
mWebTextView.setGravityForRtl(nativeFocusCandidateIsRtlText());
|
||||||
updateWebTextViewPadding();
|
updateWebTextViewPadding();
|
||||||
if (null == text) {
|
if (null == text) {
|
||||||
if (DebugFlags.WEB_VIEW) {
|
if (DebugFlags.WEB_VIEW) {
|
||||||
|
|||||||
Reference in New Issue
Block a user