Fixed a bug where the content height was wrong

when dragging down from a HUN the content height was
wrong.

Change-Id: Ic30e4de67625ed88942c71e68e6009b832d064ed
Fixes: 28563238
This commit is contained in:
Selim Cinek
2016-05-03 15:52:51 -07:00
parent 972123d1f1
commit def35a8653
3 changed files with 8 additions and 1 deletions

View File

@@ -455,7 +455,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
* @param pinned whether it is pinned
*/
public void setPinned(boolean pinned) {
int intrinsicHeight = getIntrinsicHeight();
mIsPinned = pinned;
if (intrinsicHeight != getIntrinsicHeight()) {
notifyHeightChanged(false);
}
if (pinned) {
setIconAnimationRunning(true);
mExpandedWhenPinned = false;

View File

@@ -103,10 +103,12 @@ public class HeadsUpTouchHelper implements Gefingerpoken {
mInitialTouchX = x;
mInitialTouchY = y;
int expandedHeight = mPickedChild.getActualHeight();
mHeadsUpManager.unpinAll();
mPanel.setPanelScrimMinFraction((float) expandedHeight
/ mPanel.getMaxPanelHeight());
mPanel.startExpandMotion(x, y, true /* startTracking */, expandedHeight);
// This call needs to be after the expansion start otherwise we will get a
// flicker of one frame as it's not expanded yet.
mHeadsUpManager.unpinAll();
mPanel.clearNotificationEffects();
return true;
}

View File

@@ -362,6 +362,7 @@ public abstract class PanelView extends FrameLayout {
mInitialTouchX = newX;
if (startTracking) {
mTouchSlopExceeded = true;
setExpandedHeight(mInitialOffsetOnTouch);
onTrackingStarted();
}
}