Merge "Enable overflow" into rvc-dev am: 8f24e99754 am: 2c3b89e015 am: 66a2356ead
Change-Id: Ib36b078be2dc1e105328ebc02f197b85c6c20284
This commit is contained in:
@@ -73,9 +73,6 @@ public class BubbleExperimentConfig {
|
||||
|
||||
private static final String WHITELISTED_AUTO_BUBBLE_APPS = "whitelisted_auto_bubble_apps";
|
||||
|
||||
private static final String ALLOW_BUBBLE_OVERFLOW = "allow_bubble_overflow";
|
||||
private static final boolean ALLOW_BUBBLE_OVERFLOW_DEFAULT = false;
|
||||
|
||||
/**
|
||||
* When true, if a notification has the information necessary to bubble (i.e. valid
|
||||
* contentIntent and an icon or image), then a {@link android.app.Notification.BubbleMetadata}
|
||||
@@ -130,16 +127,6 @@ public class BubbleExperimentConfig {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* When true, show a menu when a bubble is long-pressed, which will allow the user to take
|
||||
* actions on that bubble.
|
||||
*/
|
||||
static boolean allowBubbleOverflow(Context context) {
|
||||
return Settings.Secure.getInt(context.getContentResolver(),
|
||||
ALLOW_BUBBLE_OVERFLOW,
|
||||
ALLOW_BUBBLE_OVERFLOW_DEFAULT ? 1 : 0) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* If {@link #allowAnyNotifToBubble(Context)} is true, this method creates and adds
|
||||
* {@link android.app.Notification.BubbleMetadata} to the notification entry as long as
|
||||
|
||||
@@ -520,9 +520,6 @@ public class BubbleStackView extends FrameLayout {
|
||||
}
|
||||
|
||||
private void setUpOverflow() {
|
||||
if (!BubbleExperimentConfig.allowBubbleOverflow(mContext)) {
|
||||
return;
|
||||
}
|
||||
int overflowBtnIndex = 0;
|
||||
if (mBubbleOverflow == null) {
|
||||
mBubbleOverflow = new BubbleOverflow(mContext);
|
||||
@@ -733,8 +730,7 @@ public class BubbleStackView extends FrameLayout {
|
||||
@Nullable
|
||||
Bubble getExpandedBubble() {
|
||||
if (mExpandedBubble == null
|
||||
|| (BubbleExperimentConfig.allowBubbleOverflow(mContext)
|
||||
&& mExpandedBubble.getIconView() == mBubbleOverflow.getBtn()
|
||||
|| (mExpandedBubble.getIconView() == mBubbleOverflow.getBtn()
|
||||
&& mExpandedBubble.getKey() == BubbleOverflow.KEY)) {
|
||||
return null;
|
||||
}
|
||||
@@ -785,9 +781,6 @@ public class BubbleStackView extends FrameLayout {
|
||||
}
|
||||
|
||||
private void updateOverflowBtnVisibility(boolean apply) {
|
||||
if (!BubbleExperimentConfig.allowBubbleOverflow(mContext)) {
|
||||
return;
|
||||
}
|
||||
if (mIsExpanded) {
|
||||
if (DEBUG_BUBBLE_STACK_VIEW) {
|
||||
Log.d(TAG, "Show overflow button.");
|
||||
@@ -911,8 +904,7 @@ public class BubbleStackView extends FrameLayout {
|
||||
float y = event.getRawY();
|
||||
if (mIsExpanded) {
|
||||
if (isIntersecting(mBubbleContainer, x, y)) {
|
||||
if (BubbleExperimentConfig.allowBubbleOverflow(mContext)
|
||||
&& isIntersecting(mBubbleOverflow.getBtn(), x, y)) {
|
||||
if (isIntersecting(mBubbleOverflow.getBtn(), x, y)) {
|
||||
return mBubbleOverflow.getBtn();
|
||||
}
|
||||
// Could be tapping or dragging a bubble while expanded
|
||||
@@ -1645,11 +1637,8 @@ public class BubbleStackView extends FrameLayout {
|
||||
* @return the number of bubbles in the stack view.
|
||||
*/
|
||||
public int getBubbleCount() {
|
||||
if (BubbleExperimentConfig.allowBubbleOverflow(mContext)) {
|
||||
// Subtract 1 for the overflow button which is always in the bubble container.
|
||||
return mBubbleContainer.getChildCount() - 1;
|
||||
}
|
||||
return mBubbleContainer.getChildCount();
|
||||
// Subtract 1 for the overflow button that is always in the bubble container.
|
||||
return mBubbleContainer.getChildCount() - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user