|
@ -94,7 +94,6 @@ public class FragmentAccount extends FragmentEx { |
|
|
private EditText etInterval; |
|
|
private EditText etInterval; |
|
|
private Button btnCheck; |
|
|
private Button btnCheck; |
|
|
private ProgressBar pbCheck; |
|
|
private ProgressBar pbCheck; |
|
|
private TextView tvIdle; |
|
|
|
|
|
private Spinner spDrafts; |
|
|
private Spinner spDrafts; |
|
|
private Spinner spSent; |
|
|
private Spinner spSent; |
|
|
private Spinner spAll; |
|
|
private Spinner spAll; |
|
@ -105,6 +104,7 @@ public class FragmentAccount extends FragmentEx { |
|
|
private ImageButton ibDelete; |
|
|
private ImageButton ibDelete; |
|
|
private ProgressBar pbWait; |
|
|
private ProgressBar pbWait; |
|
|
private Group grpInstructions; |
|
|
private Group grpInstructions; |
|
|
|
|
|
private Group grpInterval; |
|
|
private Group grpFolders; |
|
|
private Group grpFolders; |
|
|
|
|
|
|
|
|
private long id = -1; |
|
|
private long id = -1; |
|
@ -140,7 +140,6 @@ public class FragmentAccount extends FragmentEx { |
|
|
etInterval = view.findViewById(R.id.etInterval); |
|
|
etInterval = view.findViewById(R.id.etInterval); |
|
|
btnCheck = view.findViewById(R.id.btnCheck); |
|
|
btnCheck = view.findViewById(R.id.btnCheck); |
|
|
pbCheck = view.findViewById(R.id.pbCheck); |
|
|
pbCheck = view.findViewById(R.id.pbCheck); |
|
|
tvIdle = view.findViewById(R.id.tvIdle); |
|
|
|
|
|
spDrafts = view.findViewById(R.id.spDrafts); |
|
|
spDrafts = view.findViewById(R.id.spDrafts); |
|
|
spSent = view.findViewById(R.id.spSent); |
|
|
spSent = view.findViewById(R.id.spSent); |
|
|
spAll = view.findViewById(R.id.spAll); |
|
|
spAll = view.findViewById(R.id.spAll); |
|
@ -151,6 +150,7 @@ public class FragmentAccount extends FragmentEx { |
|
|
ibDelete = view.findViewById(R.id.ibDelete); |
|
|
ibDelete = view.findViewById(R.id.ibDelete); |
|
|
pbWait = view.findViewById(R.id.pbWait); |
|
|
pbWait = view.findViewById(R.id.pbWait); |
|
|
grpInstructions = view.findViewById(R.id.grpInstructions); |
|
|
grpInstructions = view.findViewById(R.id.grpInstructions); |
|
|
|
|
|
grpInterval = view.findViewById(R.id.grpInterval); |
|
|
grpFolders = view.findViewById(R.id.grpFolders); |
|
|
grpFolders = view.findViewById(R.id.grpFolders); |
|
|
|
|
|
|
|
|
// Wire controls |
|
|
// Wire controls |
|
@ -282,11 +282,12 @@ public class FragmentAccount extends FragmentEx { |
|
|
istore = (IMAPStore) isession.getStore("imaps"); |
|
|
istore = (IMAPStore) isession.getStore("imaps"); |
|
|
istore.connect(host, Integer.parseInt(port), user, password); |
|
|
istore.connect(host, Integer.parseInt(port), user, password); |
|
|
|
|
|
|
|
|
|
|
|
if (!istore.hasCapability("IDLE")) |
|
|
|
|
|
throw new MessagingException(getContext().getString(R.string.title_no_idle)); |
|
|
|
|
|
|
|
|
if (!istore.hasCapability("UIDPLUS")) |
|
|
if (!istore.hasCapability("UIDPLUS")) |
|
|
throw new MessagingException(getContext().getString(R.string.title_no_uidplus)); |
|
|
throw new MessagingException(getContext().getString(R.string.title_no_uidplus)); |
|
|
|
|
|
|
|
|
args.putBoolean("idle", istore.hasCapability("IDLE")); |
|
|
|
|
|
|
|
|
|
|
|
for (Folder ifolder : istore.getDefaultFolder().list("*")) { |
|
|
for (Folder ifolder : istore.getDefaultFolder().list("*")) { |
|
|
String type = null; |
|
|
String type = null; |
|
|
|
|
|
|
|
@ -352,8 +353,6 @@ public class FragmentAccount extends FragmentEx { |
|
|
// Refreshed token |
|
|
// Refreshed token |
|
|
tilPassword.getEditText().setText(args.getString("password")); |
|
|
tilPassword.getEditText().setText(args.getString("password")); |
|
|
|
|
|
|
|
|
tvIdle.setVisibility(args.getBoolean("idle") ? View.GONE : View.VISIBLE); |
|
|
|
|
|
|
|
|
|
|
|
final Collator collator = Collator.getInstance(Locale.getDefault()); |
|
|
final Collator collator = Collator.getInstance(Locale.getDefault()); |
|
|
collator.setStrength(Collator.SECONDARY); // Case insensitive, process accents etc |
|
|
collator.setStrength(Collator.SECONDARY); // Case insensitive, process accents etc |
|
|
|
|
|
|
|
@ -672,11 +671,12 @@ public class FragmentAccount extends FragmentEx { |
|
|
tilPassword.setPasswordVisibilityToggleEnabled(id < 0); |
|
|
tilPassword.setPasswordVisibilityToggleEnabled(id < 0); |
|
|
tvLink.setMovementMethod(LinkMovementMethod.getInstance()); |
|
|
tvLink.setMovementMethod(LinkMovementMethod.getInstance()); |
|
|
btnAuthorize.setEnabled(false); |
|
|
btnAuthorize.setEnabled(false); |
|
|
|
|
|
grpInstructions.setVisibility(View.GONE); |
|
|
|
|
|
grpInterval.setVisibility(View.GONE); |
|
|
btnCheck.setEnabled(false); |
|
|
btnCheck.setEnabled(false); |
|
|
pbCheck.setVisibility(View.GONE); |
|
|
pbCheck.setVisibility(View.GONE); |
|
|
btnSave.setVisibility(View.GONE); |
|
|
btnSave.setVisibility(View.GONE); |
|
|
pbSave.setVisibility(View.GONE); |
|
|
pbSave.setVisibility(View.GONE); |
|
|
tvIdle.setVisibility(View.GONE); |
|
|
|
|
|
grpFolders.setVisibility(View.GONE); |
|
|
grpFolders.setVisibility(View.GONE); |
|
|
ibDelete.setVisibility(View.GONE); |
|
|
ibDelete.setVisibility(View.GONE); |
|
|
|
|
|
|
|
@ -755,6 +755,8 @@ public class FragmentAccount extends FragmentEx { |
|
|
|
|
|
|
|
|
cbPrimary.setEnabled(cbSynchronize.isChecked()); |
|
|
cbPrimary.setEnabled(cbSynchronize.isChecked()); |
|
|
|
|
|
|
|
|
|
|
|
grpInterval.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE); |
|
|
|
|
|
|
|
|
btnCheck.setVisibility(cbSynchronize.isChecked() ? View.VISIBLE : View.GONE); |
|
|
btnCheck.setVisibility(cbSynchronize.isChecked() ? View.VISIBLE : View.GONE); |
|
|
btnSave.setVisibility(cbSynchronize.isChecked() ? View.GONE : View.VISIBLE); |
|
|
btnSave.setVisibility(cbSynchronize.isChecked() ? View.GONE : View.VISIBLE); |
|
|
|
|
|
|
|
|