Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid drawing objects allocation during drawing operations #40

Open
00conan00 opened this issue Apr 2, 2014 · 0 comments
Open

Avoid drawing objects allocation during drawing operations #40

00conan00 opened this issue Apr 2, 2014 · 0 comments

Comments

@00conan00
Copy link

Dear developers,
My analysis tool have found another issue. I found drawing object creation in storymaker's code. It could make UI appear sluggish.

As suggested by Android Developers,"Creating objects ahead of time is an important optimization. Views are redrawn very frequently, and many drawing objects require expensive initialization. Creating drawing objects within your onDraw() method significantly reduces performance and can make your UI appear sluggish."

We found the violations in this class:

Class name: info.guardianproject.mrapp.ui.BigImageLabelView
--Handler name: info.guardianproject.mrapp.ui.BigImageLabelView.onDraw(Landroid/graphics/Canvas;)V
--Avoid expensive drawing objects allocations during draw operations(preallocate and reuse instead):
----android.graphics.Rect.(IIII)V

The call hierarchy is as follows:
onDraw();
computeBounds();

you may find more useful information in this references:
http://developer.android.com/training/custom-views/custom-drawing.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant