Merge "Use pointer width from res before getWidth is ready" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9a7f304d2f
@@ -350,14 +350,6 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return total height that the expanded view occupies.
|
|
||||||
*/
|
|
||||||
int getExpandedSize() {
|
|
||||||
return mBubbleHeight + mPointerView.getHeight() + mPointerMargin
|
|
||||||
+ mSettingsIconHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateHeight() {
|
void updateHeight() {
|
||||||
if (usingActivityView()) {
|
if (usingActivityView()) {
|
||||||
Notification.BubbleMetadata data = mEntry.getBubbleMetadata();
|
Notification.BubbleMetadata data = mEntry.getBubbleMetadata();
|
||||||
@@ -379,8 +371,8 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
|
|||||||
}
|
}
|
||||||
desiredHeight = desiredPx > 0 ? desiredPx : mMinHeight;
|
desiredHeight = desiredPx > 0 ? desiredPx : mMinHeight;
|
||||||
}
|
}
|
||||||
int max = mStackView.getMaxExpandedHeight() - mSettingsIconHeight
|
int max = mStackView.getMaxExpandedHeight() - mSettingsIconHeight - mPointerHeight
|
||||||
- mPointerView.getHeight() - mPointerMargin;
|
- mPointerMargin;
|
||||||
float height = Math.min(desiredHeight, max);
|
float height = Math.min(desiredHeight, max);
|
||||||
height = Math.max(height, mMinHeight);
|
height = Math.max(height, mMinHeight);
|
||||||
LayoutParams lp = (LayoutParams) mActivityView.getLayoutParams();
|
LayoutParams lp = (LayoutParams) mActivityView.getLayoutParams();
|
||||||
@@ -444,9 +436,9 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
|
|||||||
* Set the x position that the tip of the triangle should point to.
|
* Set the x position that the tip of the triangle should point to.
|
||||||
*/
|
*/
|
||||||
public void setPointerPosition(float x) {
|
public void setPointerPosition(float x) {
|
||||||
// Adjust for the pointer size
|
float halfPointerWidth = mPointerWidth / 2f;
|
||||||
x -= (mPointerView.getWidth() / 2f);
|
float pointerLeft = x - halfPointerWidth;
|
||||||
mPointerView.setTranslationX(x);
|
mPointerView.setTranslationX(pointerLeft);
|
||||||
mPointerView.setVisibility(VISIBLE);
|
mPointerView.setVisibility(VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user