Merge "Improve Toast RTL support" into jb-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3330ae59ff
@@ -376,8 +376,8 @@ public class Toast {
|
|||||||
mWM = WindowManagerImpl.getDefault();
|
mWM = WindowManagerImpl.getDefault();
|
||||||
// We can resolve the Gravity here by using the Locale for getting
|
// We can resolve the Gravity here by using the Locale for getting
|
||||||
// the layout direction
|
// the layout direction
|
||||||
final int layoutDirection = LocaleUtil.getLayoutDirectionFromLocale(
|
final Locale locale = mView.getContext().getResources().getConfiguration().locale;
|
||||||
Locale.getDefault());
|
final int layoutDirection = LocaleUtil.getLayoutDirectionFromLocale(locale);
|
||||||
final int gravity = Gravity.getAbsoluteGravity(mGravity, layoutDirection);
|
final int gravity = Gravity.getAbsoluteGravity(mGravity, layoutDirection);
|
||||||
mParams.gravity = gravity;
|
mParams.gravity = gravity;
|
||||||
if ((gravity & Gravity.HORIZONTAL_GRAVITY_MASK) == Gravity.FILL_HORIZONTAL) {
|
if ((gravity & Gravity.HORIZONTAL_GRAVITY_MASK) == Gravity.FILL_HORIZONTAL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user