Popupwindow pops up at the bottom of the screen of Android animation

An actual content of Android animation, sliding from the bottom of the screen to pop up popupwindow. I believe this effect has been encountered on many apps. For example, when you need to take photos or select pictures from an SD card, and when you need to share something, most of them use this effect:

How can this effect be achieved? Let's write an example of this effect:

1) Let's first define the page layout component of the pop-up window: take_ photo_ pop.xml

2) Now to define the animation, you should know that the popupwindow slides upward from the bottom of the page when it appears and disappears from top to bottom when it disappears, so we need to define two animation files: exit animation pop_ exit_ anim.xml

As for these two animations, there is no more analysis here. Anyone who has read my previous blog should know. It's very simple. If you can't understand it? Please click the link at the top of this article to learn it. 3) Customize the pop-up window:

Define the component takephotopopwin to pop up, which inherits from popupwindow. How to implement it? My notes are very detailed. One thing to be reminded is to set the display animation of the pop-up form, this. Setanimationstyle (r.style. Take_photo_anim); This is essential. Only with it can animation effects be applied! Take a look_ photo_ Definition of anim style:

Just a few steps, a component that can slide and pop up from the bottom of the screen

Now, the effect is consistent with the picture I passed at the beginning! Have you learned!?

Expansion: everyone who has played the app knows that when you enter a new page or register to log in, a waiting box will pop up, indicating that you need to wait patiently in the network request. For example, the effect of the waiting request box of wechat is as follows:

There is also a place where animation is used, that is, the small icon that keeps rotating. In fact, it is used to rotate animation! About how to implement such a rotation waiting box, I wrote an introduction article before. You can see: Android custom ProgressDialog progress waiting box

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>