Skip to content

Commit 3330ae5

Browse files
Fabrice Di MeglioAndroid (Google) Code Review
authored andcommitted
Merge "Improve Toast RTL support" into jb-mr1-dev
2 parents 859a62c + bf0bc63 commit 3330ae5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/java/android/widget/Toast.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ public void handleShow() {
376376
mWM = WindowManagerImpl.getDefault();
377377
// We can resolve the Gravity here by using the Locale for getting
378378
// the layout direction
379-
final int layoutDirection = LocaleUtil.getLayoutDirectionFromLocale(
380-
Locale.getDefault());
379+
final Locale locale = mView.getContext().getResources().getConfiguration().locale;
380+
final int layoutDirection = LocaleUtil.getLayoutDirectionFromLocale(locale);
381381
final int gravity = Gravity.getAbsoluteGravity(mGravity, layoutDirection);
382382
mParams.gravity = gravity;
383383
if ((gravity & Gravity.HORIZONTAL_GRAVITY_MASK) == Gravity.FILL_HORIZONTAL) {

0 commit comments

Comments
 (0)