diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-11-27 03:13:34 +0100 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-11-27 03:13:34 +0100 |
commit | ad16d2cc7b5a39c95450f9d7bd26a0895e8af76b (patch) | |
tree | 9e8624bbc218a0f454f15effbeb97c9f50261598 /app/src/main/java/com/wireguard/android/SettingsActivity.java | |
parent | b0bb46382c2887559d664f85581060748db3cd79 (diff) |
Settings: show quick tile config if no primary is defined
This seems like a horrific set of hacks.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/SettingsActivity.java')
-rw-r--r-- | app/src/main/java/com/wireguard/android/SettingsActivity.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/android/SettingsActivity.java b/app/src/main/java/com/wireguard/android/SettingsActivity.java index 6fa3f897..be9f5bf4 100644 --- a/app/src/main/java/com/wireguard/android/SettingsActivity.java +++ b/app/src/main/java/com/wireguard/android/SettingsActivity.java @@ -10,7 +10,11 @@ public class SettingsActivity extends Activity { protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); final FragmentTransaction transaction = getFragmentManager().beginTransaction(); - transaction.replace(android.R.id.content, new SettingsFragment()).commit(); + final Bundle args = new Bundle(); + args.putBoolean("showQuickTile", getIntent().getBooleanExtra("showQuickTile", false)); + final SettingsFragment fragment = new SettingsFragment(); + fragment.setArguments(args); + transaction.replace(android.R.id.content, fragment).commit(); } public static class SettingsFragment extends PreferenceFragment { @@ -18,6 +22,8 @@ public class SettingsActivity extends Activity { public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); + if (getArguments().getBoolean("showQuickTile")) + ((ConfigListPreference) findPreference("primary_config")).show(); } } } |