Added push messages remark

pull/194/head
M66B 4 years ago
parent f7bee91349
commit edc36d3610

@ -66,6 +66,7 @@ public class FragmentFolder extends FragmentBase {
private CheckBox cbPoll;
private EditText etPoll;
private TextView tvPoll;
private TextView tvPollRemark;
private CheckBox cbDownload;
private CheckBox cbAutoClassifySource;
private CheckBox cbAutoClassifyTarget;
@ -129,6 +130,7 @@ public class FragmentFolder extends FragmentBase {
cbPoll = view.findViewById(R.id.cbPoll);
etPoll = view.findViewById(R.id.etPoll);
tvPoll = view.findViewById(R.id.tvPoll);
tvPollRemark = view.findViewById(R.id.tvPollRemark);
cbDownload = view.findViewById(R.id.cbDownload);
cbAutoClassifySource = view.findViewById(R.id.cbAutoClassifySource);
cbAutoClassifyTarget = view.findViewById(R.id.cbAutoClassifyTarget);
@ -166,16 +168,20 @@ public class FragmentFolder extends FragmentBase {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
cbPoll.setEnabled(isChecked);
etPoll.setEnabled(isChecked);
tvPoll.setEnabled(isChecked);
grpPoll.setVisibility(imap && isChecked && cbPoll.isChecked() ? View.VISIBLE : View.GONE);
tvPollRemark.setVisibility(imap && cbPoll.isEnabled() && !cbPoll.isChecked()
? View.VISIBLE : View.GONE);
grpPoll.setVisibility(imap && cbPoll.isEnabled() && cbPoll.isChecked()
? View.VISIBLE : View.GONE);
}
});
cbPoll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
grpPoll.setVisibility(imap && cbPoll.isEnabled() && isChecked ? View.VISIBLE : View.GONE);
tvPollRemark.setVisibility(imap && cbPoll.isEnabled() && !cbPoll.isChecked()
? View.VISIBLE : View.GONE);
grpPoll.setVisibility(imap && cbPoll.isEnabled() && cbPoll.isChecked()
? View.VISIBLE : View.GONE);
}
});
@ -321,9 +327,10 @@ public class FragmentFolder extends FragmentBase {
etName.setEnabled(folder == null || EntityFolder.USER.equals(folder.type));
cbPoll.setEnabled(cbSynchronize.isChecked());
etPoll.setEnabled(cbSynchronize.isChecked());
tvPoll.setEnabled(cbSynchronize.isChecked());
grpPoll.setVisibility(imap && cbPoll.isEnabled() && cbPoll.isChecked() ? View.VISIBLE : View.GONE);
tvPollRemark.setVisibility(imap && cbPoll.isEnabled() && !cbPoll.isChecked()
? View.VISIBLE : View.GONE);
grpPoll.setVisibility(imap && cbPoll.isEnabled() && cbPoll.isChecked()
? View.VISIBLE : View.GONE);
cbAutoClassifySource.setEnabled(cbDownload.isChecked());
cbAutoClassifyTarget.setEnabled(cbDownload.isChecked() && cbAutoClassifySource.isChecked());
cbAutoClassifySource.setVisibility(canAutoClassify ? View.VISIBLE : View.GONE);

@ -188,6 +188,18 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/etPoll" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvPollRemark"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/title_poll_folder_remark"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etPoll" />
<CheckBox
android:id="@+id/cbDownload"
android:layout_width="wrap_content"
@ -195,7 +207,7 @@
android:layout_marginTop="12dp"
android:text="@string/title_download_folder"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etPoll" />
app:layout_constraintTop_toBottomOf="@id/tvPollRemark" />
<CheckBox
android:id="@+id/cbAutoClassifySource"

@ -800,6 +800,7 @@
<string name="title_navigation_folder">Show in navigation menu</string>
<string name="title_synchronize_folder">Synchronize (receive messages)</string>
<string name="title_poll_folder">Check periodically instead of continuous synchronize</string>
<string name="title_poll_folder_remark">Most email servers allow push messages for a handful of folders only!</string>
<string name="title_download_folder">Automatically download message texts and attachments</string>
<string name="title_notify_folder">Notify on new messages</string>
<string name="title_auto_classify_source">Classify new messages in this folder</string>

Loading…
Cancel
Save