Improve the efficiency of Android app UI

Source: Internet
Author: User

We can refer to this article first, the first to open the article mentioned in the Overdraw function, so you can see the overdraw situation of the screen

http://hukai.me/android-performance-render/


Due to the wonderful design of our company (there is a near full screen drawerlayout!!! Content also and drawerlayout under the same content!!! Just typesetting not used!!! ), our app has always been very card!!!


Open the app a look, scared urine, almost the entire screen is red! That is, the situation of overdraw is very serious!!


Even hiding under the drawerlayout, the following content will still be drawn.


Especially with the use of new Android 5.0 components (although I'm not used to it), in the case of multiple layout overlays, it is possible to temporarily disappear by layout.setvisibility the lower layer (view.gone), Let them be visible again when they appear again.


In addition, in the Red Ocean, I found a magical phenomenon--fragment did not die!


We have a fragment in layout, each time call Fragmentmanager.replace replacement fragment


Through other people's article found that this is just the new fragment overlay on the old fragment above, click on the new fragment blank area can even point to the old fragment button.


The correct approach should be to use framelayout in layout and update each time through replace (r.id.framelayout_name,fragment) fragment


This will allow the old fragment to disappear completely.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Improve the efficiency of Android app UI

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.