resolve merge conflicts of 4481b51 to master

Change-Id: I97489764bfe30507120b65e5e996aa4409435488
This commit is contained in:
Jason Monk
2016-07-15 12:32:33 -04:00
4 changed files with 19 additions and 4 deletions

View File

@@ -67,6 +67,8 @@ public class QSDetail extends LinearLayout {
private boolean mTriggeredExpand;
private int mOpenX;
private int mOpenY;
private boolean mAnimating;
private boolean mSwitchState;
public QSDetail(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
@@ -212,6 +214,7 @@ public class QSDetail extends LinearLayout {
protected void animateDetailVisibleDiff(int x, int y, boolean visibleDiff, AnimatorListener listener) {
if (visibleDiff) {
mAnimating = true;
if (mFullyExpanded || mDetailAdapter != null) {
setAlpha(1);
mClipper.animateCircularClip(x, y, mDetailAdapter != null, listener);
@@ -243,7 +246,7 @@ public class QSDetail extends LinearLayout {
mQsDetailHeader.setClickable(false);
} else {
mQsDetailHeaderSwitch.setVisibility(VISIBLE);
mQsDetailHeaderSwitch.setChecked(toggleState);
handleToggleStateChanged(toggleState);
mQsDetailHeader.setClickable(true);
mQsDetailHeader.setOnClickListener(new OnClickListener() {
@Override
@@ -257,6 +260,10 @@ public class QSDetail extends LinearLayout {
}
private void handleToggleStateChanged(boolean state) {
mSwitchState = state;
if (mAnimating) {
return;
}
mQsDetailHeaderSwitch.setChecked(state);
}
@@ -273,6 +280,10 @@ public class QSDetail extends LinearLayout {
}
}
private void checkPendingAnimations() {
handleToggleStateChanged(mSwitchState);
}
protected QSPanel.Callback mQsPanelCallback = new QSPanel.Callback() {
@Override
public void onToggleStateChanged(final boolean state) {
@@ -310,6 +321,8 @@ public class QSDetail extends LinearLayout {
// If we have been cancelled, remove the listener so that onAnimationEnd doesn't get
// called, this will avoid accidentally turning off the grid when we don't want to.
animation.removeListener(this);
mAnimating = false;
checkPendingAnimations();
};
@Override
@@ -319,6 +332,8 @@ public class QSDetail extends LinearLayout {
mQsPanel.setGridContentVisibility(false);
mHeader.setVisibility(View.INVISIBLE);
}
mAnimating = false;
checkPendingAnimations();
}
};

View File

@@ -90,11 +90,11 @@ public class BluetoothTile extends QSTile<QSTile.BooleanState> {
mHost.startActivityDismissingKeyguard(new Intent(Settings.ACTION_BLUETOOTH_SETTINGS));
return;
}
showDetail(true);
if (!mState.value) {
mState.value = true;
mController.setBluetoothEnabled(true);
}
showDetail(true);
}
@Override

View File

@@ -122,9 +122,9 @@ public class DndTile extends QSTile<QSTile.BooleanState> {
if (mState.value) {
mController.setZen(Global.ZEN_MODE_OFF, null, TAG);
} else {
showDetail(true);
int zen = Prefs.getInt(mContext, Prefs.Key.DND_FAVORITE_ZEN, Global.ZEN_MODE_ALARMS);
mController.setZen(zen, null, TAG);
showDetail(true);
}
}

View File

@@ -116,11 +116,11 @@ public class WifiTile extends QSTile<QSTile.SignalState> {
mHost.startActivityDismissingKeyguard(new Intent(Settings.ACTION_WIFI_SETTINGS));
return;
}
showDetail(true);
if (!mState.value) {
mController.setWifiEnabled(true);
mState.value = true;
}
showDetail(true);
}
@Override