Merge "Update width of expanded view to match new spec" into sc-v2-dev
This commit is contained in:
@@ -124,7 +124,7 @@
|
|||||||
should also be updated. -->
|
should also be updated. -->
|
||||||
<dimen name="bubble_expanded_default_height">180dp</dimen>
|
<dimen name="bubble_expanded_default_height">180dp</dimen>
|
||||||
<!-- On large screens the width of the expanded view is restricted to this size. -->
|
<!-- On large screens the width of the expanded view is restricted to this size. -->
|
||||||
<dimen name="bubble_expanded_view_tablet_width">412dp</dimen>
|
<dimen name="bubble_expanded_view_phone_landscape_overflow_width">412dp</dimen>
|
||||||
<!-- Inset to apply to the icon in the overflow button. -->
|
<!-- Inset to apply to the icon in the overflow button. -->
|
||||||
<dimen name="bubble_overflow_icon_inset">30dp</dimen>
|
<dimen name="bubble_overflow_icon_inset">30dp</dimen>
|
||||||
<!-- Default (and minimum) height of bubble overflow -->
|
<!-- Default (and minimum) height of bubble overflow -->
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ public class BubblePositioner {
|
|||||||
public static final float FLYOUT_MAX_WIDTH_PERCENT_LARGE_SCREEN = 0.3f;
|
public static final float FLYOUT_MAX_WIDTH_PERCENT_LARGE_SCREEN = 0.3f;
|
||||||
/** The max percent of screen width to use for the flyout on phone. */
|
/** The max percent of screen width to use for the flyout on phone. */
|
||||||
public static final float FLYOUT_MAX_WIDTH_PERCENT = 0.6f;
|
public static final float FLYOUT_MAX_WIDTH_PERCENT = 0.6f;
|
||||||
|
/** The percent of screen width that should be used for the expanded view on a large screen. **/
|
||||||
|
public static final float EXPANDED_VIEW_LARGE_SCREEN_WIDTH_PERCENT = 0.72f;
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private WindowManager mWindowManager;
|
private WindowManager mWindowManager;
|
||||||
@@ -78,7 +79,8 @@ public class BubblePositioner {
|
|||||||
|
|
||||||
private int mBubbleSize;
|
private int mBubbleSize;
|
||||||
private int mSpacingBetweenBubbles;
|
private int mSpacingBetweenBubbles;
|
||||||
private int mExpandedViewLargeScreenWidth;
|
private float mExpandedViewLargeScreenWidth;
|
||||||
|
private int mOverflowWidth;
|
||||||
private int mExpandedViewPadding;
|
private int mExpandedViewPadding;
|
||||||
private int mPointerMargin;
|
private int mPointerMargin;
|
||||||
private int mPointerWidth;
|
private int mPointerWidth;
|
||||||
@@ -166,9 +168,11 @@ public class BubblePositioner {
|
|||||||
mBubbleSize = res.getDimensionPixelSize(R.dimen.bubble_size);
|
mBubbleSize = res.getDimensionPixelSize(R.dimen.bubble_size);
|
||||||
mSpacingBetweenBubbles = res.getDimensionPixelSize(R.dimen.bubble_spacing);
|
mSpacingBetweenBubbles = res.getDimensionPixelSize(R.dimen.bubble_spacing);
|
||||||
mDefaultMaxBubbles = res.getInteger(R.integer.bubbles_max_rendered);
|
mDefaultMaxBubbles = res.getInteger(R.integer.bubbles_max_rendered);
|
||||||
|
mExpandedViewLargeScreenWidth = bounds.width() * EXPANDED_VIEW_LARGE_SCREEN_WIDTH_PERCENT;
|
||||||
mExpandedViewLargeScreenWidth = res.getDimensionPixelSize(
|
mOverflowWidth = mIsLargeScreen
|
||||||
R.dimen.bubble_expanded_view_tablet_width);
|
? (int) mExpandedViewLargeScreenWidth
|
||||||
|
: res.getDimensionPixelSize(
|
||||||
|
R.dimen.bubble_expanded_view_phone_landscape_overflow_width);
|
||||||
mExpandedViewPadding = res.getDimensionPixelSize(R.dimen.bubble_expanded_view_padding);
|
mExpandedViewPadding = res.getDimensionPixelSize(R.dimen.bubble_expanded_view_padding);
|
||||||
mPointerWidth = res.getDimensionPixelSize(R.dimen.bubble_pointer_width);
|
mPointerWidth = res.getDimensionPixelSize(R.dimen.bubble_pointer_width);
|
||||||
mPointerHeight = res.getDimensionPixelSize(R.dimen.bubble_pointer_height);
|
mPointerHeight = res.getDimensionPixelSize(R.dimen.bubble_pointer_height);
|
||||||
@@ -299,16 +303,19 @@ public class BubblePositioner {
|
|||||||
int leftPadding = mInsets.left + mExpandedViewPadding;
|
int leftPadding = mInsets.left + mExpandedViewPadding;
|
||||||
int rightPadding = mInsets.right + mExpandedViewPadding;
|
int rightPadding = mInsets.right + mExpandedViewPadding;
|
||||||
final boolean isLargeOrOverflow = mIsLargeScreen || isOverflow;
|
final boolean isLargeOrOverflow = mIsLargeScreen || isOverflow;
|
||||||
|
final float expandedViewWidth = isOverflow
|
||||||
|
? mOverflowWidth
|
||||||
|
: mExpandedViewLargeScreenWidth;
|
||||||
if (showBubblesVertically()) {
|
if (showBubblesVertically()) {
|
||||||
if (!onLeft) {
|
if (!onLeft) {
|
||||||
rightPadding += mBubbleSize - mPointerHeight;
|
rightPadding += mBubbleSize - mPointerHeight;
|
||||||
leftPadding += isLargeOrOverflow
|
leftPadding += isLargeOrOverflow
|
||||||
? (mPositionRect.width() - rightPadding - mExpandedViewLargeScreenWidth)
|
? (mPositionRect.width() - rightPadding - expandedViewWidth)
|
||||||
: 0;
|
: 0;
|
||||||
} else {
|
} else {
|
||||||
leftPadding += mBubbleSize - mPointerHeight;
|
leftPadding += mBubbleSize - mPointerHeight;
|
||||||
rightPadding += isLargeOrOverflow
|
rightPadding += isLargeOrOverflow
|
||||||
? (mPositionRect.width() - leftPadding - mExpandedViewLargeScreenWidth)
|
? (mPositionRect.width() - leftPadding - expandedViewWidth)
|
||||||
: 0;
|
: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,9 +64,6 @@ public class ExpandedAnimationController
|
|||||||
/** Stiffness for the expand/collapse path-following animation. */
|
/** Stiffness for the expand/collapse path-following animation. */
|
||||||
private static final int EXPAND_COLLAPSE_ANIM_STIFFNESS = 1000;
|
private static final int EXPAND_COLLAPSE_ANIM_STIFFNESS = 1000;
|
||||||
|
|
||||||
/** What percentage of the screen to use when centering the bubbles in landscape. */
|
|
||||||
private static final float CENTER_BUBBLES_LANDSCAPE_PERCENT = 0.66f;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Velocity required to dismiss an individual bubble without dragging it into the dismiss
|
* Velocity required to dismiss an individual bubble without dragging it into the dismiss
|
||||||
* target.
|
* target.
|
||||||
|
|||||||
Reference in New Issue
Block a user