|
|
@ -70,6 +70,7 @@ public class FragmentFolder extends FragmentBase {
|
|
|
|
private TextView tvPoll;
|
|
|
|
private TextView tvPoll;
|
|
|
|
private CheckBox cbDownload;
|
|
|
|
private CheckBox cbDownload;
|
|
|
|
private CheckBox cbAutoClassify;
|
|
|
|
private CheckBox cbAutoClassify;
|
|
|
|
|
|
|
|
private TextView tvAutoClassifyPro;
|
|
|
|
private Button btnInfo;
|
|
|
|
private Button btnInfo;
|
|
|
|
private EditText etSyncDays;
|
|
|
|
private EditText etSyncDays;
|
|
|
|
private EditText etKeepDays;
|
|
|
|
private EditText etKeepDays;
|
|
|
@ -131,6 +132,7 @@ public class FragmentFolder extends FragmentBase {
|
|
|
|
tvPoll = view.findViewById(R.id.tvPoll);
|
|
|
|
tvPoll = view.findViewById(R.id.tvPoll);
|
|
|
|
cbDownload = view.findViewById(R.id.cbDownload);
|
|
|
|
cbDownload = view.findViewById(R.id.cbDownload);
|
|
|
|
cbAutoClassify = view.findViewById(R.id.cbAutoClassify);
|
|
|
|
cbAutoClassify = view.findViewById(R.id.cbAutoClassify);
|
|
|
|
|
|
|
|
tvAutoClassifyPro = view.findViewById(R.id.tvAutoClassifyPro);
|
|
|
|
btnInfo = view.findViewById(R.id.btnInfo);
|
|
|
|
btnInfo = view.findViewById(R.id.btnInfo);
|
|
|
|
etSyncDays = view.findViewById(R.id.etSyncDays);
|
|
|
|
etSyncDays = view.findViewById(R.id.etSyncDays);
|
|
|
|
etKeepDays = view.findViewById(R.id.etKeepDays);
|
|
|
|
etKeepDays = view.findViewById(R.id.etKeepDays);
|
|
|
@ -177,6 +179,8 @@ public class FragmentFolder extends FragmentBase {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Helper.linkPro(tvAutoClassifyPro);
|
|
|
|
|
|
|
|
|
|
|
|
btnInfo.setOnClickListener(new View.OnClickListener() {
|
|
|
|
btnInfo.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
@ -218,6 +222,7 @@ public class FragmentFolder extends FragmentBase {
|
|
|
|
tvParent.setText(parent);
|
|
|
|
tvParent.setText(parent);
|
|
|
|
grpParent.setVisibility(parent == null ? View.GONE : View.VISIBLE);
|
|
|
|
grpParent.setVisibility(parent == null ? View.GONE : View.VISIBLE);
|
|
|
|
cbAutoClassify.setVisibility(View.GONE);
|
|
|
|
cbAutoClassify.setVisibility(View.GONE);
|
|
|
|
|
|
|
|
tvAutoClassifyPro.setVisibility(View.GONE);
|
|
|
|
grpAutoDelete.setVisibility(View.GONE);
|
|
|
|
grpAutoDelete.setVisibility(View.GONE);
|
|
|
|
btnSave.setEnabled(false);
|
|
|
|
btnSave.setEnabled(false);
|
|
|
|
pbSave.setVisibility(View.GONE);
|
|
|
|
pbSave.setVisibility(View.GONE);
|
|
|
@ -300,15 +305,19 @@ public class FragmentFolder extends FragmentBase {
|
|
|
|
Helper.setViewsEnabled(view, true);
|
|
|
|
Helper.setViewsEnabled(view, true);
|
|
|
|
|
|
|
|
|
|
|
|
boolean always = (!ondemand && (pollInterval == 0 || exempted));
|
|
|
|
boolean always = (!ondemand && (pollInterval == 0 || exempted));
|
|
|
|
|
|
|
|
boolean canAutoClassify = (imap &&
|
|
|
|
|
|
|
|
MessageClassifier.isEnabled(getContext()) &&
|
|
|
|
|
|
|
|
(folder == null || MessageClassifier.canClassify(folder.type)));
|
|
|
|
|
|
|
|
boolean isJunk = (folder != null && EntityFolder.JUNK.equals(folder.type));
|
|
|
|
|
|
|
|
|
|
|
|
etName.setEnabled(folder == null || EntityFolder.USER.equals(folder.type));
|
|
|
|
etName.setEnabled(folder == null || EntityFolder.USER.equals(folder.type));
|
|
|
|
cbPoll.setEnabled(cbSynchronize.isChecked() && always);
|
|
|
|
cbPoll.setEnabled(cbSynchronize.isChecked() && always);
|
|
|
|
etPoll.setEnabled(cbSynchronize.isChecked() && always);
|
|
|
|
etPoll.setEnabled(cbSynchronize.isChecked() && always);
|
|
|
|
tvPoll.setEnabled(cbSynchronize.isChecked() && always);
|
|
|
|
tvPoll.setEnabled(cbSynchronize.isChecked() && always);
|
|
|
|
grpPoll.setVisibility(imap && cbPoll.isEnabled() && cbPoll.isChecked() ? View.VISIBLE : View.GONE);
|
|
|
|
grpPoll.setVisibility(imap && cbPoll.isEnabled() && cbPoll.isChecked() ? View.VISIBLE : View.GONE);
|
|
|
|
cbAutoClassify.setVisibility(MessageClassifier.isEnabled(getContext()) &&
|
|
|
|
cbAutoClassify.setEnabled(canAutoClassify && (isJunk || ActivityBilling.isPro(getContext())));
|
|
|
|
(folder == null || MessageClassifier.canClassify(folder.type))
|
|
|
|
cbAutoClassify.setVisibility(canAutoClassify ? View.VISIBLE : View.GONE);
|
|
|
|
? View.VISIBLE : View.GONE);
|
|
|
|
tvAutoClassifyPro.setVisibility(canAutoClassify && !cbAutoClassify.isEnabled() ? View.VISIBLE : View.GONE);
|
|
|
|
etKeepDays.setEnabled(!cbKeepAll.isChecked());
|
|
|
|
etKeepDays.setEnabled(!cbKeepAll.isChecked());
|
|
|
|
cbAutoDelete.setEnabled(!cbKeepAll.isChecked());
|
|
|
|
cbAutoDelete.setEnabled(!cbKeepAll.isChecked());
|
|
|
|
cbAutoDelete.setText(folder != null && EntityFolder.TRASH.equals(folder.type)
|
|
|
|
cbAutoDelete.setText(folder != null && EntityFolder.TRASH.equals(folder.type)
|
|
|
|