Merge change I78f113bc into eclair
* changes:
Fix possible crash in AutoCompleteTextView.
diff --git a/api/current.xml b/api/current.xml
index ab5369c..e4d6308 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -3144,6 +3144,17 @@
visibility="public"
>
</field>
+<field name="dropDownHorizontalOffset"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843436"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="dropDownItemStyle"
type="int"
transient="false"
@@ -3177,6 +3188,17 @@
visibility="public"
>
</field>
+<field name="dropDownVerticalOffset"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843437"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="dropDownWidth"
type="int"
transient="false"
diff --git a/core/java/android/provider/LiveFolders.java b/core/java/android/provider/LiveFolders.java
index 19f361b..66723f8 100644
--- a/core/java/android/provider/LiveFolders.java
+++ b/core/java/android/provider/LiveFolders.java
@@ -40,7 +40,7 @@
* to retrieve the folder's content.</p>
*
* <h3>Setting up the live folder activity</h3>
- * <p>The following code sample shows how to write an activity that creates a live fodler:</p>
+ * <p>The following code sample shows how to write an activity that creates a live folder:</p>
* <pre>
* public static class MyLiveFolder extends Activity {
* public static final Uri CONTENT_URI = Uri.parse("content://my.app/live");
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index 953dd92..1449ea5 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -82,6 +82,8 @@
* @attr ref android.R.styleable#AutoCompleteTextView_dropDownAnchor
* @attr ref android.R.styleable#AutoCompleteTextView_dropDownWidth
* @attr ref android.R.styleable#AutoCompleteTextView_dropDownHeight
+ * @attr ref android.R.styleable#AutoCompleteTextView_dropDownVerticalOffset
+ * @attr ref android.R.styleable#AutoCompleteTextView_dropDownHorizontalOffset
*/
public class AutoCompleteTextView extends EditText implements Filter.FilterListener {
static final boolean DEBUG = false;
@@ -1153,7 +1155,7 @@
heightSpec = mDropDownHeight;
}
- mPopup.setOutsideTouchable(mForceIgnoreOutsideTouch ? false : !mDropDownAlwaysVisible);
+ mPopup.setOutsideTouchable(!mForceIgnoreOutsideTouch && !mDropDownAlwaysVisible);
mPopup.update(getDropDownAnchorView(), mDropDownHorizontalOffset,
mDropDownVerticalOffset, widthSpec, heightSpec);
@@ -1183,8 +1185,8 @@
// use outside touchable to dismiss drop down when touching outside of it, so
// only set this if the dropdown is not always visible
- mPopup.setOutsideTouchable(mForceIgnoreOutsideTouch ? false : !mDropDownAlwaysVisible);
- mPopup.setTouchInterceptor(new PopupTouchIntercepter());
+ mPopup.setOutsideTouchable(!mForceIgnoreOutsideTouch && !mDropDownAlwaysVisible);
+ mPopup.setTouchInterceptor(new PopupTouchInterceptor());
mPopup.showAsDropDown(getDropDownAnchorView(),
mDropDownHorizontalOffset, mDropDownVerticalOffset);
mDropDownList.setSelection(ListView.INVALID_POSITION);
@@ -1408,9 +1410,10 @@
}
}
- private class PopupTouchIntercepter implements OnTouchListener {
+ private class PopupTouchInterceptor implements OnTouchListener {
public boolean onTouch(View v, MotionEvent event) {
- if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ if (event.getAction() == MotionEvent.ACTION_DOWN &&
+ mPopup != null && mPopup.isShowing()) {
mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
showDropDown();
}
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 999e6ed..8807665 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1176,6 +1176,8 @@
<public type="attr" name="scrollbarDefaultDelayBeforeFade" />
<public type="attr" name="fadeScrollbars" />
<public type="attr" name="colorBackgroundCacheHint" />
+ <public type="attr" name="dropDownHorizontalOffset" />
+ <public type="attr" name="dropDownVerticalOffset" />
<public type="style" name="Theme.Wallpaper" />
<public type="style" name="Theme.Wallpaper.NoTitleBar" />