Merge "Fix footer not being hidden in detail panels" into oc-dev
am: 2a0b423cd4
Change-Id: I97266821c07fd307dbe04e5d715792e57bfa9c0d
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java b/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java
index f124e86..697db5f 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java
@@ -73,6 +73,7 @@
private int mOpenY;
private boolean mAnimatingOpen;
private boolean mSwitchState;
+ private View mFooter;
public QSDetail(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
@@ -116,9 +117,10 @@
mDetailDoneButton.setOnClickListener(doneListener);
}
- public void setQsPanel(QSPanel panel, QuickStatusBarHeader header) {
+ public void setQsPanel(QSPanel panel, QuickStatusBarHeader header, View footer) {
mQsPanel = panel;
mHeader = header;
+ mFooter = footer;
mHeader.setCallback(mQsPanelCallback);
mQsPanel.setCallback(mQsPanelCallback);
}
@@ -214,6 +216,7 @@
mDetailAdapter = null;
listener = mTeardownDetailWhenDone;
mHeader.setVisibility(View.VISIBLE);
+ mFooter.setVisibility(View.VISIBLE);
mQsPanel.setGridContentVisibility(true);
mQsPanelCallback.onScanStateChanged(false);
}
@@ -345,6 +348,7 @@
if (mDetailAdapter != null) {
mQsPanel.setGridContentVisibility(false);
mHeader.setVisibility(View.INVISIBLE);
+ mFooter.setVisibility(View.INVISIBLE);
}
mAnimatingOpen = false;
checkPendingAnimations();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java
index 3f00276..90275c5 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java
@@ -80,7 +80,7 @@
mFooter = view.findViewById(R.id.qs_footer);
mContainer = view.findViewById(id.quick_settings_container);
- mQSDetail.setQsPanel(mQSPanel, mHeader);
+ mQSDetail.setQsPanel(mQSPanel, mHeader, mFooter);
// If the quick settings row is not shown, then there is no need for the animation from
// the row to the full QS panel.
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSDetailTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSDetailTest.java
index 59eca50..6a85511 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSDetailTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSDetailTest.java
@@ -23,6 +23,8 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import org.junit.After;
+import org.junit.Ignore;
import android.support.test.filters.SmallTest;
import android.support.test.filters.FlakyTest;
import android.testing.AndroidTestingRunner;
@@ -38,8 +40,6 @@
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.qs.DetailAdapter;
-import org.junit.After;
-import org.junit.Ignore;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -67,7 +67,7 @@
mQsDetail = (QSDetail) LayoutInflater.from(mContext).inflate(R.layout.qs_detail, null);
mQsPanel = mock(QSPanel.class);
mQuickHeader = mock(QuickStatusBarHeader.class);
- mQsDetail.setQsPanel(mQsPanel, mQuickHeader);
+ mQsDetail.setQsPanel(mQsPanel, mQuickHeader, mock(View.class));
mMockDetailAdapter = mock(DetailAdapter.class);
when(mMockDetailAdapter.createDetailView(any(), any(), any()))