From a264f7ab36bf1335999d53cb4a0d753c54b231d0 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Wed, 5 Sep 2018 18:33:42 -0500 Subject: Auto-format the source directories Blame Jason for writing Java in vim. Signed-off-by: Jason A. Donenfeld --- .../com/wireguard/android/QuickTileService.java | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'app/src/main/java/com/wireguard/android/QuickTileService.java') diff --git a/app/src/main/java/com/wireguard/android/QuickTileService.java b/app/src/main/java/com/wireguard/android/QuickTileService.java index 28e2b2ee..2463896e 100644 --- a/app/src/main/java/com/wireguard/android/QuickTileService.java +++ b/app/src/main/java/com/wireguard/android/QuickTileService.java @@ -40,9 +40,9 @@ public class QuickTileService extends TileService { private final OnStateChangedCallback onStateChangedCallback = new OnStateChangedCallback(); private final OnTunnelChangedCallback onTunnelChangedCallback = new OnTunnelChangedCallback(); - @Nullable private Tunnel tunnel; - @Nullable private Icon iconOn; @Nullable private Icon iconOff; + @Nullable private Icon iconOn; + @Nullable private Tunnel tunnel; /* This works around an annoying unsolved frameworks bug some people are hitting. */ @Override @@ -57,6 +57,22 @@ public class QuickTileService extends TileService { return ret; } + @Override + public void onClick() { + if (tunnel != null) { + final Tile tile = getQsTile(); + if (tile != null) { + tile.setIcon(tile.getIcon() == iconOn ? iconOff : iconOn); + tile.updateTile(); + } + tunnel.setState(State.TOGGLE).whenComplete(this::onToggleFinished); + } else { + final Intent intent = new Intent(this, MainActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivityAndCollapse(intent); + } + } + @Override public void onCreate() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { @@ -79,22 +95,6 @@ public class QuickTileService extends TileService { iconOff = Icon.createWithBitmap(b); } - @Override - public void onClick() { - if (tunnel != null) { - final Tile tile = getQsTile(); - if (tile != null) { - tile.setIcon(tile.getIcon() == iconOn ? iconOff : iconOn); - tile.updateTile(); - } - tunnel.setState(State.TOGGLE).whenComplete(this::onToggleFinished); - } else { - final Intent intent = new Intent(this, MainActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivityAndCollapse(intent); - } - } - @Override public void onStartListening() { Application.getTunnelManager().addOnPropertyChangedCallback(onTunnelChangedCallback); -- cgit v1.2.3