Link to OpenKeychain app

pull/199/head
M66B 4 years ago
parent 906f41769a
commit 75467f3695

@ -75,6 +75,7 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
private SwitchCompat swAutoUndoDecrypt; private SwitchCompat swAutoUndoDecrypt;
private Spinner spOpenPgp; private Spinner spOpenPgp;
private ImageButton ibOpenKeychain;
private TextView tvOpenPgpStatus; private TextView tvOpenPgpStatus;
private SwitchCompat swAutocrypt; private SwitchCompat swAutocrypt;
private SwitchCompat swAutocryptMutual; private SwitchCompat swAutocryptMutual;
@ -113,6 +114,7 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
swAutoUndoDecrypt = view.findViewById(R.id.swAutoUndoDecrypt); swAutoUndoDecrypt = view.findViewById(R.id.swAutoUndoDecrypt);
spOpenPgp = view.findViewById(R.id.spOpenPgp); spOpenPgp = view.findViewById(R.id.spOpenPgp);
ibOpenKeychain = view.findViewById(R.id.ibOpenKeychain);
tvOpenPgpStatus = view.findViewById(R.id.tvOpenPgpStatus); tvOpenPgpStatus = view.findViewById(R.id.tvOpenPgpStatus);
swAutocrypt = view.findViewById(R.id.swAutocrypt); swAutocrypt = view.findViewById(R.id.swAutocrypt);
swAutocryptMutual = view.findViewById(R.id.swAutocryptMutual); 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() { swAutocrypt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {

@ -165,12 +165,24 @@
<Spinner <Spinner
android:id="@+id/spOpenPgp" android:id="@+id/spOpenPgp"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:layout_marginEnd="6dp"
app:layout_constraintEnd_toStartOf="@id/ibOpenKeychain"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOpenPgp" /> app:layout_constraintTop_toBottomOf="@id/tvOpenPgp" />
<ImageButton
android:id="@+id/ibOpenKeychain"
android:layout_width="24dp"
android:layout_height="24dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:scaleType="fitCenter"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/spOpenPgp"
app:srcCompat="@drawable/twotone_open_in_new_24" />
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
android:id="@+id/tvOpenPgpStatus" android:id="@+id/tvOpenPgpStatus"
android:layout_width="0dp" android:layout_width="0dp"

Loading…
Cancel
Save