summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2012-10-17 11:18:13 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-17 11:18:13 -0700
commite9a33c6098f51c687665adbed799860df2569ad0 (patch)
treec6ff0496c5d7b780e1ad92b704bb190c99e199d9 /core/java
parent161cfef36d8fac79f8665ecdb78d3f8f8f5ba5af (diff)
parentcf12897cf553bfd07734dad3de071915fd21d4eb (diff)
downloadframeworks_base-e9a33c6098f51c687665adbed799860df2569ad0.zip
frameworks_base-e9a33c6098f51c687665adbed799860df2569ad0.tar.gz
frameworks_base-e9a33c6098f51c687665adbed799860df2569ad0.tar.bz2
Merge "Fix bug #7363252 Popup and Dialog UI widgets should be RTL aware" into jb-mr1-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/ViewRootImpl.java6
-rw-r--r--core/java/android/widget/AutoCompleteTextView.java1
-rw-r--r--core/java/android/widget/ListPopupWindow.java17
3 files changed, 6 insertions, 18 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 91df4b5..7ce3042 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1184,6 +1184,7 @@ public final class ViewRootImpl implements ViewParent,
viewVisibilityChanged = false;
mLastConfiguration.setTo(host.getResources().getConfiguration());
mLastSystemUiVisibility = mAttachInfo.mSystemUiVisibility;
+ host.setLayoutDirection(mLastConfiguration.getLayoutDirection());
host.dispatchAttachedToWindow(attachInfo, 0);
mFitSystemWindowsInsets.set(mAttachInfo.mContentInsets);
host.fitSystemWindows(mFitSystemWindowsInsets);
@@ -2676,7 +2677,12 @@ public final class ViewRootImpl implements ViewParent,
// the one in them which may be newer.
config = mView.getResources().getConfiguration();
if (force || mLastConfiguration.diff(config) != 0) {
+ final int lastLayoutDirection = mLastConfiguration.getLayoutDirection();
+ final int currentLayoutDirection = config.getLayoutDirection();
mLastConfiguration.setTo(config);
+ if (lastLayoutDirection != currentLayoutDirection) {
+ mView.setLayoutDirection(currentLayoutDirection);
+ }
mView.dispatchConfigurationChanged(config);
}
}
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index 75d1471..f0eb94f 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -1093,7 +1093,6 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
mPopup.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NEEDED);
mPopup.setListItemExpandMax(EXPAND_MAX);
}
- mPopup.setLayoutDirection(getLayoutDirection());
mPopup.show();
mPopup.getListView().setOverScrollMode(View.OVER_SCROLL_ALWAYS);
}
diff --git a/core/java/android/widget/ListPopupWindow.java b/core/java/android/widget/ListPopupWindow.java
index 1c81d11..3d6b69e 100644
--- a/core/java/android/widget/ListPopupWindow.java
+++ b/core/java/android/widget/ListPopupWindow.java
@@ -1021,8 +1021,6 @@ public class ListPopupWindow {
mDropDownList.setOnItemSelectedListener(mItemSelectedListener);
}
- mDropDownList.setLayoutDirection(mLayoutDirection);
-
dropDownView = mDropDownList;
View hintView = mPromptView;
@@ -1132,21 +1130,6 @@ public class ListPopupWindow {
}
/**
- * Set the layout direction for this popup. Should be a resolved direction as the
- * popup as no capacity to do the resolution on his own.
- *
- * @param layoutDirection One of {@link View#LAYOUT_DIRECTION_LTR},
- * {@link View#LAYOUT_DIRECTION_RTL},
- *
- */
- public void setLayoutDirection(int layoutDirection) {
- mLayoutDirection = layoutDirection;
- if (mDropDownList != null) {
- mDropDownList.setLayoutDirection(mLayoutDirection);
- }
- }
-
- /**
* <p>Wrapper class for a ListView. This wrapper can hijack the focus to
* make sure the list uses the appropriate drawables and states when
* displayed on screen within a drop down. The focus is never actually