|
|
@ -53,6 +53,7 @@ import io.requery.android.database.sqlite.SQLiteDatabase;
|
|
|
|
|
|
|
|
|
|
|
|
public class FragmentOptionsMisc extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
|
|
|
public class FragmentOptionsMisc extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
|
|
|
private SwitchCompat swExternalSearch;
|
|
|
|
private SwitchCompat swExternalSearch;
|
|
|
|
|
|
|
|
private SwitchCompat swShortcuts;
|
|
|
|
private SwitchCompat swConversationActions;
|
|
|
|
private SwitchCompat swConversationActions;
|
|
|
|
private SwitchCompat swFts;
|
|
|
|
private SwitchCompat swFts;
|
|
|
|
private TextView tvFtsIndexed;
|
|
|
|
private TextView tvFtsIndexed;
|
|
|
@ -79,7 +80,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
private Group grpDebug;
|
|
|
|
private Group grpDebug;
|
|
|
|
|
|
|
|
|
|
|
|
private final static String[] RESET_OPTIONS = new String[]{
|
|
|
|
private final static String[] RESET_OPTIONS = new String[]{
|
|
|
|
"conversation_actions", "fts", "english", "watchdog", "auto_optimize", "updates", "experiments", "crash_reports", "debug"
|
|
|
|
"shortcuts", "conversation_actions", "fts", "english", "watchdog", "auto_optimize", "updates", "experiments", "crash_reports", "debug"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
private final static String[] RESET_QUESTIONS = new String[]{
|
|
|
|
private final static String[] RESET_QUESTIONS = new String[]{
|
|
|
@ -100,6 +101,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
// Get controls
|
|
|
|
// Get controls
|
|
|
|
|
|
|
|
|
|
|
|
swExternalSearch = view.findViewById(R.id.swExternalSearch);
|
|
|
|
swExternalSearch = view.findViewById(R.id.swExternalSearch);
|
|
|
|
|
|
|
|
swShortcuts = view.findViewById(R.id.swShortcuts);
|
|
|
|
swConversationActions = view.findViewById(R.id.swConversationActions);
|
|
|
|
swConversationActions = view.findViewById(R.id.swConversationActions);
|
|
|
|
swFts = view.findViewById(R.id.swFts);
|
|
|
|
swFts = view.findViewById(R.id.swFts);
|
|
|
|
tvFtsIndexed = view.findViewById(R.id.tvFtsIndexed);
|
|
|
|
tvFtsIndexed = view.findViewById(R.id.tvFtsIndexed);
|
|
|
@ -144,6 +146,14 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
swShortcuts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
|
|
|
|
prefs.edit().putBoolean("shortcuts", checked).commit(); // apply won't work here
|
|
|
|
|
|
|
|
restart();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
swConversationActions.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
swConversationActions.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
@ -389,6 +399,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
int state = pm.getComponentEnabledSetting(new ComponentName(getContext(), ActivitySearch.class));
|
|
|
|
int state = pm.getComponentEnabledSetting(new ComponentName(getContext(), ActivitySearch.class));
|
|
|
|
|
|
|
|
|
|
|
|
swExternalSearch.setChecked(state != PackageManager.COMPONENT_ENABLED_STATE_DISABLED);
|
|
|
|
swExternalSearch.setChecked(state != PackageManager.COMPONENT_ENABLED_STATE_DISABLED);
|
|
|
|
|
|
|
|
swShortcuts.setChecked(prefs.getBoolean("shortcuts", true));
|
|
|
|
swConversationActions.setChecked(prefs.getBoolean("conversation_actions", true));
|
|
|
|
swConversationActions.setChecked(prefs.getBoolean("conversation_actions", true));
|
|
|
|
swConversationActions.setVisibility(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ? View.VISIBLE : View.GONE);
|
|
|
|
swConversationActions.setVisibility(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ? View.VISIBLE : View.GONE);
|
|
|
|
swFts.setChecked(prefs.getBoolean("fts", false));
|
|
|
|
swFts.setChecked(prefs.getBoolean("fts", false));
|
|
|
|