Merge "resolve merge conflicts of 0cc0d229d0 to pi-dev-plus-aosp" into pi-dev-plus-aosp
This commit is contained in:
@@ -108,6 +108,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
private static final int COLORED_DIVIDER_ALPHA = 0x7B;
|
private static final int COLORED_DIVIDER_ALPHA = 0x7B;
|
||||||
private static final int MENU_VIEW_INDEX = 0;
|
private static final int MENU_VIEW_INDEX = 0;
|
||||||
private static final String TAG = "ExpandableNotifRow";
|
private static final String TAG = "ExpandableNotifRow";
|
||||||
|
public static final float DEFAULT_HEADER_VISIBLE_AMOUNT = 1.0f;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listener for when {@link ExpandableNotificationRow} is laid out.
|
* Listener for when {@link ExpandableNotificationRow} is laid out.
|
||||||
@@ -157,7 +158,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
private boolean mSensitiveHiddenInGeneral;
|
private boolean mSensitiveHiddenInGeneral;
|
||||||
private boolean mShowingPublicInitialized;
|
private boolean mShowingPublicInitialized;
|
||||||
private boolean mHideSensitiveForIntrinsicHeight;
|
private boolean mHideSensitiveForIntrinsicHeight;
|
||||||
private float mHeaderVisibleAmount = 1.0f;
|
private float mHeaderVisibleAmount = DEFAULT_HEADER_VISIBLE_AMOUNT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is this notification expanded by the system. The expansion state can be overridden by the
|
* Is this notification expanded by the system. The expansion state can be overridden by the
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import android.content.res.Configuration;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
import android.view.DisplayCutout;
|
import android.view.DisplayCutout;
|
||||||
@@ -38,6 +40,12 @@ import java.util.List;
|
|||||||
* The view in the statusBar that contains part of the heads-up information
|
* The view in the statusBar that contains part of the heads-up information
|
||||||
*/
|
*/
|
||||||
public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout {
|
public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout {
|
||||||
|
private static final String HEADS_UP_STATUS_BAR_VIEW_SUPER_PARCELABLE =
|
||||||
|
"heads_up_status_bar_view_super_parcelable";
|
||||||
|
private static final String FIRST_LAYOUT = "first_layout";
|
||||||
|
private static final String PUBLIC_MODE = "public_mode";
|
||||||
|
private static final String VISIBILITY = "visibility";
|
||||||
|
private static final String ALPHA = "alpha";
|
||||||
private int mAbsoluteStartPadding;
|
private int mAbsoluteStartPadding;
|
||||||
private int mEndMargin;
|
private int mEndMargin;
|
||||||
private View mIconPlaceholder;
|
private View mIconPlaceholder;
|
||||||
@@ -107,6 +115,39 @@ public class HeadsUpStatusBarView extends AlphaOptimizedLinearLayout {
|
|||||||
updateMaxWidth();
|
updateMaxWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Bundle onSaveInstanceState() {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putParcelable(HEADS_UP_STATUS_BAR_VIEW_SUPER_PARCELABLE,
|
||||||
|
super.onSaveInstanceState());
|
||||||
|
bundle.putBoolean(FIRST_LAYOUT, mFirstLayout);
|
||||||
|
bundle.putBoolean(PUBLIC_MODE, mPublicMode);
|
||||||
|
bundle.putInt(VISIBILITY, getVisibility());
|
||||||
|
bundle.putFloat(ALPHA, getAlpha());
|
||||||
|
|
||||||
|
return bundle;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRestoreInstanceState(Parcelable state) {
|
||||||
|
if (state == null || !(state instanceof Bundle)) {
|
||||||
|
super.onRestoreInstanceState(state);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bundle bundle = (Bundle) state;
|
||||||
|
Parcelable superState = bundle.getParcelable(HEADS_UP_STATUS_BAR_VIEW_SUPER_PARCELABLE);
|
||||||
|
super.onRestoreInstanceState(superState);
|
||||||
|
mFirstLayout = bundle.getBoolean(FIRST_LAYOUT, true);
|
||||||
|
mPublicMode = bundle.getBoolean(PUBLIC_MODE, false);
|
||||||
|
if (bundle.containsKey(VISIBILITY)) {
|
||||||
|
setVisibility(bundle.getInt(VISIBILITY));
|
||||||
|
}
|
||||||
|
if (bundle.containsKey(ALPHA)) {
|
||||||
|
setAlpha(bundle.getFloat(ALPHA));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public HeadsUpStatusBarView(Context context, View iconPlaceholder, TextView textView) {
|
public HeadsUpStatusBarView(Context context, View iconPlaceholder, TextView textView) {
|
||||||
this(context);
|
this(context);
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.systemui.statusbar.notification;
|
package com.android.systemui.statusbar.notification;
|
||||||
|
|
||||||
|
import static com.android.systemui.statusbar.ExpandableNotificationRow
|
||||||
|
.DEFAULT_HEADER_VISIBLE_AMOUNT;
|
||||||
import static com.android.systemui.statusbar.notification.TransformState.TRANSFORM_Y;
|
import static com.android.systemui.statusbar.notification.TransformState.TRANSFORM_Y;
|
||||||
|
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
@@ -123,6 +125,9 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
|
|||||||
|
|
||||||
// Reinspect the notification.
|
// Reinspect the notification.
|
||||||
resolveHeaderViews();
|
resolveHeaderViews();
|
||||||
|
if (row.getHeaderVisibleAmount() != DEFAULT_HEADER_VISIBLE_AMOUNT) {
|
||||||
|
setHeaderVisibleAmount(row.getHeaderVisibleAmount());
|
||||||
|
}
|
||||||
updateTransformedTypes();
|
updateTransformedTypes();
|
||||||
addRemainingTransformTypes();
|
addRemainingTransformTypes();
|
||||||
updateCropToPaddingForImageViews();
|
updateCropToPaddingForImageViews();
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import android.annotation.Nullable;
|
|||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.app.StatusBarManager;
|
import android.app.StatusBarManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.util.SparseArray;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -89,7 +91,8 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
|||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
mStatusBar = (PhoneStatusBarView) view;
|
mStatusBar = (PhoneStatusBarView) view;
|
||||||
if (savedInstanceState != null && savedInstanceState.containsKey(EXTRA_PANEL_STATE)) {
|
if (savedInstanceState != null && savedInstanceState.containsKey(EXTRA_PANEL_STATE)) {
|
||||||
mStatusBar.go(savedInstanceState.getInt(EXTRA_PANEL_STATE));
|
mStatusBar.restoreHierarchyState(
|
||||||
|
savedInstanceState.getSparseParcelableArray(EXTRA_PANEL_STATE));
|
||||||
}
|
}
|
||||||
mDarkIconManager = new DarkIconManager(view.findViewById(R.id.statusIcons));
|
mDarkIconManager = new DarkIconManager(view.findViewById(R.id.statusIcons));
|
||||||
mDarkIconManager.setShouldLog(true);
|
mDarkIconManager.setShouldLog(true);
|
||||||
@@ -105,7 +108,9 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
|||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(Bundle outState) {
|
public void onSaveInstanceState(Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
outState.putInt(EXTRA_PANEL_STATE, mStatusBar.getState());
|
SparseArray<Parcelable> states = new SparseArray<>();
|
||||||
|
mStatusBar.saveHierarchyState(states);
|
||||||
|
outState.putSparseParcelableArray(EXTRA_PANEL_STATE, states);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -55,9 +55,12 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener,
|
|||||||
mSetTrackingHeadsUp = this::setTrackingHeadsUp;
|
mSetTrackingHeadsUp = this::setTrackingHeadsUp;
|
||||||
private final Runnable mUpdatePanelTranslation = this::updatePanelTranslation;
|
private final Runnable mUpdatePanelTranslation = this::updatePanelTranslation;
|
||||||
private final BiConsumer<Float, Float> mSetExpandedHeight = this::setExpandedHeight;
|
private final BiConsumer<Float, Float> mSetExpandedHeight = this::setExpandedHeight;
|
||||||
private float mExpandedHeight;
|
@VisibleForTesting
|
||||||
private boolean mIsExpanded;
|
float mExpandedHeight;
|
||||||
private float mExpandFraction;
|
@VisibleForTesting
|
||||||
|
boolean mIsExpanded;
|
||||||
|
@VisibleForTesting
|
||||||
|
float mExpandFraction;
|
||||||
private ExpandableNotificationRow mTrackedChild;
|
private ExpandableNotificationRow mTrackedChild;
|
||||||
private boolean mShown;
|
private boolean mShown;
|
||||||
private final View.OnLayoutChangeListener mStackScrollLayoutChangeListener =
|
private final View.OnLayoutChangeListener mStackScrollLayoutChangeListener =
|
||||||
@@ -106,6 +109,20 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener,
|
|||||||
mOperatorNameView = operatorNameView;
|
mOperatorNameView = operatorNameView;
|
||||||
mDarkIconDispatcher = Dependency.get(DarkIconDispatcher.class);
|
mDarkIconDispatcher = Dependency.get(DarkIconDispatcher.class);
|
||||||
mDarkIconDispatcher.addDarkReceiver(this);
|
mDarkIconDispatcher.addDarkReceiver(this);
|
||||||
|
|
||||||
|
mHeadsUpStatusBarView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onLayoutChange(View v, int left, int top, int right, int bottom,
|
||||||
|
int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
||||||
|
if (shouldBeVisible()) {
|
||||||
|
updateTopEntry();
|
||||||
|
|
||||||
|
// trigger scroller to notify the latest panel translation
|
||||||
|
mStackScroller.requestLayout();
|
||||||
|
}
|
||||||
|
mHeadsUpStatusBarView.removeOnLayoutChangeListener(this);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -339,4 +356,13 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener,
|
|||||||
mHeadsUpStatusBarView.setPublicMode(publicMode);
|
mHeadsUpStatusBarView.setPublicMode(publicMode);
|
||||||
updateTopEntry();
|
updateTopEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void readFrom(HeadsUpAppearanceController oldController) {
|
||||||
|
if (oldController != null) {
|
||||||
|
mTrackedChild = oldController.mTrackedChild;
|
||||||
|
mExpandedHeight = oldController.mExpandedHeight;
|
||||||
|
mIsExpanded = oldController.mIsExpanded;
|
||||||
|
mExpandFraction = oldController.mExpandFraction;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
package com.android.systemui.statusbar.phone;
|
package com.android.systemui.statusbar.phone;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
@@ -27,6 +29,8 @@ 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();
|
||||||
private static final boolean SPEW = false;
|
private static final boolean SPEW = false;
|
||||||
|
private static final String PANEL_BAR_SUPER_PARCELABLE = "panel_bar_super_parcelable";
|
||||||
|
private static final String STATE = "state";
|
||||||
private boolean mBouncerShowing;
|
private boolean mBouncerShowing;
|
||||||
private boolean mExpanded;
|
private boolean mExpanded;
|
||||||
protected float mPanelFraction;
|
protected float mPanelFraction;
|
||||||
@@ -49,8 +53,26 @@ public abstract class PanelBar extends FrameLayout {
|
|||||||
mState = state;
|
mState = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getState() {
|
@Override
|
||||||
return mState;
|
protected Parcelable onSaveInstanceState() {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putParcelable(PANEL_BAR_SUPER_PARCELABLE, super.onSaveInstanceState());
|
||||||
|
bundle.putInt(STATE, mState);
|
||||||
|
return bundle;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onRestoreInstanceState(Parcelable state) {
|
||||||
|
if (state == null || !(state instanceof Bundle)) {
|
||||||
|
super.onRestoreInstanceState(state);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bundle bundle = (Bundle) state;
|
||||||
|
super.onRestoreInstanceState(bundle.getParcelable(PANEL_BAR_SUPER_PARCELABLE));
|
||||||
|
if (((Bundle) state).containsKey(STATE)) {
|
||||||
|
go(bundle.getInt(STATE, STATE_CLOSED));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public PanelBar(Context context, AttributeSet attrs) {
|
public PanelBar(Context context, AttributeSet attrs) {
|
||||||
|
|||||||
@@ -850,12 +850,25 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
mStatusBarView.setBar(this);
|
mStatusBarView.setBar(this);
|
||||||
mStatusBarView.setPanel(mNotificationPanel);
|
mStatusBarView.setPanel(mNotificationPanel);
|
||||||
mStatusBarView.setScrimController(mScrimController);
|
mStatusBarView.setScrimController(mScrimController);
|
||||||
|
|
||||||
|
// CollapsedStatusBarFragment re-inflated PhoneStatusBarView and both of
|
||||||
|
// mStatusBarView.mExpanded and mStatusBarView.mBouncerShowing are false.
|
||||||
|
// PhoneStatusBarView's new instance will set to be gone in
|
||||||
|
// PanelBar.updateVisibility after calling mStatusBarView.setBouncerShowing
|
||||||
|
// that will trigger PanelBar.updateVisibility. If there is a heads up showing,
|
||||||
|
// it needs to notify PhoneStatusBarView's new instance to update the correct
|
||||||
|
// status by calling mNotificationPanel.notifyBarPanelExpansionChanged().
|
||||||
|
if (mHeadsUpManager.hasPinnedHeadsUp()) {
|
||||||
|
mNotificationPanel.notifyBarPanelExpansionChanged();
|
||||||
|
}
|
||||||
mStatusBarView.setBouncerShowing(mBouncerShowing);
|
mStatusBarView.setBouncerShowing(mBouncerShowing);
|
||||||
if (oldStatusBarView != null) {
|
if (oldStatusBarView != null) {
|
||||||
float fraction = oldStatusBarView.getExpansionFraction();
|
float fraction = oldStatusBarView.getExpansionFraction();
|
||||||
boolean expanded = oldStatusBarView.isExpanded();
|
boolean expanded = oldStatusBarView.isExpanded();
|
||||||
mStatusBarView.panelExpansionChanged(fraction, expanded);
|
mStatusBarView.panelExpansionChanged(fraction, expanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HeadsUpAppearanceController oldController = mHeadsUpAppearanceController;
|
||||||
if (mHeadsUpAppearanceController != null) {
|
if (mHeadsUpAppearanceController != null) {
|
||||||
// This view is being recreated, let's destroy the old one
|
// This view is being recreated, let's destroy the old one
|
||||||
mHeadsUpAppearanceController.destroy();
|
mHeadsUpAppearanceController.destroy();
|
||||||
@@ -863,6 +876,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
mHeadsUpAppearanceController = new HeadsUpAppearanceController(
|
mHeadsUpAppearanceController = new HeadsUpAppearanceController(
|
||||||
mNotificationIconAreaController, mHeadsUpManager, mStatusBarWindow);
|
mNotificationIconAreaController, mHeadsUpManager, mStatusBarWindow);
|
||||||
mStatusBarWindow.setStatusBarView(mStatusBarView);
|
mStatusBarWindow.setStatusBarView(mStatusBarView);
|
||||||
|
mHeadsUpAppearanceController.readFrom(oldController);
|
||||||
setAreThereNotifications();
|
setAreThereNotifications();
|
||||||
checkBarModes();
|
checkBarModes();
|
||||||
}).getFragmentManager()
|
}).getFragmentManager()
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import android.content.res.TypedArray;
|
|||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
@@ -65,6 +66,12 @@ public class Clock extends TextView implements DemoMode, Tunable, CommandQueue.C
|
|||||||
DarkReceiver, ConfigurationListener {
|
DarkReceiver, ConfigurationListener {
|
||||||
|
|
||||||
public static final String CLOCK_SECONDS = "clock_seconds";
|
public static final String CLOCK_SECONDS = "clock_seconds";
|
||||||
|
private static final String CLOCK_SUPER_PARCELABLE = "clock_super_parcelable";
|
||||||
|
private static final String CURRENT_USER_ID = "current_user_id";
|
||||||
|
private static final String VISIBLE_BY_POLICY = "visible_by_policy";
|
||||||
|
private static final String VISIBLE_BY_USER = "visible_by_user";
|
||||||
|
private static final String SHOW_SECONDS = "show_seconds";
|
||||||
|
private static final String VISIBILITY = "visibility";
|
||||||
|
|
||||||
private final CurrentUserTracker mCurrentUserTracker;
|
private final CurrentUserTracker mCurrentUserTracker;
|
||||||
private int mCurrentUserId;
|
private int mCurrentUserId;
|
||||||
@@ -128,6 +135,40 @@ public class Clock extends TextView implements DemoMode, Tunable, CommandQueue.C
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Parcelable onSaveInstanceState() {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putParcelable(CLOCK_SUPER_PARCELABLE, super.onSaveInstanceState());
|
||||||
|
bundle.putInt(CURRENT_USER_ID, mCurrentUserId);
|
||||||
|
bundle.putBoolean(VISIBLE_BY_POLICY, mClockVisibleByPolicy);
|
||||||
|
bundle.putBoolean(VISIBLE_BY_USER, mClockVisibleByUser);
|
||||||
|
bundle.putBoolean(SHOW_SECONDS, mShowSeconds);
|
||||||
|
bundle.putInt(VISIBILITY, getVisibility());
|
||||||
|
|
||||||
|
return bundle;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRestoreInstanceState(Parcelable state) {
|
||||||
|
if (state == null || !(state instanceof Bundle)) {
|
||||||
|
super.onRestoreInstanceState(state);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bundle bundle = (Bundle) state;
|
||||||
|
Parcelable superState = bundle.getParcelable(CLOCK_SUPER_PARCELABLE);
|
||||||
|
super.onRestoreInstanceState(superState);
|
||||||
|
if (bundle.containsKey(CURRENT_USER_ID)) {
|
||||||
|
mCurrentUserId = bundle.getInt(CURRENT_USER_ID);
|
||||||
|
}
|
||||||
|
mClockVisibleByPolicy = bundle.getBoolean(VISIBLE_BY_POLICY, true);
|
||||||
|
mClockVisibleByUser = bundle.getBoolean(VISIBLE_BY_USER, true);
|
||||||
|
mShowSeconds = bundle.getBoolean(SHOW_SECONDS, false);
|
||||||
|
if (bundle.containsKey(VISIBILITY)) {
|
||||||
|
setVisibility(bundle.getInt(VISIBILITY));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onAttachedToWindow() {
|
protected void onAttachedToWindow() {
|
||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
|
|||||||
@@ -141,6 +141,27 @@ public class HeadsUpAppearanceControllerTest extends SysuiTestCase {
|
|||||||
Assert.assertEquals(View.VISIBLE, mOperatorNameView.getVisibility());
|
Assert.assertEquals(View.VISIBLE, mOperatorNameView.getVisibility());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testHeaderReadFromOldController() {
|
||||||
|
mHeadsUpAppearanceController.setExpandedHeight(1.0f, 1.0f);
|
||||||
|
|
||||||
|
HeadsUpAppearanceController newController = new HeadsUpAppearanceController(
|
||||||
|
mock(NotificationIconAreaController.class),
|
||||||
|
mHeadsUpManager,
|
||||||
|
mHeadsUpStatusBarView,
|
||||||
|
mStackScroller,
|
||||||
|
mPanelView,
|
||||||
|
new View(mContext));
|
||||||
|
newController.readFrom(mHeadsUpAppearanceController);
|
||||||
|
|
||||||
|
Assert.assertEquals(mHeadsUpAppearanceController.mExpandedHeight,
|
||||||
|
newController.mExpandedHeight, 0.0f);
|
||||||
|
Assert.assertEquals(mHeadsUpAppearanceController.mExpandFraction,
|
||||||
|
newController.mExpandFraction, 0.0f);
|
||||||
|
Assert.assertEquals(mHeadsUpAppearanceController.mIsExpanded,
|
||||||
|
newController.mIsExpanded);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDestroy() {
|
public void testDestroy() {
|
||||||
reset(mHeadsUpManager);
|
reset(mHeadsUpManager);
|
||||||
|
|||||||
Reference in New Issue
Block a user