Android animation practice conclusion
Practice:
1. Pan Animation
overridePendingTransition(R.anim.enterAnim,R.anim.exitAnim);
In the method, the first parameter indicates entering enterAnim, and the second parameter indicates exitAnim. How can this problem be solved?
For example, if I write such an effect, it will be the same as on Netease news. When you click a piece of news, it seems that the current page does not move, and then the requested news page gradually translates from right to left and completely hides (overwrites) the current page. If you implement it, see the XML code:
/** enterAnim */
/** exitAnim */
Then, when you want to jump to another page, place the above method in startActivity (Intent intent.
You will know the effect after running it. The so-called "in" is equivalent to the page that you do not want to see currently. We need to make it disappear; on the contrary, "out" is to make the new page you want to see appear and hide (overwrite) the current page;
When you click back, the effect of the application is the opposite to that of the previous one. effect: the current page is removed from the right, and the original page is displayed under the current page.
Of course, the above method is used. The XML Code is as follows;
/** enterAnim */
/** exitAnim */
Usage:
overridePendingTransition(R.anim.enterAnim,R.anim.exitAnim);
The idea is the opposite of that of the request;
In fact, translation is equivalent to a river. First, you must know which direction the river wants to go.
For example, to left: set the first parameter of the method (so that the current page is translated to left) to move from right to left, followed by the request page (second parameter) it is also translated from right to left in the same direction. In this way, the mobility of translation can be realized;
To be continued ....