Commit 446756a8 authored by Ted Choc's avatar Ted Choc Committed by Commit Bot

Fix RTL focusing animation bugs.

If the text is empty, skip the unfocusing animation
logic as it causes the weird jumps shown (because of the
different in width between the unfocused and focused views).

Also when updating the URL direction (i.e. when switching
from a normal tab with LTR text to a new incognito tab w/
RTL hint text), ensure that you rescroll the TLD to avoid
it being blank on the first incognito tab.

BUG=836273,822869

Change-Id: Ib3413a6810ca651cdf38d9f9e9c59798a7051ecf
Reviewed-on: https://chromium-review.googlesource.com/1031382
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554182}
parent a495440a
......@@ -545,6 +545,9 @@ public class UrlBar extends AutocompleteEditText {
if (mUrlDirectionListener != null) {
mUrlDirectionListener.onUrlDirectionChanged(urlDirection);
}
// Ensure the display text is visible after updating the URL direction.
scrollDisplayText();
}
}
......
......@@ -2095,7 +2095,8 @@ public class ToolbarPhone extends ToolbarLayout
// is only needed for RTL calculations, we proceed if the location bar is showing
// LTR content.
boolean isLocationBarRtl = ApiCompatibilityUtils.isLayoutRtl(mLocationBar);
if (!isLocationBarRtl || mUrlBar.getLayout() != null) {
if (!TextUtils.isEmpty(mUrlBar.getText())
&& (!isLocationBarRtl || mUrlBar.getLayout() != null)) {
int urlBarStartScrollX = 0;
if (TextUtils.equals(mUrlBar.getText(), mUrlTextPreFocus)) {
urlBarStartScrollX = mUrlScrollXPositionPreFocus;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment