mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Improve AyncTask throughput inside WidgetPreviewLoader
b/21133230 > Synchronized block was creating a bottleneck for the AsyncTasks. > Remove calls that doesn't need to be synchronized outside synchronized block. > Also removed setAlpha call as after the bottleneck was removed, Inefficient alpha view usage alert started popping up in traceview. Due to less jankness, removing the fadein animation doesn't have any visible effect. Link to lock congestion visualization: https://x20web.corp.google.com/~hyunyoungs/no_crawl/traceview/traceview_lockcontention.html Result: gfx-avg-jank delta = "-1" Change-Id: If12817df0730f346cdba7e2f38f232eb9a4336c0
This commit is contained in:
@@ -26,6 +26,7 @@ import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnLayoutChangeListener;
|
||||
import android.view.ViewPropertyAnimator;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -175,7 +176,8 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener {
|
||||
if (bitmap != null) {
|
||||
mWidgetImage.setBitmap(bitmap);
|
||||
mWidgetImage.setAlpha(0f);
|
||||
mWidgetImage.animate().alpha(1.0f).setDuration(FADE_IN_DURATION_MS);
|
||||
ViewPropertyAnimator anim = mWidgetImage.animate();
|
||||
anim.alpha(1.0f).setDuration(FADE_IN_DURATION_MS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user