Open source China Oschina Android Client Source Analysis (1) Start interface App_start

Source: Internet
Author: User

1 The layout file of the start-up interface is App_start.xml, and the corresponding class file is Appstart.java under the Net.oschina.app package.

2 for layout files, because only one theme picture is displayed, the layout simply sets the background picture directly. Because it is the start-up interface, there will be a short lag, for the user experience is not good, so in the configuration file custom style, black untitled full screen (why Choose black?) Is it because the background picture is white, and the foil is more bright white? ^_^). Background picture and Untitled are set

<style name= "Theme.appstartload" parent= "Android:Theme.Black.NoTitleBar.Fullscreen" >

<item name= "Android:windowbackground" > @drawable/welcome</item>

<item name= "Android:windownotitle" >true</item>

</style>

Doubts:

2.1 Since the parent= "Android:Theme.Black.NoTitleBar.Fullscreen" has been set, why use <item name= "Android:windownotitle ">true</item>, and also set the background picture in the style, why in the layout file also set the background picture?" Does the repetitive work really reduce the problem of the startup interface lag effectively?

2.2 Why do you want to set android:gravity= "Bottom" in the layout file so that the picture is at the bottom of the control? What is this intention???

3Appstart.java File

3.1 Take advantage of the animation of the view of the gradient animation effect, from translucent to completely opaque, animation duration of 800ms, after the end of the animation, the completion of the log upload and interface jump.

3.2 Log upload service completed in the background, regardless of upload success or failure, finally remember to turn off the service. After the success, the old log file is deleted because we are going to do a new round of operations, as to where the log will be saved, which should be found later with stepwise analysis. Third-party package https://github.com/loopj/android-async-http are used here.

3.3 In the Onresume function to do the following: Mainly considering the application version of the upgrade, the current version is larger than the previous version, then the previously cached pictures to clean up, the upgraded cached image is likely useless: this refers to the third-party package http://kjframe.github.io/. This package is really powerful, but unfortunately the API documentation does not have a detailed explanation of the preference API referenced by the launch interface, so this analysis is entirely self-explanatory. As for the image cache which module is used in the app, it should be found later with stepwise analysis.


Open source China Oschina Android Client Source Analysis (1) Start interface App_start

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.