Loading packages/SystemUI/src/com/android/systemui/statusbar/EmptyShadeView.java +11 −3 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import com.android.systemui.statusbar.stack.StackScrollState; public class EmptyShadeView extends StackScrollerDecorView { private TextView mEmptyText; public EmptyShadeView(Context context, AttributeSet attrs) { super(context, attrs); } Loading @@ -35,7 +37,7 @@ public class EmptyShadeView extends StackScrollerDecorView { @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); ((TextView) findViewById(R.id.no_notifications)).setText(R.string.empty_shade_text); mEmptyText.setText(R.string.empty_shade_text); } @Override Loading @@ -43,18 +45,24 @@ public class EmptyShadeView extends StackScrollerDecorView { return findViewById(R.id.no_notifications); } @Override protected void onFinishInflate() { super.onFinishInflate(); mEmptyText = (TextView) findContentView(); } @Override public ExpandableViewState createNewViewState(StackScrollState stackScrollState) { return new EmptyShadeViewState(); } public static class EmptyShadeViewState extends ExpandableViewState { public class EmptyShadeViewState extends ExpandableViewState { @Override public void applyToView(View view) { super.applyToView(view); if (view instanceof EmptyShadeView) { EmptyShadeView emptyShadeView = (EmptyShadeView) view; boolean visible = this.clipTopAmount <= 0; boolean visible = this.clipTopAmount <= mEmptyText.getPaddingTop() * 0.6f; emptyShadeView.performVisibilityAnimation( visible && !emptyShadeView.willBeGone()); } Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +12 −8 Original line number Diff line number Diff line Loading @@ -768,6 +768,7 @@ public class NotificationStackScrollLayout extends ViewGroup */ private float getAppearEndPosition() { int appearPosition; if (mEmptyShadeView.getVisibility() == GONE) { int minNotificationsForShelf = 1; if (mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp()) { appearPosition = mHeadsUpManager.getTopHeadsUpPinnedHeight(); Loading @@ -778,6 +779,9 @@ public class NotificationStackScrollLayout extends ViewGroup if (getNotGoneChildCount() >= minNotificationsForShelf) { appearPosition += mShelf.getIntrinsicHeight(); } } else { appearPosition = mEmptyShadeView.getHeight(); } return appearPosition + (onKeyguard() ? mTopPadding : mIntrinsicPadding); } Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +6 −0 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.view.ViewGroup; import com.android.systemui.R; import com.android.systemui.statusbar.DismissView; import com.android.systemui.statusbar.EmptyShadeView; import com.android.systemui.statusbar.ExpandableNotificationRow; import com.android.systemui.statusbar.ExpandableView; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.StackScrollerDecorView; import com.android.systemui.statusbar.notification.NotificationUtils; import java.util.ArrayList; Loading Loading @@ -324,11 +326,15 @@ public class StackScrollAlgorithm { int childHeight = getMaxAllowedChildHeight(child); childViewState.yTranslation = currentYPosition; boolean isDismissView = child instanceof DismissView; boolean isEmptyShadeView = child instanceof EmptyShadeView; childViewState.location = ExpandableViewState.LOCATION_MAIN_AREA; if (isDismissView) { childViewState.yTranslation = Math.min(childViewState.yTranslation, ambientState.getInnerHeight() - childHeight); } else if (isEmptyShadeView) { childViewState.yTranslation = ambientState.getInnerHeight() - childHeight + ambientState.getStackTranslation() * 0.25f; } else { clampPositionToShelf(childViewState, ambientState); } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/EmptyShadeView.java +11 −3 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import com.android.systemui.statusbar.stack.StackScrollState; public class EmptyShadeView extends StackScrollerDecorView { private TextView mEmptyText; public EmptyShadeView(Context context, AttributeSet attrs) { super(context, attrs); } Loading @@ -35,7 +37,7 @@ public class EmptyShadeView extends StackScrollerDecorView { @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); ((TextView) findViewById(R.id.no_notifications)).setText(R.string.empty_shade_text); mEmptyText.setText(R.string.empty_shade_text); } @Override Loading @@ -43,18 +45,24 @@ public class EmptyShadeView extends StackScrollerDecorView { return findViewById(R.id.no_notifications); } @Override protected void onFinishInflate() { super.onFinishInflate(); mEmptyText = (TextView) findContentView(); } @Override public ExpandableViewState createNewViewState(StackScrollState stackScrollState) { return new EmptyShadeViewState(); } public static class EmptyShadeViewState extends ExpandableViewState { public class EmptyShadeViewState extends ExpandableViewState { @Override public void applyToView(View view) { super.applyToView(view); if (view instanceof EmptyShadeView) { EmptyShadeView emptyShadeView = (EmptyShadeView) view; boolean visible = this.clipTopAmount <= 0; boolean visible = this.clipTopAmount <= mEmptyText.getPaddingTop() * 0.6f; emptyShadeView.performVisibilityAnimation( visible && !emptyShadeView.willBeGone()); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +12 −8 Original line number Diff line number Diff line Loading @@ -768,6 +768,7 @@ public class NotificationStackScrollLayout extends ViewGroup */ private float getAppearEndPosition() { int appearPosition; if (mEmptyShadeView.getVisibility() == GONE) { int minNotificationsForShelf = 1; if (mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp()) { appearPosition = mHeadsUpManager.getTopHeadsUpPinnedHeight(); Loading @@ -778,6 +779,9 @@ public class NotificationStackScrollLayout extends ViewGroup if (getNotGoneChildCount() >= minNotificationsForShelf) { appearPosition += mShelf.getIntrinsicHeight(); } } else { appearPosition = mEmptyShadeView.getHeight(); } return appearPosition + (onKeyguard() ? mTopPadding : mIntrinsicPadding); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +6 −0 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.view.ViewGroup; import com.android.systemui.R; import com.android.systemui.statusbar.DismissView; import com.android.systemui.statusbar.EmptyShadeView; import com.android.systemui.statusbar.ExpandableNotificationRow; import com.android.systemui.statusbar.ExpandableView; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.StackScrollerDecorView; import com.android.systemui.statusbar.notification.NotificationUtils; import java.util.ArrayList; Loading Loading @@ -324,11 +326,15 @@ public class StackScrollAlgorithm { int childHeight = getMaxAllowedChildHeight(child); childViewState.yTranslation = currentYPosition; boolean isDismissView = child instanceof DismissView; boolean isEmptyShadeView = child instanceof EmptyShadeView; childViewState.location = ExpandableViewState.LOCATION_MAIN_AREA; if (isDismissView) { childViewState.yTranslation = Math.min(childViewState.yTranslation, ambientState.getInnerHeight() - childHeight); } else if (isEmptyShadeView) { childViewState.yTranslation = ambientState.getInnerHeight() - childHeight + ambientState.getStackTranslation() * 0.25f; } else { clampPositionToShelf(childViewState, ambientState); } Loading