2017-08-09 14:34:28 +02:00
|
|
|
package com.wireguard.android;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
2017-08-16 11:34:14 +02:00
|
|
|
import android.app.FragmentTransaction;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.preference.PreferenceFragment;
|
2017-08-09 14:34:28 +02:00
|
|
|
|
|
|
|
public class SettingsActivity extends Activity {
|
2017-08-16 11:34:14 +02:00
|
|
|
@Override
|
|
|
|
protected void onCreate(final Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
final FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
2017-11-27 03:13:34 +01:00
|
|
|
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();
|
2017-08-16 11:34:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static class SettingsFragment extends PreferenceFragment {
|
|
|
|
@Override
|
|
|
|
public void onCreate(final Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
addPreferencesFromResource(R.xml.preferences);
|
2017-11-27 03:13:34 +01:00
|
|
|
if (getArguments().getBoolean("showQuickTile"))
|
|
|
|
((ConfigListPreference) findPreference("primary_config")).show();
|
2017-08-16 11:34:14 +02:00
|
|
|
}
|
|
|
|
}
|
2017-08-09 14:34:28 +02:00
|
|
|
}
|