From a0c8c1cfc81e33435687a3bc030621e3d4fe5f95 Mon Sep 17 00:00:00 2001 From: Hidehiko Tsuchiya Date: Mon, 13 Nov 2017 10:52:23 +0900 Subject: [PATCH] Fix an incorrect display position of error popup in RTL layout Symptom: The display position of error popup is incorrect in RTL layout such as Arabic language. Root cause: In LTR layout, a popup window is anchored to the bottom-left corner of the anchor view. But in RTL layout, it's anchored to the bottom-right. showError calculates a position for RTL by itself and it gets a wrong result. Solution: Set the base alignment of the error popup to the bottom-left even though it's in RTL. Bug: 69402857 Change-Id: Iae099984e6c47feca078658ddc44ab905995fe0d --- core/java/android/widget/Editor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 6374aa26a200e..7a2e4783acd74 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -488,7 +488,8 @@ public class Editor { chooseSize(mErrorPopup, mError, tv); tv.setText(mError); - mErrorPopup.showAsDropDown(mTextView, getErrorX(), getErrorY()); + mErrorPopup.showAsDropDown(mTextView, getErrorX(), getErrorY(), + Gravity.TOP | Gravity.LEFT); mErrorPopup.fixDirection(mErrorPopup.isAboveAnchor()); }