Allow disabling identities hint

pull/194/head
M66B 4 years ago
parent f846e9c257
commit 6f5be8dd78

@ -60,6 +60,9 @@ public class FragmentDialogIdentity extends FragmentDialogBase {
final Group grpNoIdentities = dview.findViewById(R.id.grpNoIdentities); final Group grpNoIdentities = dview.findViewById(R.id.grpNoIdentities);
final ContentLoadingProgressBar pbWait = dview.findViewById(R.id.pbWait); final ContentLoadingProgressBar pbWait = dview.findViewById(R.id.pbWait);
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean identities_primary_hint = prefs.getBoolean("identities_primary_hint", false);
spIdentity.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { spIdentity.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override @Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
@ -81,18 +84,20 @@ public class FragmentDialogIdentity extends FragmentDialogBase {
} }
}); });
tvPrimaryHint.setVisibility(identities_primary_hint ? View.GONE : View.VISIBLE);
tvPrimaryHint.setOnClickListener(new View.OnClickListener() { tvPrimaryHint.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
startActivity(new Intent(getContext(), ActivitySetup.class) prefs.edit().putBoolean("identities_primary_hint", true).apply();
startActivity(new Intent(v.getContext(), ActivitySetup.class)
.putExtra("manual", true)); .putExtra("manual", true));
tvPrimaryHint.setVisibility(View.GONE);
} }
}); });
cbNotAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { cbNotAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
prefs.edit().putBoolean("identities_asked", isChecked).apply(); prefs.edit().putBoolean("identities_asked", isChecked).apply();
} }
}); });

@ -143,7 +143,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"reply_hint", "html_always_images", "open_full_confirmed", "print_html_confirmed", "reformatted_hint", "reply_hint", "html_always_images", "open_full_confirmed", "print_html_confirmed", "reformatted_hint",
"selected_folders", "move_1_confirmed", "move_n_confirmed", "selected_folders", "move_1_confirmed", "move_n_confirmed",
"last_search_senders", "last_search_recipients", "last_search_subject", "last_search_keywords", "last_search_message", "last_search", "last_search_senders", "last_search_recipients", "last_search_subject", "last_search_keywords", "last_search_message", "last_search",
"identities_asked", "cc_bcc", "inline_image_hint", "compose_reference", "send_dialog", "identities_asked", "identities_primary_hint",
"cc_bcc", "inline_image_hint", "compose_reference", "send_dialog",
"setup_reminder", "setup_advanced" "setup_reminder", "setup_advanced"
}; };

Loading…
Cancel
Save