Disable confirm images/html inline

pull/194/merge
M66B 3 years ago
parent 52851a8e52
commit 741d04948b

@ -4190,11 +4190,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
View dview = LayoutInflater.from(context).inflate(
full ? R.layout.dialog_show_full : R.layout.dialog_show_images, null);
CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain);
CheckBox cbNotAgainSender = dview.findViewById(R.id.cbNotAgainSender);
CheckBox cbNotAgainDomain = dview.findViewById(R.id.cbNotAgainDomain);
CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain);
if (message.from == null || message.from.length == 0) {
cbNotAgain.setVisibility(View.GONE);
cbNotAgainSender.setVisibility(View.GONE);
cbNotAgainDomain.setVisibility(View.GONE);
} else {
List<String> froms = new ArrayList<>();
@ -4206,20 +4207,28 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
String domain = (at < 0 ? from : from.substring(at));
domains.add(domain);
}
cbNotAgain.setText(context.getString(R.string.title_no_ask_for_again,
cbNotAgainSender.setText(context.getString(R.string.title_no_ask_for_again,
TextUtils.join(", ", froms)));
cbNotAgainDomain.setText(context.getString(R.string.title_no_ask_for_again,
TextUtils.join(", ", domains)));
}
cbNotAgainDomain.setEnabled(false);
cbNotAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
cbNotAgainSender.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
cbNotAgainDomain.setEnabled(isChecked);
}
});
cbNotAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
cbNotAgainSender.setEnabled(!isChecked);
cbNotAgainDomain.setEnabled(!isChecked && cbNotAgainSender.isChecked());
}
});
if (full) {
TextView tvDark = dview.findViewById(R.id.tvDark);
CheckBox cbAlwaysImages = dview.findViewById(R.id.cbAlwaysImages);
@ -4270,10 +4279,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
int at = from.indexOf('@');
String domain = (at < 0 ? from : from.substring(at));
editor.putBoolean(from + (full ? ".show_full" : ".show_images"),
cbNotAgain.isChecked());
cbNotAgainSender.isChecked());
editor.putBoolean(domain + (full ? ".show_full" : ".show_images"),
cbNotAgain.isChecked() && cbNotAgainDomain.isChecked());
cbNotAgainSender.isChecked() && cbNotAgainDomain.isChecked());
}
editor.putBoolean(full ? "ask_html" : "ask_images", !cbNotAgain.isChecked());
editor.apply();
onShowConfirmed(message, full, true);

@ -187,6 +187,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"first", "app_support", "notify_archive", "message_swipe", "message_select", "folder_actions", "folder_sync",
"crash_reports_asked", "review_asked", "review_later", "why",
"reply_hint", "html_always_images", "open_full_confirmed",
"ask_images", "ask_html",
"print_html_confirmed", "print_html_header", "print_html_images",
"reformatted_hint",
"selected_folders", "move_1_confirmed", "move_n_confirmed",

@ -43,7 +43,7 @@
app:layout_constraintTop_toBottomOf="@id/tvDark" />
<CheckBox
android:id="@+id/cbNotAgain"
android:id="@+id/cbNotAgainSender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
@ -61,6 +61,16 @@
android:text="@string/title_no_ask_for_again"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbNotAgain" />
app:layout_constraintTop_toBottomOf="@id/cbNotAgainSender" />
<CheckBox
android:id="@+id/cbNotAgain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_no_ask_again"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbNotAgainDomain" />
</androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>

@ -56,7 +56,7 @@
app:srcCompat="@drawable/twotone_info_24" />
<CheckBox
android:id="@+id/cbNotAgain"
android:id="@+id/cbNotAgainSender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
@ -74,7 +74,17 @@
android:text="@string/title_no_ask_for_again"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbNotAgain" />
app:layout_constraintTop_toBottomOf="@id/cbNotAgainSender" />
<CheckBox
android:id="@+id/cbNotAgain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_no_ask_again"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbNotAgainDomain" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpTracking"

Loading…
Cancel
Save