From c3808b5dc7d5873d04e8a0a247b179b2757764ba Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Mon, 4 Oct 2010 10:06:59 -0700 Subject: [PATCH] Fix bug 3058324 PopupWindow now responds to the style attribute popupAnimationStyle instead of windowAnimationStyle. The latter was being overridden with undesired values. Animation.PopupWindow style added as a special default sentinel value, which switches animation styles based on whether the window is showing above or below an anchor. Change-Id: Id7cc81f089b6053f2d3a495b1046002548ecf125 --- api/current.xml | 26 +++++++++++------------ core/java/android/widget/PopupWindow.java | 5 ++++- core/res/res/values/attrs.xml | 2 +- core/res/res/values/public.xml | 1 + core/res/res/values/styles.xml | 6 +++++- 5 files changed, 24 insertions(+), 16 deletions(-) diff --git a/api/current.xml b/api/current.xml index 8c164c184ce8c..03fc03a06f831 100644 --- a/api/current.xml +++ b/api/current.xml @@ -5806,17 +5806,6 @@ visibility="public" > - - + + - + diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java index ed15e2530b6ad..055ba875f904d 100644 --- a/core/java/android/widget/PopupWindow.java +++ b/core/java/android/widget/PopupWindow.java @@ -167,7 +167,10 @@ public class PopupWindow { attrs, com.android.internal.R.styleable.PopupWindow, defStyle, 0); mBackground = a.getDrawable(R.styleable.PopupWindow_popupBackground); - mAnimationStyle = a.getResourceId(R.styleable.PopupWindow_windowAnimationStyle, -1); + + final int animStyle = a.getResourceId(R.styleable.PopupWindow_popupAnimationStyle, -1); + mAnimationStyle = animStyle == com.android.internal.R.style.Animation_PopupWindow ? -1 : + animStyle; // If this is a StateListDrawable, try to find and store the drawable to be // used when the drop-down is placed above its anchor view, and the one to be diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 7b0a5028a03e5..6f0ce71e973d0 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -2239,7 +2239,7 @@ - + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 3fc93e71d4d64..10cb44667742f 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1259,6 +1259,7 @@ + diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 02524bf242f3f..c92fc8c712d6a 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -185,6 +185,9 @@ @anim/fade_out + +