I am trying to animate a popup window when shown with push_up in the animation from the bottom of the scene Close with a push_up animation but not working, popup normally shows with exclusion animation (very fast). Here's my code:
push_up_in.xml
and set xmlns: android = "http://schemas.android.com/ APK / Ridge / Android "& gt; & Lt; Android Translation: Period = "1000" Android: fromYDelta = "100% p" Android: toYDelta = "0" /> & Lt; Alpha Android: Period = "1000" Android: fromAlpha = "0.0" Android: toAlpha = "1.0" /> & Lt; / Set & gt;
push_up_out.xml
& lt; Set xmlns: android = "http://schemas.android.com/apk/Native/Android" & gt; & Lt; Android Translation: Period = "1000" Android: fromYDelta = "0" Android: toYDelta = "- 100% p" /> & Lt; Alpha Android: Period = "1000" Android: fromAlpha = "1.0" Android: toAlpha = "0.0" /> & Lt; / Set & gt;
styles.xml
style name = "popup_animize" & gt; & Lt; Item name = "android: windowEnterAnimation" & gt; @ Anime / push_up_in & lt; / Item & gt; & Lt; Item name = "android: windowExitAnimation" & gt; @ Animation / push_up_out & lt; / Item & gt; & Lt; / Style & gt;
and where the popup window is shown in the code:
last popup window pw = new PopupWindow (pop view, 100 , 100, true); Pw.setBackgroundDrawable (new bitmapreadable ()); Pw.setOutsideTouchable (true); Pw.setAnimationStyle (R.style.popup_anim); Pw.showAtLocation (this.findViewById (R.id.map_layout), Gravity. BOTTOM, 0, 0); See map = (see) findViewById (R.id.map); Int mapwidth = map.getWidth (); Int mapheight = map.getHeight (); Int popup = (int) (maphit * 0.3); Pw.update (mapwidth, popup);
Any ideas?
I do not think where you are setting the content view, nothing to show And if not, try not to be ready to make the background, and set the layout in the background, so that some problems have been solved with incorrect display colors in my project.
No comments:
Post a Comment