|
|
@ -82,6 +82,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
private boolean resumed = false;
|
|
|
|
private boolean resumed = false;
|
|
|
|
private List<Pair<String, String>> languages = new ArrayList<>();
|
|
|
|
private List<Pair<String, String>> languages = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private SwitchCompat swPowerMenu;
|
|
|
|
private SwitchCompat swExternalSearch;
|
|
|
|
private SwitchCompat swExternalSearch;
|
|
|
|
private SwitchCompat swShortcuts;
|
|
|
|
private SwitchCompat swShortcuts;
|
|
|
|
private SwitchCompat swFts;
|
|
|
|
private SwitchCompat swFts;
|
|
|
@ -188,6 +189,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
|
|
|
|
|
|
|
// Get controls
|
|
|
|
// Get controls
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
swPowerMenu = view.findViewById(R.id.swPowerMenu);
|
|
|
|
swExternalSearch = view.findViewById(R.id.swExternalSearch);
|
|
|
|
swExternalSearch = view.findViewById(R.id.swExternalSearch);
|
|
|
|
swShortcuts = view.findViewById(R.id.swShortcuts);
|
|
|
|
swShortcuts = view.findViewById(R.id.swShortcuts);
|
|
|
|
swFts = view.findViewById(R.id.swFts);
|
|
|
|
swFts = view.findViewById(R.id.swFts);
|
|
|
@ -246,6 +248,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
|
|
|
|
|
|
|
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
swPowerMenu.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
|
|
|
|
Helper.enableComponent(getContext(), ServicePowerControl.class, checked);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
swExternalSearch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
swExternalSearch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
@ -787,6 +796,10 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
: R.color.lightColorBackground_cards));
|
|
|
|
: R.color.lightColorBackground_cards));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
swPowerMenu.setVisibility(!BuildConfig.PLAY_STORE_RELEASE &&
|
|
|
|
|
|
|
|
Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
|
|
|
|
|
|
|
|
? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
|
|
|
|
tvFtsIndexed.setText(null);
|
|
|
|
tvFtsIndexed.setText(null);
|
|
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(getContext());
|
|
|
|
DB db = DB.getInstance(getContext());
|
|
|
@ -920,6 +933,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
private void setOptions() {
|
|
|
|
private void setOptions() {
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
swPowerMenu.setChecked(Helper.isComponentEnabled(getContext(), ServicePowerControl.class));
|
|
|
|
swExternalSearch.setChecked(Helper.isComponentEnabled(getContext(), ActivitySearch.class));
|
|
|
|
swExternalSearch.setChecked(Helper.isComponentEnabled(getContext(), ActivitySearch.class));
|
|
|
|
swShortcuts.setChecked(prefs.getBoolean("shortcuts", true));
|
|
|
|
swShortcuts.setChecked(prefs.getBoolean("shortcuts", true));
|
|
|
|
swFts.setChecked(prefs.getBoolean("fts", false));
|
|
|
|
swFts.setChecked(prefs.getBoolean("fts", false));
|
|
|
|