Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +4 −3 Original line number Diff line number Diff line Loading @@ -267,8 +267,9 @@ public class BubbleController { BubbleView bubble = (BubbleView) mInflater.inflate( R.layout.bubble_view, mStackView, false /* attachToRoot */); bubble.setNotif(notif); if (shouldUseActivityView(mContext)) { bubble.setAppOverlayIntent(getAppOverlayIntent(notif)); PendingIntent bubbleIntent = getValidBubbleIntent(notif); if (shouldUseActivityView(mContext) || bubbleIntent != null) { bubble.setBubbleIntent(getValidBubbleIntent(notif)); } mBubbles.put(bubble.getKey(), bubble); mStackView.addBubble(bubble); Loading @@ -282,7 +283,7 @@ public class BubbleController { } @Nullable private PendingIntent getAppOverlayIntent(NotificationEntry notif) { private PendingIntent getValidBubbleIntent(NotificationEntry notif) { Notification notification = notif.notification.getNotification(); if (canLaunchInActivityView(notification.getBubbleMetadata() != null ? notification.getBubbleMetadata().getIntent() : null)) { Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +17 −1 Original line number Diff line number Diff line Loading @@ -38,9 +38,11 @@ import android.view.WindowManager; import android.view.animation.AccelerateInterpolator; import android.view.animation.OvershootInterpolator; import android.widget.FrameLayout; import android.widget.LinearLayout; import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.widget.ViewClippingUtil; import com.android.systemui.R; import com.android.systemui.statusbar.notification.collection.NotificationEntry; Loading Loading @@ -225,6 +227,19 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F notifyExpansionChanged(mExpandedBubble, true /* expanded */); } /** * Sets the entry that should be expanded and expands if needed. */ @VisibleForTesting public void setExpandedBubble(NotificationEntry entry) { for (int i = 0; i < mBubbleContainer.getChildCount(); i++) { BubbleView bv = (BubbleView) mBubbleContainer.getChildAt(i); if (entry.equals(bv.getEntry())) { setExpandedBubble(bv); } } } /** * Adds a bubble to the top of the stack. * Loading Loading @@ -456,7 +471,8 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F if (mExpandedBubble.hasAppOverlayIntent()) { // Bubble with activity view expanded state ActivityView expandedView = mExpandedBubble.getActivityView(); expandedView.setLayoutParams(new ViewGroup.LayoutParams( // XXX: gets added to linear layout expandedView.setLayoutParams(new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, mExpandedBubbleHeight)); final PendingIntent intent = mExpandedBubble.getAppOverlayIntent(); Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java +1 −1 Original line number Diff line number Diff line Loading @@ -298,7 +298,7 @@ public class BubbleView extends FrameLayout implements BubbleTouchHandler.Floati } public void setAppOverlayIntent(PendingIntent intent) { public void setBubbleIntent(PendingIntent intent) { mAppOverlayIntent = intent; } } packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.bubbles; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.atLeastOnce; Loading Loading @@ -160,6 +161,12 @@ public class BubbleControllerTest extends SysuiTestCase { stackView.expandStack(); assertTrue(mBubbleController.isStackExpanded()); stackView.setExpandedBubble(mRow.getEntry()); assertEquals(stackView.getExpandedBubble().getEntry(), mRow.getEntry()); stackView.setExpandedBubble(mRow2.getEntry()); assertEquals(stackView.getExpandedBubble().getEntry(), mRow2.getEntry()); mBubbleController.collapseStack(); assertFalse(mBubbleController.isStackExpanded()); } Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +4 −3 Original line number Diff line number Diff line Loading @@ -267,8 +267,9 @@ public class BubbleController { BubbleView bubble = (BubbleView) mInflater.inflate( R.layout.bubble_view, mStackView, false /* attachToRoot */); bubble.setNotif(notif); if (shouldUseActivityView(mContext)) { bubble.setAppOverlayIntent(getAppOverlayIntent(notif)); PendingIntent bubbleIntent = getValidBubbleIntent(notif); if (shouldUseActivityView(mContext) || bubbleIntent != null) { bubble.setBubbleIntent(getValidBubbleIntent(notif)); } mBubbles.put(bubble.getKey(), bubble); mStackView.addBubble(bubble); Loading @@ -282,7 +283,7 @@ public class BubbleController { } @Nullable private PendingIntent getAppOverlayIntent(NotificationEntry notif) { private PendingIntent getValidBubbleIntent(NotificationEntry notif) { Notification notification = notif.notification.getNotification(); if (canLaunchInActivityView(notification.getBubbleMetadata() != null ? notification.getBubbleMetadata().getIntent() : null)) { Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +17 −1 Original line number Diff line number Diff line Loading @@ -38,9 +38,11 @@ import android.view.WindowManager; import android.view.animation.AccelerateInterpolator; import android.view.animation.OvershootInterpolator; import android.widget.FrameLayout; import android.widget.LinearLayout; import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.widget.ViewClippingUtil; import com.android.systemui.R; import com.android.systemui.statusbar.notification.collection.NotificationEntry; Loading Loading @@ -225,6 +227,19 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F notifyExpansionChanged(mExpandedBubble, true /* expanded */); } /** * Sets the entry that should be expanded and expands if needed. */ @VisibleForTesting public void setExpandedBubble(NotificationEntry entry) { for (int i = 0; i < mBubbleContainer.getChildCount(); i++) { BubbleView bv = (BubbleView) mBubbleContainer.getChildAt(i); if (entry.equals(bv.getEntry())) { setExpandedBubble(bv); } } } /** * Adds a bubble to the top of the stack. * Loading Loading @@ -456,7 +471,8 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F if (mExpandedBubble.hasAppOverlayIntent()) { // Bubble with activity view expanded state ActivityView expandedView = mExpandedBubble.getActivityView(); expandedView.setLayoutParams(new ViewGroup.LayoutParams( // XXX: gets added to linear layout expandedView.setLayoutParams(new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, mExpandedBubbleHeight)); final PendingIntent intent = mExpandedBubble.getAppOverlayIntent(); Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java +1 −1 Original line number Diff line number Diff line Loading @@ -298,7 +298,7 @@ public class BubbleView extends FrameLayout implements BubbleTouchHandler.Floati } public void setAppOverlayIntent(PendingIntent intent) { public void setBubbleIntent(PendingIntent intent) { mAppOverlayIntent = intent; } }
packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.bubbles; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.atLeastOnce; Loading Loading @@ -160,6 +161,12 @@ public class BubbleControllerTest extends SysuiTestCase { stackView.expandStack(); assertTrue(mBubbleController.isStackExpanded()); stackView.setExpandedBubble(mRow.getEntry()); assertEquals(stackView.getExpandedBubble().getEntry(), mRow.getEntry()); stackView.setExpandedBubble(mRow2.getEntry()); assertEquals(stackView.getExpandedBubble().getEntry(), mRow2.getEntry()); mBubbleController.collapseStack(); assertFalse(mBubbleController.isStackExpanded()); } Loading