Android-like WeChat-like activity smooth horizontal switching Animation

Source: Internet
Author: User

I can see that overridependingtransition (Android. R. anim. slide_in_left, Android. R. anim. slide_out_right) is used in many podcasts on the Internet,

However, the method should be written in this way after startactivity and before finish;

The results are good, so I used apktool to decompile and view the resource file. I found a word that is "good" and used a large number of XML resource files;

The interface is very simple. You cannot upload the entire demo process. First, paste one: similar to other interfaces, mainly to demonstrate the jump Effect of clicking Next activity and returning:

1. First define the topic of the application node in manifest. xml

<Application
Android: icon = "@ drawable/ic_launcher"
Android: Label = "@ string/app_name"
Android: theme = "@ style/apptheme">

2. apptheme is defined in styles

<Style name = "apptheme" parent = "@ Android: style/theme">
<Item name = "Android: windownotitle"> true </item> <! -- Set no title -->
<Item name = "Android: textsize"> 20sp </item> <! -- Set the text size -->
<Item name = "Android: textcolor"> # f34141 </item>
<Item name = "Android: background"> @ Android: color/background_light </item>
<! -- Set activity switching animation -->
<Item name = "Android: windowanimationstyle"> @ style/activityanimation </item>
</Style>

<! -- Animation style -->
<Style name = "activityanimation" parent = "@ Android: style/animation">
<Item name = "Android: activityopenenteranimation"> @ anim/slide_right_in </item>

<Item name = "Android: activityopenexitanimation"> @ anim/slide_left_out </item>
<Item name = "Android: activitycloseenteranimation"> @ anim/slide_left_in </item>
<Item name = "Android: activitycloseexitanimation"> @ anim/slide_right_out </item>
</STYLE>

3. OK. The entire demo is like this process;
/Files/jaylong/activityanimationdemo.zip

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.