Merge "Sensitive Notification Reveal Animation Preparations" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f382bb4688
@@ -117,6 +117,9 @@ object Flags {
|
|||||||
val ANIMATED_NOTIFICATION_SHADE_INSETS =
|
val ANIMATED_NOTIFICATION_SHADE_INSETS =
|
||||||
unreleasedFlag(270682168, "animated_notification_shade_insets", teamfood = true)
|
unreleasedFlag(270682168, "animated_notification_shade_insets", teamfood = true)
|
||||||
|
|
||||||
|
// TODO(b/268005230): Tracking Bug
|
||||||
|
@JvmField val SENSITIVE_REVEAL_ANIM = unreleasedFlag(268005230, "sensitive_reveal_anim")
|
||||||
|
|
||||||
// 200 - keyguard/lockscreen
|
// 200 - keyguard/lockscreen
|
||||||
// ** Flag retired **
|
// ** Flag retired **
|
||||||
// public static final BooleanFlag KEYGUARD_LAYOUT =
|
// public static final BooleanFlag KEYGUARD_LAYOUT =
|
||||||
|
|||||||
@@ -2805,9 +2805,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
int intrinsicBefore = getIntrinsicHeight();
|
int intrinsicBefore = getIntrinsicHeight();
|
||||||
mSensitive = sensitive;
|
mSensitive = sensitive;
|
||||||
mSensitiveHiddenInGeneral = hideSensitive;
|
mSensitiveHiddenInGeneral = hideSensitive;
|
||||||
if (intrinsicBefore != getIntrinsicHeight()) {
|
int intrinsicAfter = getIntrinsicHeight();
|
||||||
// The animation has a few flaws and is highly visible, so jump cut instead.
|
if (intrinsicBefore != intrinsicAfter) {
|
||||||
notifyHeightChanged(false /* needsAnimation */);
|
boolean needsAnimation = mFeatureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM);
|
||||||
|
notifyHeightChanged(needsAnimation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2864,13 +2865,19 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
View[] publicViews = new View[]{mPublicLayout};
|
View[] publicViews = new View[]{mPublicLayout};
|
||||||
View[] hiddenChildren = showingPublic ? privateViews : publicViews;
|
View[] hiddenChildren = showingPublic ? privateViews : publicViews;
|
||||||
View[] shownChildren = showingPublic ? publicViews : privateViews;
|
View[] shownChildren = showingPublic ? publicViews : privateViews;
|
||||||
|
// disappear/appear overlap: 10 percent of duration
|
||||||
|
long overlap = duration / 10;
|
||||||
|
// disappear duration: 1/3 of duration + half of overlap
|
||||||
|
long disappearDuration = duration / 3 + overlap / 2;
|
||||||
|
// appear duration: 2/3 of duration + half of overlap
|
||||||
|
long appearDuration = (duration - disappearDuration) + overlap / 2;
|
||||||
for (final View hiddenView : hiddenChildren) {
|
for (final View hiddenView : hiddenChildren) {
|
||||||
hiddenView.setVisibility(View.VISIBLE);
|
hiddenView.setVisibility(View.VISIBLE);
|
||||||
hiddenView.animate().cancel();
|
hiddenView.animate().cancel();
|
||||||
hiddenView.animate()
|
hiddenView.animate()
|
||||||
.alpha(0f)
|
.alpha(0f)
|
||||||
.setStartDelay(delay)
|
.setStartDelay(delay)
|
||||||
.setDuration(duration)
|
.setDuration(disappearDuration)
|
||||||
.withEndAction(() -> {
|
.withEndAction(() -> {
|
||||||
hiddenView.setVisibility(View.INVISIBLE);
|
hiddenView.setVisibility(View.INVISIBLE);
|
||||||
resetAllContentAlphas();
|
resetAllContentAlphas();
|
||||||
@@ -2882,8 +2889,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
showView.animate().cancel();
|
showView.animate().cancel();
|
||||||
showView.animate()
|
showView.animate()
|
||||||
.alpha(1f)
|
.alpha(1f)
|
||||||
.setStartDelay(delay)
|
.setStartDelay(delay + duration - appearDuration)
|
||||||
.setDuration(duration);
|
.setDuration(appearDuration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase {
|
|||||||
|
|
||||||
FakeFeatureFlags fakeFeatureFlags = new FakeFeatureFlags();
|
FakeFeatureFlags fakeFeatureFlags = new FakeFeatureFlags();
|
||||||
fakeFeatureFlags.set(Flags.NOTIFICATION_ANIMATE_BIG_PICTURE, true);
|
fakeFeatureFlags.set(Flags.NOTIFICATION_ANIMATE_BIG_PICTURE, true);
|
||||||
|
fakeFeatureFlags.set(Flags.SENSITIVE_REVEAL_ANIM, false);
|
||||||
mNotificationTestHelper.setFeatureFlags(fakeFeatureFlags);
|
mNotificationTestHelper.setFeatureFlags(fakeFeatureFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user