* commit 'f2ae250e7e7410918589b2c9eb0d6101c90f4128': Fix unnecessary layer creation for appear animation
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
<com.android.keyguard.AlphaOptimizedLinearLayout
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@@ -63,6 +63,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</com.android.keyguard.AlphaOptimizedLinearLayout>
|
||||
|
||||
</com.android.systemui.statusbar.NotificationOverflowContainer>
|
||||
|
||||
@@ -656,12 +656,14 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
|
||||
}
|
||||
|
||||
private void setContentAlpha(float contentAlpha) {
|
||||
int layerType = contentAlpha == 0.0f || contentAlpha == 1.0f ? LAYER_TYPE_NONE
|
||||
: LAYER_TYPE_HARDWARE;
|
||||
View contentView = getContentView();
|
||||
int currentLayerType = contentView.getLayerType();
|
||||
if (currentLayerType != layerType) {
|
||||
contentView.setLayerType(layerType, null);
|
||||
if (contentView.hasOverlappingRendering()) {
|
||||
int layerType = contentAlpha == 0.0f || contentAlpha == 1.0f ? LAYER_TYPE_NONE
|
||||
: LAYER_TYPE_HARDWARE;
|
||||
int currentLayerType = contentView.getLayerType();
|
||||
if (currentLayerType != layerType) {
|
||||
contentView.setLayerType(layerType, null);
|
||||
}
|
||||
}
|
||||
contentView.setAlpha(contentAlpha);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user