mirror of https://github.com/M66B/FairEmail.git
Added more options to send dialog
This commit is contained in:
parent
82f207ed52
commit
faa36317db
|
@ -764,7 +764,8 @@ public class ApplicationEx extends Application
|
|||
} else if (version < 2108) {
|
||||
if (!prefs.getBoolean("updown", false))
|
||||
editor.putBoolean("updown", false);
|
||||
}
|
||||
} else if (version < 2113)
|
||||
editor.remove("send_more");
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG)
|
||||
editor.remove("background_service");
|
||||
|
|
|
@ -95,6 +95,7 @@ public class FragmentDialogSend extends FragmentDialogBase {
|
|||
final boolean send_reminders = prefs.getBoolean("send_reminders", true);
|
||||
final int send_delayed = prefs.getInt("send_delayed", 0);
|
||||
final boolean send_dialog = prefs.getBoolean("send_dialog", true);
|
||||
final boolean send_more = prefs.getBoolean("send_more", false);
|
||||
final boolean send_archive = prefs.getBoolean("send_archive", false);
|
||||
final MessageHelper.AddressFormat email_format = MessageHelper.getAddressFormat(getContext());
|
||||
|
||||
|
@ -125,6 +126,8 @@ public class FragmentDialogSend extends FragmentDialogBase {
|
|||
final TextView tvTo = dview.findViewById(R.id.tvTo);
|
||||
final TextView tvViaTitle = dview.findViewById(R.id.tvViaTitle);
|
||||
final TextView tvVia = dview.findViewById(R.id.tvVia);
|
||||
final ImageButton ibMore = dview.findViewById(R.id.ibMore);
|
||||
final TextView tvMore = dview.findViewById(R.id.tvMore);
|
||||
final CheckBox cbPlainOnly = dview.findViewById(R.id.cbPlainOnly);
|
||||
final TextView tvPlainHint = dview.findViewById(R.id.tvPlainHint);
|
||||
final CheckBox cbReceipt = dview.findViewById(R.id.cbReceipt);
|
||||
|
@ -141,7 +144,14 @@ public class FragmentDialogSend extends FragmentDialogBase {
|
|||
final CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain);
|
||||
final TextView tvNotAgain = dview.findViewById(R.id.tvNotAgain);
|
||||
final Group grpSentMissing = dview.findViewById(R.id.grpSentMissing);
|
||||
final Group grpDsn = dview.findViewById(R.id.grpDsn);
|
||||
final Group grpMore = dview.findViewById(R.id.grpMore);
|
||||
|
||||
final int[] dsnids = new int[]{
|
||||
R.id.cbPlainOnly, R.id.cbReceipt,
|
||||
R.id.tvEncrypt, R.id.spEncrypt,
|
||||
R.id.tvPriority, R.id.spPriority,
|
||||
R.id.tvSensitivity, R.id.spSensitivity
|
||||
};
|
||||
|
||||
btnFixSent.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -182,6 +192,7 @@ public class FragmentDialogSend extends FragmentDialogBase {
|
|||
|
||||
tvTo.setText(null);
|
||||
tvVia.setText(null);
|
||||
ibMore.setImageLevel(send_more ? 0 : 1);
|
||||
tvPlainHint.setVisibility(View.GONE);
|
||||
tvReceiptHint.setVisibility(View.GONE);
|
||||
spEncrypt.setTag(0);
|
||||
|
@ -192,11 +203,14 @@ public class FragmentDialogSend extends FragmentDialogBase {
|
|||
spSensitivity.setSelection(0);
|
||||
tvSendAt.setText(null);
|
||||
cbArchive.setEnabled(false);
|
||||
grpMore.setVisibility(send_more ? View.VISIBLE : View.GONE);
|
||||
cbNotAgain.setChecked(!send_dialog);
|
||||
cbNotAgain.setVisibility(send_dialog ? View.VISIBLE : View.GONE);
|
||||
tvNotAgain.setVisibility(cbNotAgain.isChecked() ? View.VISIBLE : View.GONE);
|
||||
|
||||
Helper.setViewsEnabled(dview, false);
|
||||
for (int dsnid : dsnids)
|
||||
dview.findViewById(dsnid).setEnabled(false);
|
||||
|
||||
boolean reminder = (remind_extra || remind_subject || remind_text ||
|
||||
remind_attachment || remind_extension != null || remind_internet);
|
||||
|
@ -217,18 +231,31 @@ public class FragmentDialogSend extends FragmentDialogBase {
|
|||
}
|
||||
});
|
||||
|
||||
cbNotAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
View.OnClickListener onMore = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
prefs.edit().putBoolean("send_dialog", !isChecked).apply();
|
||||
tvNotAgain.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
public void onClick(View v) {
|
||||
if (grpMore.getVisibility() == View.VISIBLE) {
|
||||
ibMore.setImageLevel(1);
|
||||
grpMore.setVisibility(View.GONE);
|
||||
} else {
|
||||
ibMore.setImageLevel(0);
|
||||
grpMore.setVisibility(View.VISIBLE);
|
||||
}
|
||||
prefs.edit().putBoolean("send_more", grpMore.getVisibility() == View.VISIBLE).apply();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ibMore.setOnClickListener(onMore);
|
||||
tvMore.setOnClickListener(onMore);
|
||||
|
||||
cbPlainOnly.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
tvPlainHint.setVisibility(checked && styled ? View.VISIBLE : View.GONE);
|
||||
if (checked && styled && grpMore.getVisibility() != View.VISIBLE) {
|
||||
ibMore.setImageLevel(0);
|
||||
grpMore.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("id", id);
|
||||
|
@ -499,6 +526,14 @@ public class FragmentDialogSend extends FragmentDialogBase {
|
|||
}
|
||||
});
|
||||
|
||||
cbNotAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
prefs.edit().putBoolean("send_dialog", !isChecked).apply();
|
||||
tvNotAgain.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
db.message().liveMessage(id).observe(getViewLifecycleOwner(), new Observer<TupleMessageEx>() {
|
||||
@Override
|
||||
|
@ -570,9 +605,9 @@ public class FragmentDialogSend extends FragmentDialogBase {
|
|||
tvSendAt.setTextColor(draft.ui_snoozed < now ? colorWarning : textColorSecondary);
|
||||
}
|
||||
|
||||
grpDsn.setVisibility(dsn ? View.GONE : View.VISIBLE);
|
||||
|
||||
Helper.setViewsEnabled(dview, true);
|
||||
for (int dsnid : dsnids)
|
||||
dview.findViewById(dsnid).setEnabled(!dsn);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -317,15 +317,40 @@
|
|||
app:layout_constraintStart_toEndOf="@+id/tvViaTitle"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvViaTitle" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibMore"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="3dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvVia"
|
||||
app:srcCompat="@drawable/expander" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMore"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="6dp"
|
||||
android:text="@string/title_search_more"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ibMore"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/ibMore"
|
||||
app:layout_constraintTop_toTopOf="@+id/ibMore" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbPlainOnly"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:tag="ignore"
|
||||
android:text="@string/title_send_plain_text"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvVia" />
|
||||
app:layout_constraintTop_toBottomOf="@id/ibMore" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPlainHint"
|
||||
|
@ -346,6 +371,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:tag="ignore"
|
||||
android:text="@string/title_send_receipt"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -379,6 +405,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:entries="@array/encryptNames"
|
||||
android:tag="ignore"
|
||||
app:layout_constraintEnd_toStartOf="@id/ibEncryption"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvEncrypt" />
|
||||
|
@ -391,6 +418,7 @@
|
|||
android:contentDescription="@string/title_info"
|
||||
android:padding="6dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:tag="ignore"
|
||||
android:tooltipText="@string/title_info"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/spEncrypt"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -415,6 +443,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:entries="@array/priorityNames"
|
||||
android:tag="ignore"
|
||||
app:layout_constraintEnd_toStartOf="@id/ibSensitivity"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvPriority" />
|
||||
|
@ -437,6 +466,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:entries="@array/sensitivityNames"
|
||||
android:tag="ignore"
|
||||
app:layout_constraintEnd_toStartOf="@id/ibSensitivity"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvSensitivity" />
|
||||
|
@ -507,7 +537,7 @@
|
|||
android:id="@+id/cbNotAgain"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/title_no_ask_again"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -524,21 +554,23 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbNotAgain" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/grpMore"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:constraint_referenced_ids="
|
||||
cbPlainOnly,cbReceipt,
|
||||
tvEncrypt,spEncrypt,ibEncryption,
|
||||
tvPriority,spPriority,
|
||||
tvSensitivity,spSensitivity,ibSensitivity,
|
||||
tvSendTitle,tvSendAt,ibSendAt,
|
||||
cbArchive" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/grpSentMissing"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:constraint_referenced_ids="
|
||||
tvSentMissing,btnFixSent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/grpDsn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:constraint_referenced_ids="
|
||||
cbPlainOnly,cbReceipt,
|
||||
tvEncrypt,spEncrypt,ibEncryption,
|
||||
tvPriority,spPriority,
|
||||
tvSensitivity,spSensitivity,ibSensitivity" />
|
||||
tvSentMissing,btnFixSent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</eu.faircode.email.ScrollViewEx>
|
Loading…
Reference in New Issue