Merge "Notification footer shows when there are zero notifications" into sc-dev
This commit is contained in:
@@ -25,6 +25,7 @@ import android.view.View;
|
|||||||
|
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.statusbar.notification.stack.ExpandableViewState;
|
import com.android.systemui.statusbar.notification.stack.ExpandableViewState;
|
||||||
|
import com.android.systemui.statusbar.notification.stack.ViewState;
|
||||||
|
|
||||||
public class FooterView extends StackScrollerDecorView {
|
public class FooterView extends StackScrollerDecorView {
|
||||||
private final int mClearAllTopPadding;
|
private final int mClearAllTopPadding;
|
||||||
@@ -121,6 +122,14 @@ public class FooterView extends StackScrollerDecorView {
|
|||||||
*/
|
*/
|
||||||
public boolean hideContent;
|
public boolean hideContent;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void copyFrom(ViewState viewState) {
|
||||||
|
super.copyFrom(viewState);
|
||||||
|
if (viewState instanceof FooterViewState) {
|
||||||
|
hideContent = ((FooterViewState) viewState).hideContent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applyToView(View view) {
|
public void applyToView(View view) {
|
||||||
super.applyToView(view);
|
super.applyToView(view);
|
||||||
|
|||||||
@@ -399,12 +399,15 @@ public class StackScrollAlgorithm {
|
|||||||
if (view instanceof FooterView) {
|
if (view instanceof FooterView) {
|
||||||
final boolean shadeClosed = !ambientState.isShadeExpanded();
|
final boolean shadeClosed = !ambientState.isShadeExpanded();
|
||||||
final boolean isShelfShowing = algorithmState.firstViewInShelf != null;
|
final boolean isShelfShowing = algorithmState.firstViewInShelf != null;
|
||||||
|
if (shadeClosed) {
|
||||||
final float footerEnd = algorithmState.mCurrentExpandedYPosition
|
viewState.hidden = true;
|
||||||
+ view.getIntrinsicHeight();
|
} else {
|
||||||
final boolean noSpaceForFooter = footerEnd > ambientState.getStackEndHeight();
|
final float footerEnd = algorithmState.mCurrentExpandedYPosition
|
||||||
((FooterView.FooterViewState) viewState).hideContent =
|
+ view.getIntrinsicHeight();
|
||||||
shadeClosed || isShelfShowing || noSpaceForFooter;
|
final boolean noSpaceForFooter = footerEnd > ambientState.getStackEndHeight();
|
||||||
|
((FooterView.FooterViewState) viewState).hideContent =
|
||||||
|
isShelfShowing || noSpaceForFooter;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (view != ambientState.getTrackedHeadsUpRow()) {
|
if (view != ambientState.getTrackedHeadsUpRow()) {
|
||||||
if (ambientState.isExpansionChanging()) {
|
if (ambientState.isExpansionChanging()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user