Loading packages/SystemUI/res/layout/status_bar_notification_row.xml +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ <Button android:id="@+id/veto" android:layout_width="48dp" android:layout_height="match_parent" android:layout_height="8dp" android:gravity="end" android:layout_marginEnd="-80dp" android:background="@null" Loading packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +23 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView = new PathInterpolator(0.6f, 0, 0.5f, 1); private static final Interpolator ACTIVATE_INVERSE_ALPHA_INTERPOLATOR = new PathInterpolator(0, 0, 0.5f, 1); private final int mMaxNotificationHeight; private boolean mDimmed; Loading Loading @@ -80,6 +81,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView AnimationUtils.loadInterpolator(context, android.R.interpolator.fast_out_slow_in); mLinearOutSlowInInterpolator = AnimationUtils.loadInterpolator(context, android.R.interpolator.linear_out_slow_in); mMaxNotificationHeight = getResources().getDimensionPixelSize(R.dimen.notification_max_height); setClipChildren(false); setClipToPadding(false); } Loading Loading @@ -292,6 +294,27 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView } } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int newHeightSpec = MeasureSpec.makeMeasureSpec(mMaxNotificationHeight, MeasureSpec.AT_MOST); int maxChildHeight = 0; int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); if (child != mBackgroundDimmed && child != mBackgroundNormal) { child.measure(widthMeasureSpec, newHeightSpec); int childHeight = child.getMeasuredHeight(); maxChildHeight = Math.max(maxChildHeight, childHeight); } } newHeightSpec = MeasureSpec.makeMeasureSpec(maxChildHeight, MeasureSpec.EXACTLY); mBackgroundDimmed.measure(widthMeasureSpec, newHeightSpec); mBackgroundNormal.measure(widthMeasureSpec, newHeightSpec); int width = MeasureSpec.getSize(widthMeasureSpec); setMeasuredDimension(width, maxChildHeight); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +1 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { @Override public void setActualHeight(int height, boolean notifyListeners) { mPrivateLayout.setActualHeight(height, notifyListeners); mPrivateLayout.setActualHeight(height); invalidate(); super.setActualHeight(height, notifyListeners); } Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +13 −3 Original line number Diff line number Diff line Loading @@ -20,12 +20,12 @@ import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.widget.FrameLayout; import android.view.ViewGroup; /** * An abstract view for expandable views. */ public abstract class ExpandableView extends FrameLayout { public abstract class ExpandableView extends ViewGroup { private OnHeightChangedListener mOnHeightChangedListener; protected int mActualHeight; Loading @@ -38,7 +38,17 @@ public abstract class ExpandableView extends FrameLayout { @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); int height = child.getMeasuredHeight(); int width = child.getMeasuredWidth(); int center = getWidth() / 2; int childLeft = center - width / 2; child.layout(childLeft, 0, childLeft + width, height); } if (!mActualHeightInitialized && mActualHeight == 0) { mActualHeight = getInitialHeight(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +7 −9 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.util.AttributeSet; import android.view.Gravity; import android.view.View; import android.widget.FrameLayout; import com.android.systemui.R; /** Loading @@ -29,7 +30,7 @@ import com.android.systemui.R; * expanded layout. This class is responsible for clipping the content and and switching between the * expanded and contracted view depending on its clipped size. */ public class NotificationContentView extends ExpandableView { public class NotificationContentView extends FrameLayout { private final Rect mClipBounds = new Rect(); Loading @@ -37,6 +38,8 @@ public class NotificationContentView extends ExpandableView { private View mExpandedChild; private int mSmallHeight; private int mClipTopAmount; private int mActualHeight; public NotificationContentView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -69,28 +72,24 @@ public class NotificationContentView extends ExpandableView { selectLayout(); } @Override public void setActualHeight(int actualHeight, boolean notifyListeners) { super.setActualHeight(actualHeight, notifyListeners); public void setActualHeight(int actualHeight) { mActualHeight = actualHeight; selectLayout(); updateClipping(); } @Override public int getMaxHeight() { // The maximum height is just the laid out height. return getHeight(); } @Override public int getMinHeight() { return mSmallHeight; } @Override public void setClipTopAmount(int clipTopAmount) { super.setClipTopAmount(clipTopAmount); mClipTopAmount = clipTopAmount; updateClipping(); } Loading Loading @@ -127,7 +126,6 @@ public class NotificationContentView extends ExpandableView { selectLayout(); } @Override public boolean isContentExpandable() { return mExpandedChild != null; } Loading Loading
packages/SystemUI/res/layout/status_bar_notification_row.xml +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ <Button android:id="@+id/veto" android:layout_width="48dp" android:layout_height="match_parent" android:layout_height="8dp" android:gravity="end" android:layout_marginEnd="-80dp" android:background="@null" Loading
packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +23 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView = new PathInterpolator(0.6f, 0, 0.5f, 1); private static final Interpolator ACTIVATE_INVERSE_ALPHA_INTERPOLATOR = new PathInterpolator(0, 0, 0.5f, 1); private final int mMaxNotificationHeight; private boolean mDimmed; Loading Loading @@ -80,6 +81,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView AnimationUtils.loadInterpolator(context, android.R.interpolator.fast_out_slow_in); mLinearOutSlowInInterpolator = AnimationUtils.loadInterpolator(context, android.R.interpolator.linear_out_slow_in); mMaxNotificationHeight = getResources().getDimensionPixelSize(R.dimen.notification_max_height); setClipChildren(false); setClipToPadding(false); } Loading Loading @@ -292,6 +294,27 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView } } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int newHeightSpec = MeasureSpec.makeMeasureSpec(mMaxNotificationHeight, MeasureSpec.AT_MOST); int maxChildHeight = 0; int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); if (child != mBackgroundDimmed && child != mBackgroundNormal) { child.measure(widthMeasureSpec, newHeightSpec); int childHeight = child.getMeasuredHeight(); maxChildHeight = Math.max(maxChildHeight, childHeight); } } newHeightSpec = MeasureSpec.makeMeasureSpec(maxChildHeight, MeasureSpec.EXACTLY); mBackgroundDimmed.measure(widthMeasureSpec, newHeightSpec); mBackgroundNormal.measure(widthMeasureSpec, newHeightSpec); int width = MeasureSpec.getSize(widthMeasureSpec); setMeasuredDimension(width, maxChildHeight); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +1 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { @Override public void setActualHeight(int height, boolean notifyListeners) { mPrivateLayout.setActualHeight(height, notifyListeners); mPrivateLayout.setActualHeight(height); invalidate(); super.setActualHeight(height, notifyListeners); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +13 −3 Original line number Diff line number Diff line Loading @@ -20,12 +20,12 @@ import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.widget.FrameLayout; import android.view.ViewGroup; /** * An abstract view for expandable views. */ public abstract class ExpandableView extends FrameLayout { public abstract class ExpandableView extends ViewGroup { private OnHeightChangedListener mOnHeightChangedListener; protected int mActualHeight; Loading @@ -38,7 +38,17 @@ public abstract class ExpandableView extends FrameLayout { @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); int height = child.getMeasuredHeight(); int width = child.getMeasuredWidth(); int center = getWidth() / 2; int childLeft = center - width / 2; child.layout(childLeft, 0, childLeft + width, height); } if (!mActualHeightInitialized && mActualHeight == 0) { mActualHeight = getInitialHeight(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +7 −9 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.util.AttributeSet; import android.view.Gravity; import android.view.View; import android.widget.FrameLayout; import com.android.systemui.R; /** Loading @@ -29,7 +30,7 @@ import com.android.systemui.R; * expanded layout. This class is responsible for clipping the content and and switching between the * expanded and contracted view depending on its clipped size. */ public class NotificationContentView extends ExpandableView { public class NotificationContentView extends FrameLayout { private final Rect mClipBounds = new Rect(); Loading @@ -37,6 +38,8 @@ public class NotificationContentView extends ExpandableView { private View mExpandedChild; private int mSmallHeight; private int mClipTopAmount; private int mActualHeight; public NotificationContentView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -69,28 +72,24 @@ public class NotificationContentView extends ExpandableView { selectLayout(); } @Override public void setActualHeight(int actualHeight, boolean notifyListeners) { super.setActualHeight(actualHeight, notifyListeners); public void setActualHeight(int actualHeight) { mActualHeight = actualHeight; selectLayout(); updateClipping(); } @Override public int getMaxHeight() { // The maximum height is just the laid out height. return getHeight(); } @Override public int getMinHeight() { return mSmallHeight; } @Override public void setClipTopAmount(int clipTopAmount) { super.setClipTopAmount(clipTopAmount); mClipTopAmount = clipTopAmount; updateClipping(); } Loading Loading @@ -127,7 +126,6 @@ public class NotificationContentView extends ExpandableView { selectLayout(); } @Override public boolean isContentExpandable() { return mExpandedChild != null; } Loading