mirror of https://github.com/M66B/FairEmail.git
Auto classify is a free feature
This commit is contained in:
parent
4d507fa2b4
commit
43438e0f21
|
@ -70,7 +70,6 @@ public class FragmentFolder extends FragmentBase {
|
|||
private TextView tvPoll;
|
||||
private CheckBox cbDownload;
|
||||
private CheckBox cbAutoClassify;
|
||||
private TextView tvAutoClassifyPro;
|
||||
private Button btnInfo;
|
||||
private EditText etSyncDays;
|
||||
private EditText etKeepDays;
|
||||
|
@ -132,7 +131,6 @@ public class FragmentFolder extends FragmentBase {
|
|||
tvPoll = view.findViewById(R.id.tvPoll);
|
||||
cbDownload = view.findViewById(R.id.cbDownload);
|
||||
cbAutoClassify = view.findViewById(R.id.cbAutoClassify);
|
||||
tvAutoClassifyPro = view.findViewById(R.id.tvAutoClassifyPro);
|
||||
btnInfo = view.findViewById(R.id.btnInfo);
|
||||
etSyncDays = view.findViewById(R.id.etSyncDays);
|
||||
etKeepDays = view.findViewById(R.id.etKeepDays);
|
||||
|
@ -179,8 +177,6 @@ public class FragmentFolder extends FragmentBase {
|
|||
}
|
||||
});
|
||||
|
||||
Helper.linkPro(tvAutoClassifyPro);
|
||||
|
||||
btnInfo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -222,7 +218,6 @@ public class FragmentFolder extends FragmentBase {
|
|||
tvParent.setText(parent);
|
||||
grpParent.setVisibility(parent == null ? View.GONE : View.VISIBLE);
|
||||
cbAutoClassify.setVisibility(View.GONE);
|
||||
tvAutoClassifyPro.setVisibility(View.GONE);
|
||||
grpAutoDelete.setVisibility(View.GONE);
|
||||
btnSave.setEnabled(false);
|
||||
pbSave.setVisibility(View.GONE);
|
||||
|
@ -308,16 +303,13 @@ public class FragmentFolder extends FragmentBase {
|
|||
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));
|
||||
cbPoll.setEnabled(cbSynchronize.isChecked() && always);
|
||||
etPoll.setEnabled(cbSynchronize.isChecked() && always);
|
||||
tvPoll.setEnabled(cbSynchronize.isChecked() && always);
|
||||
grpPoll.setVisibility(imap && cbPoll.isEnabled() && cbPoll.isChecked() ? View.VISIBLE : View.GONE);
|
||||
cbAutoClassify.setEnabled(canAutoClassify && (isJunk || ActivityBilling.isPro(getContext())));
|
||||
cbAutoClassify.setVisibility(canAutoClassify ? View.VISIBLE : View.GONE);
|
||||
tvAutoClassifyPro.setVisibility(canAutoClassify && !cbAutoClassify.isEnabled() ? View.VISIBLE : View.GONE);
|
||||
etKeepDays.setEnabled(!cbKeepAll.isChecked());
|
||||
cbAutoDelete.setEnabled(!cbKeepAll.isChecked());
|
||||
cbAutoDelete.setText(folder != null && EntityFolder.TRASH.equals(folder.type)
|
||||
|
|
|
@ -148,8 +148,7 @@ public class MessageClassifier {
|
|||
EntityFolder target = db.folder().getFolderByName(account.id, classified);
|
||||
if (target != null && target.auto_classify &&
|
||||
!target.id.equals(folder.id) &&
|
||||
!EntityFolder.JUNK.equals(folder.type) &&
|
||||
(EntityFolder.JUNK.equals(target.type) || ActivityBilling.isPro(context))) {
|
||||
!EntityFolder.JUNK.equals(folder.type)) {
|
||||
|
||||
EntityOperation.queue(context, message, EntityOperation.MOVE, target.id, false, true);
|
||||
message.ui_hide = true;
|
||||
|
|
|
@ -206,16 +206,6 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbDownload" />
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
android:id="@+id/tvAutoClassifyPro"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/title_pro_feature"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textColor="?android:attr/textColorLink"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbAutoClassify" />
|
||||
|
||||
<!-- after -->
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
|
@ -226,7 +216,7 @@
|
|||
android:text="@string/title_sync_days"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvAutoClassifyPro" />
|
||||
app:layout_constraintTop_toBottomOf="@id/cbAutoClassify" />
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
android:id="@+id/tvSyncDaysRemark"
|
||||
|
|
Loading…
Reference in New Issue