Encryption fixes

This commit is contained in:
M66B 2019-10-04 17:48:02 +02:00
parent 912c2281d2
commit b09e4729f6
3 changed files with 10 additions and 6 deletions

View File

@ -928,7 +928,7 @@ public class FragmentCompose extends FragmentBase {
menu.findItem(R.id.menu_answer).setEnabled(!busy); menu.findItem(R.id.menu_answer).setEnabled(!busy);
menu.findItem(R.id.menu_send).setEnabled(!busy); menu.findItem(R.id.menu_send).setEnabled(!busy);
menu.findItem(R.id.menu_encrypt).setIcon(encrypt ? R.drawable.baseline_no_encryption_24 : R.drawable.baseline_lock_24); menu.findItem(R.id.menu_encrypt).setIcon(encrypt ? R.drawable.baseline_lock_open_24 : R.drawable.baseline_lock_24);
menu.findItem(R.id.menu_media).setChecked(media); menu.findItem(R.id.menu_media).setChecked(media);
menu.findItem(R.id.menu_compact).setChecked(compact); menu.findItem(R.id.menu_compact).setChecked(compact);
@ -3000,8 +3000,12 @@ public class FragmentCompose extends FragmentBase {
fragment.setArguments(args); fragment.setArguments(args);
fragment.setTargetFragment(FragmentCompose.this, REQUEST_SEND); fragment.setTargetFragment(FragmentCompose.this, REQUEST_SEND);
fragment.show(getFragmentManager(), "compose:send"); fragment.show(getFragmentManager(), "compose:send");
} else } else {
onAction(R.id.action_send); if (encrypt)
onEncrypt();
else
onAction(R.id.action_send);
}
} else if (action == R.id.action_send) { } else if (action == R.id.action_send) {
autosave = false; autosave = false;
@ -3506,6 +3510,7 @@ public class FragmentCompose extends FragmentBase {
cbNotAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { cbNotAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
prefs.edit().putBoolean("send_dialog", !isChecked).apply();
tvNotAgain.setVisibility(isChecked && send_dialog ? View.VISIBLE : View.GONE); tvNotAgain.setVisibility(isChecked && send_dialog ? View.VISIBLE : View.GONE);
} }
}); });
@ -3699,7 +3704,6 @@ public class FragmentCompose extends FragmentBase {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
getArguments().putBoolean("encrypt", cbEncrypt.isChecked()); getArguments().putBoolean("encrypt", cbEncrypt.isChecked());
prefs.edit().putBoolean("send_dialog", !cbNotAgain.isChecked()).apply();
sendResult(Activity.RESULT_OK); sendResult(Activity.RESULT_OK);
} }
}) })

View File

@ -6,5 +6,5 @@
android:tint="?attr/colorControlNormal"> android:tint="?attr/colorControlNormal">
<path <path
android:fillColor="@android:color/white" android:fillColor="@android:color/white"
android:pathData="M21,21.78L4.22,5 3,6.22l2.04,2.04C4.42,8.6 4,9.25 4,10v10c0,1.1 0.9,2 2,2h12c0.23,0 0.45,-0.05 0.66,-0.12L19.78,23 21,21.78zM8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1s3.1,1.39 3.1,3.1v2H9.66L20,18.34V10c0,-1.1 -0.9,-2 -2,-2h-1V6c0,-2.76 -2.24,-5 -5,-5 -2.56,0 -4.64,1.93 -4.94,4.4L8.9,7.24V6z"/> android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6h1.9c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM18,20L6,20L6,10h12v10z"/>
</vector> </vector>

View File

@ -30,7 +30,7 @@
android:tooltipText="@string/title_decrypt" android:tooltipText="@string/title_decrypt"
app:layout_constraintEnd_toStartOf="@+id/ibUnsubscribe" app:layout_constraintEnd_toStartOf="@+id/ibUnsubscribe"
app:layout_constraintTop_toBottomOf="@id/bnvActions" app:layout_constraintTop_toBottomOf="@id/bnvActions"
app:srcCompat="@drawable/baseline_no_encryption_24" /> app:srcCompat="@drawable/baseline_lock_open_24" />
<ImageButton <ImageButton
android:id="@+id/ibUnsubscribe" android:id="@+id/ibUnsubscribe"