am f2ae250e: am 7cc56bb4: am 1f98c62f: Fix unnecessary layer creation for appear animation

* commit 'f2ae250e7e7410918589b2c9eb0d6101c90f4128':
  Fix unnecessary layer creation for appear animation
This commit is contained in:
Jorim Jaggi
2015-07-21 00:21:37 +00:00
committed by Android Git Automerger
2 changed files with 9 additions and 7 deletions

View File

@@ -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>

View File

@@ -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);
}