sysui: refactor for extensibility.

Add a flag to handleShowingDetail to indicate
whether it really wants to expand QS.

Bug: 29606112
Change-Id: I5738564a18787b5799817f762c787418f29f2e64
(cherry picked from commit 24822112c534c088d0985c20ea7a27df6e5f1785)
This commit is contained in:
Muyuan Li
2016-06-24 15:40:51 -07:00
parent 3d26f768a2
commit bc55b2af36

View File

@@ -152,12 +152,13 @@ public class QSDetail extends LinearLayout {
public void handleShowingDetail(final QSTile.DetailAdapter adapter, int x, int y) {
public void handleShowingDetail(final QSTile.DetailAdapter adapter, int x, int y,
boolean toggleQs) {
final boolean showingDetail = adapter != null;
setClickable(showingDetail);
if (showingDetail) {
setupDetailHeader(adapter);
if (!mFullyExpanded) {
if (toggleQs && !mFullyExpanded) {
mTriggeredExpand = true;
mHost.animateToggleQSExpansion();
} else {
@@ -169,7 +170,7 @@ public class QSDetail extends LinearLayout {
// Ensure we collapse into the same point we opened from.
x = mOpenX;
y = mOpenY;
if (mTriggeredExpand) {
if (toggleQs && mTriggeredExpand) {
mHost.animateToggleQSExpansion();
mTriggeredExpand = false;
}
@@ -291,7 +292,7 @@ public class QSDetail extends LinearLayout {
post(new Runnable() {
@Override
public void run() {
handleShowingDetail(detail, x, y);
handleShowingDetail(detail, x, y, true /* toggleQs */);
}
});
}