mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 22:26:06 +02:00
Link to OpenKeychain app
This commit is contained in:
@@ -75,6 +75,7 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
|
||||
private SwitchCompat swAutoUndoDecrypt;
|
||||
|
||||
private Spinner spOpenPgp;
|
||||
private ImageButton ibOpenKeychain;
|
||||
private TextView tvOpenPgpStatus;
|
||||
private SwitchCompat swAutocrypt;
|
||||
private SwitchCompat swAutocryptMutual;
|
||||
@@ -113,6 +114,7 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
|
||||
swAutoUndoDecrypt = view.findViewById(R.id.swAutoUndoDecrypt);
|
||||
|
||||
spOpenPgp = view.findViewById(R.id.spOpenPgp);
|
||||
ibOpenKeychain = view.findViewById(R.id.ibOpenKeychain);
|
||||
tvOpenPgpStatus = view.findViewById(R.id.tvOpenPgpStatus);
|
||||
swAutocrypt = view.findViewById(R.id.swAutocrypt);
|
||||
swAutocryptMutual = view.findViewById(R.id.swAutocryptMutual);
|
||||
@@ -208,6 +210,26 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
|
||||
}
|
||||
});
|
||||
|
||||
ibOpenKeychain.setVisibility(openPgpProvider.size() > 0 ? View.VISIBLE : View.INVISIBLE);
|
||||
ibOpenKeychain.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String pkg = (String) spOpenPgp.getTag();
|
||||
if (pkg == null)
|
||||
return;
|
||||
|
||||
PackageManager pm = v.getContext().getPackageManager();
|
||||
if (pm == null)
|
||||
return;
|
||||
|
||||
Intent intent = pm.getLaunchIntentForPackage(pkg);
|
||||
if (intent == null)
|
||||
return;
|
||||
|
||||
v.getContext().startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
swAutocrypt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
|
||||
Reference in New Issue
Block a user