diff options
Diffstat (limited to 'src/com/android/launcher3/notification')
4 files changed, 19 insertions, 8 deletions
diff --git a/src/com/android/launcher3/notification/NotificationFooterLayout.java b/src/com/android/launcher3/notification/NotificationFooterLayout.java index 2455eabea..ad07d37bd 100644 --- a/src/com/android/launcher3/notification/NotificationFooterLayout.java +++ b/src/com/android/launcher3/notification/NotificationFooterLayout.java @@ -200,7 +200,9 @@ public class NotificationFooterLayout extends FrameLayout { PopupContainerWithArrow popup = PopupContainerWithArrow.getOpen( Launcher.getLauncher(getContext())); if (popup != null) { - Animator collapseFooter = popup.reduceNotificationViewHeight(getHeight(), + final int newHeight = getResources().getDimensionPixelSize( + R.dimen.notification_empty_footer_height); + Animator collapseFooter = popup.reduceNotificationViewHeight(getHeight() - newHeight, getResources().getInteger(R.integer.config_removeNotificationViewDuration)); collapseFooter.addListener(new AnimatorListenerAdapter() { @Override @@ -208,7 +210,7 @@ public class NotificationFooterLayout extends FrameLayout { ((ViewGroup) getParent()).findViewById(R.id.divider).setVisibility(GONE); // Keep view around because gutter is aligned to it, but remove height to // both hide the view and keep calculations correct for last dismissal. - getLayoutParams().height = 0; + getLayoutParams().height = newHeight; requestLayout(); } }); diff --git a/src/com/android/launcher3/notification/NotificationInfo.java b/src/com/android/launcher3/notification/NotificationInfo.java index 1b7c87b22..6e36f4f51 100644 --- a/src/com/android/launcher3/notification/NotificationInfo.java +++ b/src/com/android/launcher3/notification/NotificationInfo.java @@ -94,6 +94,9 @@ public class NotificationInfo implements View.OnClickListener { @Override public void onClick(View view) { + if (intent == null) { + return; + } final Launcher launcher = Launcher.getLauncher(view.getContext()); Bundle activityOptions = ActivityOptions.makeClipRevealAnimation( view, 0, 0, view.getWidth(), view.getHeight()).toBundle(); diff --git a/src/com/android/launcher3/notification/NotificationItemView.java b/src/com/android/launcher3/notification/NotificationItemView.java index 78c64d7da..ab94c32d0 100644 --- a/src/com/android/launcher3/notification/NotificationItemView.java +++ b/src/com/android/launcher3/notification/NotificationItemView.java @@ -90,9 +90,19 @@ public class NotificationItemView extends PopupItemView implements LogContainerP return mMainView; } + /** + * This method is used to calculate the height to remove when dismissing the last notification. + * We subtract the height of the footer in this case since the footer should be gone or in the + * process of being removed. + * @return The height of the entire notification item, minus the footer if it still exists. + */ public int getHeightMinusFooter() { - int footerHeight = mFooter.getParent() == null ? 0 : mFooter.getHeight(); - return getHeight() - footerHeight; + if (mFooter.getParent() == null) { + return getHeight(); + } + int excessFooterHeight = mFooter.getHeight() - getResources().getDimensionPixelSize( + R.dimen.notification_empty_footer_height); + return getHeight() - excessFooterHeight; } public Animator animateHeightRemoval(int heightToRemove, boolean shouldRemoveFromTop) { diff --git a/src/com/android/launcher3/notification/NotificationListener.java b/src/com/android/launcher3/notification/NotificationListener.java index 6a7098915..91266263f 100644 --- a/src/com/android/launcher3/notification/NotificationListener.java +++ b/src/com/android/launcher3/notification/NotificationListener.java @@ -32,7 +32,6 @@ import android.util.Log; import android.util.Pair; import com.android.launcher3.LauncherModel; -import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.util.PackageUserKey; import com.android.launcher3.util.SettingsObserver; @@ -164,9 +163,6 @@ public class NotificationListener extends NotificationListenerService { } public static void setNotificationsChangedListener(NotificationsChangedListener listener) { - if (!FeatureFlags.BADGE_ICONS) { - return; - } sNotificationsChangedListener = listener; NotificationListener notificationListener = getInstanceIfConnected(); |