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 SettingsFragment fragment = new SettingsFragment();
|
2017-11-27 05:22:54 +01:00
|
|
|
fragment.setArguments(getIntent().getExtras());
|
2017-11-27 03:13:34 +01:00
|
|
|
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 05:22:54 +01:00
|
|
|
if (getArguments() != null && getArguments().getBoolean("showQuickTile"))
|
2017-11-27 03:13:34 +01:00
|
|
|
((ConfigListPreference) findPreference("primary_config")).show();
|
2017-08-16 11:34:14 +02:00
|
|
|
}
|
|
|
|
}
|
2017-08-09 14:34:28 +02:00
|
|
|
}
|