Received time/header/date

pull/184/head
M66B 4 years ago
parent 7b3c7b665c
commit 881abba392

@ -117,8 +117,7 @@ public class FragmentAccount extends FragmentBase {
private EditText etInterval;
private CheckBox cbPartialFetch;
private CheckBox cbIgnoreSize;
private CheckBox cbUseDate;
private CheckBox cbUseReceived;
private RadioGroup rgDate;
private Button btnCheck;
private ContentLoadingProgressBar pbCheck;
@ -223,8 +222,7 @@ public class FragmentAccount extends FragmentBase {
etInterval = view.findViewById(R.id.etInterval);
cbPartialFetch = view.findViewById(R.id.cbPartialFetch);
cbIgnoreSize = view.findViewById(R.id.cbIgnoreSize);
cbUseDate = view.findViewById(R.id.cbUseDate);
cbUseReceived = view.findViewById(R.id.cbUseReceived);
rgDate = view.findViewById(R.id.rgDate);
btnCheck = view.findViewById(R.id.btnCheck);
pbCheck = view.findViewById(R.id.pbCheck);
@ -833,8 +831,8 @@ public class FragmentAccount extends FragmentBase {
args.putString("interval", etInterval.getText().toString());
args.putBoolean("partial_fetch", cbPartialFetch.isChecked());
args.putBoolean("ignore_size", cbIgnoreSize.isChecked());
args.putBoolean("use_date", cbUseDate.isChecked());
args.putBoolean("use_received", cbUseReceived.isChecked());
args.putBoolean("use_date", rgDate.getCheckedRadioButtonId() == R.id.radio_date_header);
args.putBoolean("use_received", rgDate.getCheckedRadioButtonId() == R.id.radio_received_header);
args.putSerializable("drafts", drafts);
args.putSerializable("sent", sent);
@ -1484,8 +1482,13 @@ public class FragmentAccount extends FragmentBase {
etInterval.setText(account == null ? "" : Long.toString(account.poll_interval));
cbPartialFetch.setChecked(account == null ? true : account.partial_fetch);
cbIgnoreSize.setChecked(account == null ? false : account.ignore_size);
cbUseDate.setChecked(account == null ? false : account.use_date);
cbUseReceived.setChecked(account == null ? false : account.use_received);
if (account != null && account.use_date)
rgDate.check(R.id.radio_date_header);
else if (account != null && account.use_received)
rgDate.check(R.id.radio_received_header);
else
rgDate.check(R.id.radio_server_time);
auth = (account == null ? EmailService.AUTH_TYPE_PASSWORD : account.auth_type);
provider = (account == null ? null : account.provider);

@ -562,23 +562,44 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPartialFetchRemark" />
<CheckBox
android:id="@+id/cbUseDate"
android:layout_width="wrap_content"
<RadioGroup
android:id="@+id/rgDate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_use_date"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbIgnoreSize" />
app:layout_constraintTop_toBottomOf="@id/cbIgnoreSize">
<CheckBox
android:id="@+id/cbUseReceived"
<RadioButton
android:id="@+id/radio_server_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_server_time" />
<RadioButton
android:id="@+id/radio_received_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_received_header" />
<RadioButton
android:id="@+id/radio_date_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_date_header" />
</RadioGroup>
<eu.faircode.email.FixedTextView
android:id="@+id/tvDateRemark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_use_received"
android:text="@string/title_date_remark"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbUseDate" />
app:layout_constraintTop_toBottomOf="@id/rgDate" />
<!-- check -->
@ -590,7 +611,7 @@
android:tag="disable"
android:text="@string/title_check"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbUseReceived" />
app:layout_constraintTop_toBottomOf="@id/tvDateRemark" />
<eu.faircode.email.ContentLoadingProgressBar
android:id="@+id/pbCheck"
@ -965,7 +986,7 @@
cbBrowse,tvBrowseHint,
cbAutoSeen,
tvInterval,etInterval,tvIntervalRemark,
cbPartialFetch,tvPartialFetchRemark,cbIgnoreSize,cbUseDate,cbUseReceived" />
cbPartialFetch,tvPartialFetchRemark,cbIgnoreSize,rgDate,tvDateRemark" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpFolders"

@ -633,8 +633,10 @@
<string name="title_keep_alive_interval">Keep-alive/poll interval (minutes)</string>
<string name="title_partial_fetch" translatable="false">Partial fetch</string>
<string name="title_ignore_size" translatable="false">Ignore bodystructure size</string>
<string name="title_use_date">Use \'Date\' header instead of server received time</string>
<string name="title_use_received">Use \'Received\' header instead of server received time</string>
<string name="title_server_time">Use received time (server)</string>
<string name="title_received_header">Use \'Received\' header</string>
<string name="title_date_header">Use \'Date\' header (sent time)</string>
<string name="title_date_remark">Changes will be applied to new messages only</string>
<string name="title_related_identity">Add related identity</string>
<string name="title_check">Check</string>
<string name="title_trust">Trust server certificate with fingerprint %1$s</string>

Loading…
Cancel
Save