summaryrefslogtreecommitdiffhomepage
path: root/app/src/main
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-11-27 00:43:34 +0100
committerSamuel Holland <samuel@sholland.org>2017-11-27 00:43:34 +0100
commitd43c87a869188d526a7a77c91d14673cc049defd (patch)
tree1981f9b17d90ca89186856ac8b615db7a2ad98c3 /app/src/main
parente421b997cd31088ca9cec96199b7acf965483eaa (diff)
QuickTileService: show app if no profiles exist
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/AndroidManifest.xml5
-rw-r--r--app/src/main/java/com/wireguard/android/QuickTileService.java6
-rw-r--r--app/src/main/res/values/strings.xml1
3 files changed, 8 insertions, 4 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 3ba0a77d..ee47f46d 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -17,6 +17,7 @@
android:name=".AddActivity"
android:label="@string/add_activity_title"
android:parentActivityName=".ConfigActivity" />
+
<activity android:name=".ConfigActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -24,9 +25,11 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
+
<activity
android:name=".SettingsActivity"
- android:label="@string/settings">
+ android:label="@string/settings"
+ android:parentActivityName=".ConfigActivity">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
</intent-filter>
diff --git a/app/src/main/java/com/wireguard/android/QuickTileService.java b/app/src/main/java/com/wireguard/android/QuickTileService.java
index 9f97c6c4..31ebe568 100644
--- a/app/src/main/java/com/wireguard/android/QuickTileService.java
+++ b/app/src/main/java/com/wireguard/android/QuickTileService.java
@@ -29,6 +29,8 @@ public class QuickTileService extends TileService {
service.disable(config.getName());
else
service.enable(config.getName());
+ } else {
+ startActivityAndCollapse(new Intent(this, ConfigActivity.class));
}
}
@@ -60,8 +62,8 @@ public class QuickTileService extends TileService {
}
} else {
tile.setIcon(Icon.createWithResource(this, R.drawable.ic_tile_disabled));
- tile.setLabel(getString(R.string.loading));
- tile.setState(Tile.STATE_UNAVAILABLE);
+ tile.setLabel(getString(R.string.app_name));
+ tile.setState(Tile.STATE_INACTIVE);
}
tile.updateTile();
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 61602b12..9ed7bb3e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -23,7 +23,6 @@
<string name="hint_random">(random)</string>
<string name="iface">Interface</string>
<string name="listen_port">Listen port</string>
- <string name="loading">Loading</string>
<string name="mtu">MTU</string>
<string name="name">Name</string>
<string name="peer">Peer</string>