am 6857ffc9: Merge "Fixed a jump with the panel scrim" into mnc-dev
* commit '6857ffc940bc204269de4ae2a1937794f254286a': Fixed a jump with the panel scrim
This commit is contained in:
@@ -110,6 +110,8 @@ public class HeadsUpTouchHelper implements Gefingerpoken {
|
|||||||
mInitialTouchX = x;
|
mInitialTouchX = x;
|
||||||
mInitialTouchY = y;
|
mInitialTouchY = y;
|
||||||
int expandedHeight = mPickedChild.getActualHeight();
|
int expandedHeight = mPickedChild.getActualHeight();
|
||||||
|
mPanel.setPanelScrimMinFraction((float) expandedHeight
|
||||||
|
/ mPanel.getMaxPanelHeight());
|
||||||
mPanel.startExpandMotion(x, y, true /* startTracking */, expandedHeight
|
mPanel.startExpandMotion(x, y, true /* startTracking */, expandedHeight
|
||||||
+ mNotificationsTopPadding);
|
+ mNotificationsTopPadding);
|
||||||
mHeadsUpManager.unpinAll();
|
mHeadsUpManager.unpinAll();
|
||||||
|
|||||||
@@ -1767,6 +1767,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mIsExpansionFromHeadsUp = false;
|
mIsExpansionFromHeadsUp = false;
|
||||||
mNotificationStackScroller.setTrackingHeadsUp(false);
|
mNotificationStackScroller.setTrackingHeadsUp(false);
|
||||||
mExpandingFromHeadsUp = false;
|
mExpandingFromHeadsUp = false;
|
||||||
|
setPanelScrimMinFraction(0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setListening(boolean listening) {
|
private void setListening(boolean listening) {
|
||||||
@@ -2317,7 +2318,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
}
|
}
|
||||||
x = Math.min(rightMost, Math.max(leftMost, x));
|
x = Math.min(rightMost, Math.max(leftMost, x));
|
||||||
setVerticalPanelTranslation(x -
|
setVerticalPanelTranslation(x -
|
||||||
(mNotificationStackScroller.getLeft() + mNotificationStackScroller.getWidth()/2));
|
(mNotificationStackScroller.getLeft() + mNotificationStackScroller.getWidth() / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetVerticalPanelPosition() {
|
private void resetVerticalPanelPosition() {
|
||||||
@@ -2334,4 +2335,8 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
mNotificationStackScroller.setStackHeight(stackHeight);
|
mNotificationStackScroller.setStackHeight(stackHeight);
|
||||||
updateKeyguardBottomAreaAlpha();
|
updateKeyguardBottomAreaAlpha();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setPanelScrimMinFraction(float minFraction) {
|
||||||
|
mBar.panelScrimMinFractionChanged(minFraction);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import android.widget.FrameLayout;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class PanelBar extends FrameLayout {
|
public abstract class PanelBar extends FrameLayout {
|
||||||
public static final boolean DEBUG = false;
|
public static final boolean DEBUG = false;
|
||||||
public static final String TAG = PanelBar.class.getSimpleName();
|
public static final String TAG = PanelBar.class.getSimpleName();
|
||||||
public static final void LOG(String fmt, Object... args) {
|
public static final void LOG(String fmt, Object... args) {
|
||||||
@@ -156,6 +156,8 @@ public class PanelBar extends FrameLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract void panelScrimMinFractionChanged(float minFraction);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param panel the panel which changed its expansion state
|
* @param panel the panel which changed its expansion state
|
||||||
* @param frac the fraction from the expansion in [0, 1]
|
* @param frac the fraction from the expansion in [0, 1]
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ public class PhoneStatusBarView extends PanelBar {
|
|||||||
PanelView mNotificationPanel;
|
PanelView mNotificationPanel;
|
||||||
private final PhoneStatusBarTransitions mBarTransitions;
|
private final PhoneStatusBarTransitions mBarTransitions;
|
||||||
private ScrimController mScrimController;
|
private ScrimController mScrimController;
|
||||||
|
private float mMinFraction;
|
||||||
|
private float mPanelFraction;
|
||||||
|
|
||||||
public PhoneStatusBarView(Context context, AttributeSet attrs) {
|
public PhoneStatusBarView(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@@ -179,9 +181,23 @@ public class PhoneStatusBarView extends PanelBar {
|
|||||||
return mBar.interceptTouchEvent(event) || super.onInterceptTouchEvent(event);
|
return mBar.interceptTouchEvent(event) || super.onInterceptTouchEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void panelScrimMinFractionChanged(float minFraction) {
|
||||||
|
if (mMinFraction != minFraction) {
|
||||||
|
mMinFraction = minFraction;
|
||||||
|
updateScrimFraction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void panelExpansionChanged(PanelView panel, float frac, boolean expanded) {
|
public void panelExpansionChanged(PanelView panel, float frac, boolean expanded) {
|
||||||
super.panelExpansionChanged(panel, frac, expanded);
|
super.panelExpansionChanged(panel, frac, expanded);
|
||||||
mScrimController.setPanelExpansion(frac);
|
mPanelFraction = frac;
|
||||||
|
updateScrimFraction();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateScrimFraction() {
|
||||||
|
float scrimFraction = Math.max(mPanelFraction - mMinFraction / (1.0f - mMinFraction), 0);
|
||||||
|
mScrimController.setPanelExpansion(scrimFraction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user