mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
Reducing memory impact of hardware layers in Launcher
- Disabling hardware layers in customize tray - Destroying hardware layers for pages in All Apps that are not visible - Re-adding CachedTextView for icons in customize tray (to regain some of the lost performance there)
This commit is contained in:
@@ -18,7 +18,6 @@ package com.android.launcher2;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
@@ -39,7 +38,6 @@ public class PagedViewCellLayoutChildren extends ViewGroup {
|
||||
|
||||
public PagedViewCellLayoutChildren(Context context) {
|
||||
super(context);
|
||||
setLayerType(LAYER_TYPE_HARDWARE, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -140,6 +138,17 @@ public class PagedViewCellLayoutChildren extends ViewGroup {
|
||||
}
|
||||
}
|
||||
|
||||
void destroyHardwareLayer() {
|
||||
if (getLayerType() == LAYER_TYPE_HARDWARE) {
|
||||
setLayerType(LAYER_TYPE_NONE, null);
|
||||
}
|
||||
}
|
||||
void createHardwareLayer() {
|
||||
if (getLayerType() == LAYER_TYPE_NONE) {
|
||||
setLayerType(LAYER_TYPE_HARDWARE, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void enableCenteredContent(boolean enabled) {
|
||||
mCenterContent = enabled;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user