Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Commit

Permalink
Make our FlipTile Universal
Browse files Browse the repository at this point in the history
Remove all the garbage we don't need, Add the stuff we actually need.
  • Loading branch information
mallardduck authored and Nick0703 committed Jun 9, 2014
1 parent 0263b95 commit 307971e
Show file tree
Hide file tree
Showing 21 changed files with 3 additions and 61 deletions.
Expand Up @@ -34,9 +34,6 @@ public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED); Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
intent.putExtra("state", !enabled); intent.putExtra("state", !enabled);
mContext.sendBroadcast(intent); mContext.sendBroadcast(intent);
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };
mOnLongClick = new OnLongClickListener() { mOnLongClick = new OnLongClickListener() {
Expand Down
Expand Up @@ -24,9 +24,6 @@ public AutoRotateTile(Context context, QuickSettingsController qsc, Handler hand
@Override @Override
public void onClick(View v) { public void onClick(View v) {
RotationPolicy.setRotationLock(mContext, getAutoRotation()); RotationPolicy.setRotationLock(mContext, getAutoRotation());
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -38,9 +38,6 @@ public void onClick(View v) {
} else { } else {
mBluetoothAdapter.enable(); mBluetoothAdapter.enable();
} }
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -34,9 +34,6 @@ public GPSTile(Context context, QuickSettingsController qsc, LocationController
@Override @Override
public void onClick(View v) { public void onClick(View v) {
changeLocationMode(); changeLocationMode();
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -31,9 +31,6 @@ public LteTile(Context context, QuickSettingsController qsc) {
public void onClick(View v) { public void onClick(View v) {
toggleLteState(); toggleLteState();
updateResources(); updateResources();
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -50,9 +50,6 @@ public void onClick(View v) {
updateOverlayImage(DISABLED_OVERLAY); updateOverlayImage(DISABLED_OVERLAY);
mCm.setMobileDataEnabled(false); mCm.setMobileDataEnabled(false);
} }
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -91,9 +91,6 @@ public void onClick(View v) {
mMode = NETWORK_MODE_UNKNOWN; mMode = NETWORK_MODE_UNKNOWN;
mContext.sendBroadcast(intent); mContext.sendBroadcast(intent);


if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -30,10 +30,6 @@ public NetworkAdbTile(Context context, QuickSettingsController qsc) {
public void onClick(View v) { public void onClick(View v) {
Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.ADB_PORT, !getEnabled() ? 5555 : -1); Settings.Secure.ADB_PORT, !getEnabled() ? 5555 : -1);

if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -25,9 +25,6 @@ public NfcTile(Context context,
public void onClick(View v) { public void onClick(View v) {
toggleState(); toggleState();
updateResources(); updateResources();
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -63,9 +63,6 @@ public PerformanceProfileTile(Context context, QuickSettingsController qsc) {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
changeToNextProfile(); changeToNextProfile();
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };
} }
Expand Down
Expand Up @@ -51,9 +51,6 @@ public ProfileTile(Context context,
@Override @Override
public void onClick(View v) { public void onClick(View v) {
createProfileDialog(); createProfileDialog();
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };
mOnLongClick = new View.OnLongClickListener() { mOnLongClick = new View.OnLongClickListener() {
Expand Down
Expand Up @@ -202,6 +202,9 @@ public void onClick(View v) {
if (mOnClick != null) { if (mOnClick != null) {
mOnClick.onClick(v); mOnClick.onClick(v);
} }
if (isFlipTilesEnabled()) {
flipTile(0);
}


ContentResolver resolver = mContext.getContentResolver(); ContentResolver resolver = mContext.getContentResolver();
boolean shouldCollapse = Settings.System.getIntForUser(resolver, boolean shouldCollapse = Settings.System.getIntForUser(resolver,
Expand Down
Expand Up @@ -36,9 +36,6 @@ public QuietHoursTile(Context context, QuickSettingsController qsc) {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
toggleState(); toggleState();
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };
mOnLongClick = new View.OnLongClickListener() { mOnLongClick = new View.OnLongClickListener() {
Expand Down
Expand Up @@ -45,9 +45,6 @@ public RingerModeTile(Context context, QuickSettingsController qsc) {
public void onClick(View v) { public void onClick(View v) {
toggleState(); toggleState();
updateResources(); updateResources();
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -37,9 +37,6 @@ public ScreenTimeoutTile(Context context, QuickSettingsController qsc) {
public void onClick(View v) { public void onClick(View v) {
toggleState(); toggleState();
updateResources(); updateResources();
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -23,9 +23,6 @@ public SleepScreenTile(Context context, QuickSettingsController qsc) {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
pm.goToSleep(SystemClock.uptimeMillis()); pm.goToSleep(SystemClock.uptimeMillis());
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };
mOnLongClick = new OnLongClickListener() { mOnLongClick = new OnLongClickListener() {
Expand Down
Expand Up @@ -24,9 +24,6 @@ public SyncTile(Context context, QuickSettingsController qsc) {
public void onClick(View v) { public void onClick(View v) {
toggleState(); toggleState();
updateResources(); updateResources();
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -34,9 +34,6 @@ public void onClick(View v) {
sDisabledLockscreen = !sDisabledLockscreen; sDisabledLockscreen = !sDisabledLockscreen;
mPrefs.edit().putBoolean(KEY_DISABLED, sDisabledLockscreen).apply(); mPrefs.edit().putBoolean(KEY_DISABLED, sDisabledLockscreen).apply();
updateLockscreenState(); updateLockscreenState();
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -27,9 +27,6 @@ public TorchTile(Context context,
public void onClick(View v) { public void onClick(View v) {
Intent i = new Intent(TorchConstants.ACTION_TOGGLE_STATE); Intent i = new Intent(TorchConstants.ACTION_TOGGLE_STATE);
mContext.sendBroadcast(i); mContext.sendBroadcast(i);
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };


Expand Down
Expand Up @@ -28,9 +28,6 @@ public UsbTetherTile(Context context, QuickSettingsController qsc) {
public void onClick(View v) { public void onClick(View v) {
if (mUsbConnected) { if (mUsbConnected) {
setUsbTethering(!mUsbTethered); setUsbTethering(!mUsbTethered);
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
} }
}; };
Expand Down
Expand Up @@ -35,9 +35,6 @@ public void onClick(View v) {
setSoftapEnabled(true); setSoftapEnabled(true);
break; break;
} }
if (isFlipTilesEnabled()) {
flipTile(0);
}
} }
}; };
mOnLongClick = new View.OnLongClickListener() { mOnLongClick = new View.OnLongClickListener() {
Expand Down

0 comments on commit 307971e

Please sign in to comment.