Reorganized display and privacy settings

pull/175/head
M66B 5 years ago
parent 54a8517635
commit 256825bd89

@ -116,7 +116,7 @@ public class FragmentOptions extends FragmentBase {
@Override
public int getCount() {
return 9;
return 10;
}
@Override
@ -137,8 +137,10 @@ public class FragmentOptions extends FragmentBase {
case 6:
return new FragmentOptionsPrivacy();
case 7:
return new FragmentOptionsNotifications();
return new FragmentOptionsEncryption();
case 8:
return new FragmentOptionsNotifications();
case 9:
return new FragmentOptionsMisc();
default:
throw new IllegalArgumentException();
@ -163,8 +165,10 @@ public class FragmentOptions extends FragmentBase {
case 6:
return getString(R.string.title_advanced_section_privacy);
case 7:
return getString(R.string.title_advanced_section_notifications);
return getString(R.string.title_advanced_section_encryption);
case 8:
return getString(R.string.title_advanced_section_notifications);
case 9:
return getString(R.string.title_advanced_section_misc);
default:
throw new IllegalArgumentException();

@ -56,13 +56,17 @@ import androidx.preference.PreferenceManager;
public class FragmentOptionsDisplay extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
private Button btnTheme;
private SwitchCompat swLandscape;
private SwitchCompat swLandscape3;
private Spinner spStartup;
private SwitchCompat swCards;
private SwitchCompat swDate;
private SwitchCompat swNavBarColorize;
private SwitchCompat swLandscape;
private SwitchCompat swLandscape3;
private SwitchCompat swThreading;
private SwitchCompat swIndentation;
private SwitchCompat swActionbar;
private SwitchCompat swHighlightUnread;
private SwitchCompat swColorStripe;
private SwitchCompat swAvatars;
@ -102,17 +106,17 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swCollapseQuotes;
private SwitchCompat swImagesInline;
private SwitchCompat swSeekbar;
private SwitchCompat swActionbar;
private SwitchCompat swNavBarColorize;
private final static String[] RESET_OPTIONS = new String[]{
"theme", "landscape", "landscape3", "startup", "cards", "indentation", "date", "threading", "highlight_unread", "color_stripe",
"theme", "startup", "cards", "date", "navbar_colorize", "landscape", "landscape3",
"threading", "indentation", "actionbar",
"highlight_unread", "color_stripe",
"avatars", "gravatars", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
"name_email", "prefer_contact", "distinguish_contacts", "authentication",
"subject_top", "font_size_sender", "font_size_subject", "subject_italic", "subject_ellipsize", "keywords_header",
"flags", "flags_background", "preview", "preview_italic", "preview_lines", "addresses", "attachments_alt",
"contrast", "monospaced", "text_color", "text_size",
"inline_images", "collapse_quotes", "seekbar", "actionbar", "navbar_colorize"
"inline_images", "collapse_quotes", "seekbar"
};
@Override
@ -126,13 +130,17 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
// Get controls
btnTheme = view.findViewById(R.id.btnTheme);
swLandscape = view.findViewById(R.id.swLandscape);
swLandscape3 = view.findViewById(R.id.swLandscape3);
spStartup = view.findViewById(R.id.spStartup);
swCards = view.findViewById(R.id.swCards);
swIndentation = view.findViewById(R.id.swIndentation);
swDate = view.findViewById(R.id.swDate);
swNavBarColorize = view.findViewById(R.id.swNavBarColorize);
swLandscape = view.findViewById(R.id.swLandscape);
swLandscape3 = view.findViewById(R.id.swLandscape3);
swThreading = view.findViewById(R.id.swThreading);
swIndentation = view.findViewById(R.id.swIndentation);
swActionbar = view.findViewById(R.id.swActionbar);
swHighlightUnread = view.findViewById(R.id.swHighlightUnread);
swColorStripe = view.findViewById(R.id.swColorStripe);
swAvatars = view.findViewById(R.id.swAvatars);
@ -171,8 +179,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swCollapseQuotes = view.findViewById(R.id.swCollapseQuotes);
swImagesInline = view.findViewById(R.id.swImagesInline);
swSeekbar = view.findViewById(R.id.swSeekbar);
swActionbar = view.findViewById(R.id.swActionbar);
swNavBarColorize = view.findViewById(R.id.swNavBarColorize);
setOptions();
@ -187,21 +193,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swLandscape.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("landscape", checked).apply();
swLandscape3.setEnabled(checked);
}
});
swLandscape3.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("landscape3", checked).apply();
}
});
spStartup.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
@ -223,17 +214,34 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swIndentation.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
swDate.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("indentation", checked).apply();
prefs.edit().putBoolean("date", checked).apply();
}
});
swDate.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
swNavBarColorize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("date", checked).apply();
prefs.edit().putBoolean("navbar_colorize", checked).apply();
setNavigationBarColor(
checked ? Helper.resolveColor(getContext(), R.attr.colorPrimaryDark) : Color.BLACK);
}
});
swLandscape.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("landscape", checked).apply();
swLandscape3.setEnabled(checked);
}
});
swLandscape3.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("landscape3", checked).apply();
}
});
@ -245,6 +253,20 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swIndentation.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("indentation", checked).apply();
}
});
swActionbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("actionbar", checked).apply();
}
});
swHighlightUnread.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -564,22 +586,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swActionbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("actionbar", checked).apply();
}
});
swNavBarColorize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("navbar_colorize", checked).apply();
setNavigationBarColor(
checked ? Helper.resolveColor(getContext(), R.attr.colorPrimaryDark) : Color.BLACK);
}
});
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
return view;
@ -632,11 +638,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
boolean normal = getResources().getConfiguration()
.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_NORMAL);
swLandscape.setChecked(prefs.getBoolean("landscape", true));
swLandscape.setEnabled(normal);
swLandscape3.setChecked(prefs.getBoolean("landscape3", false));
swLandscape3.setEnabled(normal && swLandscape.isChecked());
String startup = prefs.getString("startup", "unified");
String[] startupValues = getResources().getStringArray(R.array.startupValues);
for (int pos = 0; pos < startupValues.length; pos++)
@ -646,10 +647,18 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
swCards.setChecked(prefs.getBoolean("cards", true));
swIndentation.setChecked(prefs.getBoolean("indentation", false));
swIndentation.setEnabled(swCards.isChecked());
swDate.setChecked(prefs.getBoolean("date", true));
swNavBarColorize.setChecked(prefs.getBoolean("navbar_colorize", false));
swLandscape.setChecked(prefs.getBoolean("landscape", true));
swLandscape.setEnabled(normal);
swLandscape3.setChecked(prefs.getBoolean("landscape3", false));
swLandscape3.setEnabled(normal && swLandscape.isChecked());
swThreading.setChecked(prefs.getBoolean("threading", true));
swIndentation.setChecked(prefs.getBoolean("indentation", false));
swIndentation.setEnabled(swCards.isChecked());
swActionbar.setChecked(prefs.getBoolean("actionbar", true));
swHighlightUnread.setChecked(prefs.getBoolean("highlight_unread", false));
swColorStripe.setChecked(prefs.getBoolean("color_stripe", true));
swAvatars.setChecked(prefs.getBoolean("avatars", true));
@ -716,8 +725,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false));
swImagesInline.setChecked(prefs.getBoolean("inline_images", false));
swSeekbar.setChecked(prefs.getBoolean("seekbar", false));
swActionbar.setChecked(prefs.getBoolean("actionbar", true));
swNavBarColorize.setChecked(prefs.getBoolean("navbar_colorize", false));
updateColor();
}

@ -0,0 +1,287 @@
package eu.faircode.email;
/*
This file is part of FairEmail.
FairEmail is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FairEmail is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FairEmail. If not, see <http://www.gnu.org/licenses/>.
Copyright 2018-2020 by Marcel Bokhorst (M66B)
*/
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.provider.Settings;
import android.security.KeyChain;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat;
import androidx.lifecycle.Lifecycle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
import org.openintents.openpgp.util.OpenPgpApi;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
public class FragmentOptionsEncryption extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
private Spinner spEncryptMethod;
private SwitchCompat swSign;
private SwitchCompat swEncrypt;
private SwitchCompat swAutoDecrypt;
private Spinner spOpenPgp;
private SwitchCompat swAutocrypt;
private SwitchCompat swAutocryptMutual;
private Button btnManageCertificates;
private Button btnImportKey;
private Button btnManageKeys;
private TextView tvKeySize;
private List<String> openPgpProvider = new ArrayList<>();
private final static String[] RESET_OPTIONS = new String[]{
"default_encrypt_method", "sign_default", "encrypt_default", "auto_decrypt",
"openpgp_provider", "autocrypt", "autocrypt_mutual"
};
@Override
@Nullable
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
setSubtitle(R.string.title_setup);
setHasOptionsMenu(true);
PackageManager pm = getContext().getPackageManager();
View view = inflater.inflate(R.layout.fragment_options_encryption, container, false);
// Get controls
spEncryptMethod = view.findViewById(R.id.spEncryptMethod);
swSign = view.findViewById(R.id.swSign);
swEncrypt = view.findViewById(R.id.swEncrypt);
swAutoDecrypt = view.findViewById(R.id.swAutoDecrypt);
spOpenPgp = view.findViewById(R.id.spOpenPgp);
swAutocrypt = view.findViewById(R.id.swAutocrypt);
swAutocryptMutual = view.findViewById(R.id.swAutocryptMutual);
btnManageCertificates = view.findViewById(R.id.btnManageCertificates);
btnImportKey = view.findViewById(R.id.btnImportKey);
btnManageKeys = view.findViewById(R.id.btnManageKeys);
tvKeySize = view.findViewById(R.id.tvKeySize);
Intent intent = new Intent(OpenPgpApi.SERVICE_INTENT_2);
List<ResolveInfo> ris = pm.queryIntentServices(intent, 0);
for (ResolveInfo ri : ris)
if (ri.serviceInfo != null)
openPgpProvider.add(ri.serviceInfo.packageName);
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, android.R.id.text1);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
adapter.addAll(openPgpProvider);
spOpenPgp.setAdapter(adapter);
setOptions();
// Wire controls
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
spEncryptMethod.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (position == 1)
prefs.edit().putString("default_encrypt_method", "s/mime").apply();
else
onNothingSelected(parent);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
prefs.edit().remove("default_encrypt_method").apply();
}
});
swSign.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("sign_default", checked).apply();
}
});
swEncrypt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("encrypt_default", checked).apply();
swSign.setEnabled(!checked);
}
});
swAutoDecrypt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("auto_decrypt", checked).apply();
}
});
// PGP
spOpenPgp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
prefs.edit().putString("openpgp_provider", openPgpProvider.get(position)).apply();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
prefs.edit().remove("openpgp_provider").apply();
}
});
swAutocrypt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("autocrypt", checked).apply();
swAutocryptMutual.setEnabled(checked);
}
});
swAutocryptMutual.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("autocrypt_mutual", checked).apply();
}
});
// S/MIME
btnManageCertificates.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(getContext());
lbm.sendBroadcast(new Intent(ActivitySetup.ACTION_MANAGE_CERTIFICATES));
}
});
final Intent importKey = KeyChain.createInstallIntent();
btnImportKey.setEnabled(importKey.resolveActivity(pm) != null);
btnImportKey.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(importKey);
}
});
final Intent security = new Intent(Settings.ACTION_SECURITY_SETTINGS);
btnImportKey.setEnabled(security.resolveActivity(pm) != null);
btnManageKeys.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(security);
}
});
try {
int maxKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength("AES");
tvKeySize.setText(getString(R.string.title_advanced_aes_key_size, maxKeySize));
} catch (NoSuchAlgorithmException ex) {
tvKeySize.setText(Log.formatThrowable(ex));
}
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
return view;
}
@Override
public void onDestroyView() {
PreferenceManager.getDefaultSharedPreferences(getContext()).unregisterOnSharedPreferenceChangeListener(this);
super.onDestroyView();
}
@Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
setOptions();
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.menu_options, menu);
super.onCreateOptionsMenu(menu, inflater);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_default:
onMenuDefault();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void onMenuDefault() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
SharedPreferences.Editor editor = prefs.edit();
for (String option : RESET_OPTIONS)
editor.remove(option);
editor.apply();
ToastEx.makeText(getContext(), R.string.title_setup_done, Toast.LENGTH_LONG).show();
}
private void setOptions() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
String encrypt_method = prefs.getString("default_encrypt_method", "pgp");
if ("s/mime".equals(encrypt_method))
spEncryptMethod.setSelection(1);
swSign.setChecked(prefs.getBoolean("sign_default", false));
swEncrypt.setChecked(prefs.getBoolean("encrypt_default", false));
swSign.setEnabled(!swEncrypt.isChecked());
swAutoDecrypt.setChecked(prefs.getBoolean("auto_decrypt", false));
String provider = prefs.getString("openpgp_provider", "org.sufficientlysecure.keychain");
for (int pos = 0; pos < openPgpProvider.size(); pos++)
if (provider.equals(openPgpProvider.get(pos))) {
spOpenPgp.setSelection(pos);
break;
}
swAutocrypt.setChecked(prefs.getBoolean("autocrypt", true));
swAutocryptMutual.setChecked(prefs.getBoolean("autocrypt_mutual", true));
swAutocryptMutual.setEnabled(swAutocrypt.isChecked());
}
}

@ -24,11 +24,8 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings;
import android.security.KeyChain;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@ -40,7 +37,6 @@ import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
@ -53,45 +49,22 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat;
import androidx.lifecycle.Lifecycle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
import org.openintents.openpgp.util.OpenPgpApi;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
public class FragmentOptionsPrivacy extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
private SwitchCompat swConfirmLinks;
private SwitchCompat swConfirmImages;
private SwitchCompat swConfirmHtml;
private SwitchCompat swDisableTracking;
private SwitchCompat swDisplayHidden;
private Spinner spEncryptMethod;
private Spinner spOpenPgp;
private SwitchCompat swAutocrypt;
private SwitchCompat swAutocryptMutual;
private SwitchCompat swSign;
private SwitchCompat swEncrypt;
private SwitchCompat swAutoDecrypt;
private SwitchCompat swSecure;
private Button btnBiometrics;
private Button btnPin;
private Spinner spBiometricsTimeout;
private Button btnManageCertificates;
private Button btnImportKey;
private Button btnManageKeys;
private TextView tvKeySize;
private List<String> openPgpProvider = new ArrayList<>();
private final static String[] RESET_OPTIONS = new String[]{
"confirm_links", "confirm_images", "confirm_html",
"disable_tracking", "display_hidden",
"default_encrypt_method", "openpgp_provider", "autocrypt", "autocrypt_mutual",
"sign_default", "encrypt_default", "auto_decrypt",
"secure",
"disable_tracking", "display_hidden", "secure",
"biometrics", "pin", "biometrics_timeout"
};
@ -111,32 +84,10 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
swConfirmHtml = view.findViewById(R.id.swConfirmHtml);
swDisableTracking = view.findViewById(R.id.swDisableTracking);
swDisplayHidden = view.findViewById(R.id.swDisplayHidden);
spEncryptMethod = view.findViewById(R.id.spEncryptMethod);
spOpenPgp = view.findViewById(R.id.spOpenPgp);
swAutocrypt = view.findViewById(R.id.swAutocrypt);
swAutocryptMutual = view.findViewById(R.id.swAutocryptMutual);
swSign = view.findViewById(R.id.swSign);
swEncrypt = view.findViewById(R.id.swEncrypt);
swAutoDecrypt = view.findViewById(R.id.swAutoDecrypt);
swSecure = view.findViewById(R.id.swSecure);
btnBiometrics = view.findViewById(R.id.btnBiometrics);
btnPin = view.findViewById(R.id.btnPin);
spBiometricsTimeout = view.findViewById(R.id.spBiometricsTimeout);
btnManageCertificates = view.findViewById(R.id.btnManageCertificates);
btnImportKey = view.findViewById(R.id.btnImportKey);
btnManageKeys = view.findViewById(R.id.btnManageKeys);
tvKeySize = view.findViewById(R.id.tvKeySize);
Intent intent = new Intent(OpenPgpApi.SERVICE_INTENT_2);
List<ResolveInfo> ris = pm.queryIntentServices(intent, 0);
for (ResolveInfo ri : ris)
if (ri.serviceInfo != null)
openPgpProvider.add(ri.serviceInfo.packageName);
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, android.R.id.text1);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
adapter.addAll(openPgpProvider);
spOpenPgp.setAdapter(adapter);
setOptions();
@ -179,70 +130,6 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
}
});
spEncryptMethod.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (position == 1)
prefs.edit().putString("default_encrypt_method", "s/mime").apply();
else
onNothingSelected(parent);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
prefs.edit().remove("default_encrypt_method").apply();
}
});
spOpenPgp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
prefs.edit().putString("openpgp_provider", openPgpProvider.get(position)).apply();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
prefs.edit().remove("openpgp_provider").apply();
}
});
swAutocrypt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("autocrypt", checked).apply();
swAutocryptMutual.setEnabled(checked);
}
});
swAutocryptMutual.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("autocrypt_mutual", checked).apply();
}
});
swSign.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("sign_default", checked).apply();
}
});
swEncrypt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("encrypt_default", checked).apply();
swSign.setEnabled(!checked);
}
});
swAutoDecrypt.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("auto_decrypt", checked).apply();
}
});
swSecure.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -302,39 +189,6 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
}
});
btnManageCertificates.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(getContext());
lbm.sendBroadcast(new Intent(ActivitySetup.ACTION_MANAGE_CERTIFICATES));
}
});
final Intent importKey = KeyChain.createInstallIntent();
btnImportKey.setEnabled(importKey.resolveActivity(pm) != null);
btnImportKey.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(importKey);
}
});
final Intent security = new Intent(Settings.ACTION_SECURITY_SETTINGS);
btnImportKey.setEnabled(security.resolveActivity(pm) != null);
btnManageKeys.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(security);
}
});
try {
int maxKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength("AES");
tvKeySize.setText(getString(R.string.title_advanced_aes_key_size, maxKeySize));
} catch (NoSuchAlgorithmException ex) {
tvKeySize.setText(Log.formatThrowable(ex));
}
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
return view;
@ -386,25 +240,6 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
swConfirmHtml.setChecked(prefs.getBoolean("confirm_html", true));
swDisableTracking.setChecked(prefs.getBoolean("disable_tracking", true));
swDisplayHidden.setChecked(prefs.getBoolean("display_hidden", false));
String encrypt_method = prefs.getString("default_encrypt_method", "pgp");
if ("s/mime".equals(encrypt_method))
spEncryptMethod.setSelection(1);
String provider = prefs.getString("openpgp_provider", "org.sufficientlysecure.keychain");
for (int pos = 0; pos < openPgpProvider.size(); pos++)
if (provider.equals(openPgpProvider.get(pos))) {
spOpenPgp.setSelection(pos);
break;
}
swAutocrypt.setChecked(prefs.getBoolean("autocrypt", true));
swAutocryptMutual.setChecked(prefs.getBoolean("autocrypt_mutual", true));
swAutocryptMutual.setEnabled(swAutocrypt.isChecked());
swSign.setChecked(prefs.getBoolean("sign_default", false));
swEncrypt.setChecked(prefs.getBoolean("encrypt_default", false));
swSign.setEnabled(!swEncrypt.isChecked());
swAutoDecrypt.setChecked(prefs.getBoolean("auto_decrypt", false));
swSecure.setChecked(prefs.getBoolean("secure", false));
boolean biometrics = prefs.getBoolean("biometrics", false);

@ -28,6 +28,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvCaptionGeneral"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/title_advanced_caption_general"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvLayoutHint" />
<Button
android:id="@+id/btnTheme"
style="?android:attr/buttonStyleSmall"
@ -38,30 +49,7 @@
android:minHeight="0dp"
android:text="@string/title_setup_theme"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvLayoutHint" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swLandscape"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_landscape"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnTheme"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swLandscape3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_landscape3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swLandscape"
app:switchPadding="12dp" />
app:layout_constraintTop_toBottomOf="@id/tvCaptionGeneral" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvStartup"
@ -74,7 +62,7 @@
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swLandscape3" />
app:layout_constraintTop_toBottomOf="@id/btnTheme" />
<Spinner
android:id="@+id/spStartup"
@ -98,40 +86,75 @@
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swIndentation"
android:id="@+id/swDate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_indentation"
android:text="@string/title_advanced_date_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swCards"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvDateHint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_date_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swDate" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swNavBarColorize"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_navbar_colorize"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDateHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swDate"
android:id="@+id/swLandscape"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_date_header"
android:text="@string/title_advanced_landscape"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swIndentation"
app:layout_constraintTop_toBottomOf="@id/swNavBarColorize"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swLandscape3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_landscape3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swLandscape"
app:switchPadding="12dp" />
<!-- conversation -->
<eu.faircode.email.FixedTextView
android:id="@+id/tvDateHint"
android:id="@+id/tvCaptionConversation"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_date_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
android:layout_marginTop="24dp"
android:text="@string/title_advanced_caption_conversation"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swDate" />
app:layout_constraintTop_toBottomOf="@+id/swLandscape3" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swThreading"
@ -142,7 +165,7 @@
android:text="@string/title_advanced_threading"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDateHint"
app:layout_constraintTop_toBottomOf="@id/tvCaptionConversation"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
@ -157,6 +180,43 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swThreading" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swIndentation"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_indentation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvThreadingHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swActionbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_actionbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swIndentation"
app:switchPadding="12dp" />
<!-- message -->
<eu.faircode.email.FixedTextView
android:id="@+id/tvCaptionMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/title_advanced_caption_message"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/swActionbar" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swHighlightUnread"
android:layout_width="0dp"
@ -166,7 +226,7 @@
android:text="@string/title_advanced_highlight_unread"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvThreadingHint"
app:layout_constraintTop_toBottomOf="@id/tvCaptionMessage"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
@ -726,28 +786,5 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvImagesInlineHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swActionbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_actionbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swSeekbar"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swNavBarColorize"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_navbar_colorize"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swActionbar"
app:switchPadding="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

@ -0,0 +1,195 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="6dp"
android:paddingTop="12dp"
android:paddingEnd="6dp"
android:paddingBottom="0dp"
android:scrollbarStyle="outsideOverlay"
tools:context="eu.faircode.email.ActivitySetup">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="24dp">
<eu.faircode.email.FixedTextView
android:id="@+id/tvEncryptMethod"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_encrypt_method"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spinner
android:id="@+id/spEncryptMethod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:entries="@array/encryptMethod"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvEncryptMethod" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSign"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_sign_default"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spEncryptMethod"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swEncrypt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_encrypt_default"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swSign"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAutoDecrypt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_auto_decrypt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swEncrypt"
app:switchPadding="12dp" />
<!-- PGP -->
<eu.faircode.email.FixedTextView
android:id="@+id/tvCaptionPgp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_caption_pgp"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutoDecrypt" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvOpenPgp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_openpgp"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaptionPgp" />
<Spinner
android:id="@+id/spOpenPgp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOpenPgp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAutocrypt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_autocrypt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spOpenPgp"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAutocryptMutual"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_autocrypt_mutual"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutocrypt"
app:switchPadding="12dp" />
<!-- S/MIME -->
<eu.faircode.email.FixedTextView
android:id="@+id/tvCaptionSmime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_caption_smime"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutocryptMutual" />
<Button
android:id="@+id/btnManageCertificates"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/title_advanced_manage_certificates"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaptionSmime" />
<Button
android:id="@+id/btnImportKey"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/title_advanced_import_key"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnManageCertificates" />
<Button
android:id="@+id/btnManageKeys"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/title_advanced_manage_keys"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnImportKey" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvKeySize"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_aes_key_size"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnManageKeys" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

@ -126,106 +126,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swDisplayHidden" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvEncryptMethod"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_encrypt_method"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDisplayHiddenHint" />
<Spinner
android:id="@+id/spEncryptMethod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:entries="@array/encryptMethod"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvEncryptMethod" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvOpenPgp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_openpgp"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spEncryptMethod" />
<Spinner
android:id="@+id/spOpenPgp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOpenPgp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAutocrypt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_autocrypt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spOpenPgp"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAutocryptMutual"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_autocrypt_mutual"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutocrypt"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSign"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_sign_default"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutocryptMutual"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swEncrypt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_encrypt_default"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swSign"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAutoDecrypt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_auto_decrypt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swEncrypt"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSecure"
android:layout_width="0dp"
@ -234,7 +134,7 @@
android:text="@string/title_advanced_secure"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutoDecrypt"
app:layout_constraintTop_toBottomOf="@id/tvDisplayHiddenHint"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
@ -319,75 +219,5 @@
android:entries="@array/biometricsTimeoutNames"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvBiometricsTimeout" />
<View
android:id="@+id/vSeparatorSmime"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="12dp"
android:background="?attr/colorSeparator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spBiometricsTimeout" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvSmime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_smime"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorSmime" />
<Button
android:id="@+id/btnManageCertificates"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/title_advanced_manage_certificates"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSmime" />
<Button
android:id="@+id/btnImportKey"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/title_advanced_import_key"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnManageCertificates" />
<Button
android:id="@+id/btnManageKeys"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/title_advanced_manage_keys"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnImportKey" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvKeySize"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_aes_key_size"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnManageKeys" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

@ -249,8 +249,9 @@
<string name="title_advanced_section_connection">Connection</string>
<string name="title_advanced_section_display">Display</string>
<string name="title_advanced_section_behavior">Behavior</string>
<string name="title_advanced_section_notifications">Notifications</string>
<string name="title_advanced_section_privacy">Privacy</string>
<string name="title_advanced_section_encryption">Encryption</string>
<string name="title_advanced_section_notifications">Notifications</string>
<string name="title_advanced_section_misc">Miscellaneous</string>
<string name="title_advanced_receive">Receive messages</string>
@ -292,6 +293,11 @@
<string name="title_advanced_socks">Use SOCKS proxy</string>
<string name="title_advanced_manage_connectivity">Manage connectivity</string>
<string name="title_advanced_caption_general">General</string>
<string name="title_advanced_caption_folder">Folder</string>
<string name="title_advanced_caption_conversation">Conversation</string>
<string name="title_advanced_caption_message">Message</string>
<string name="title_advanced_landscape">Use two columns in landscape mode</string>
<string name="title_advanced_landscape3">Allow fixed navigation menu in landscape mode</string>
<string name="title_advanced_startup">Show on start screen</string>
@ -387,6 +393,9 @@
<string name="title_advanced_sound">Select notification sound</string>
<string name="title_advanced_alert_once" translatable="false">MIUI notification sound workaround</string>
<string name="title_advanced_caption_pgp" translatable="false">PGP</string>
<string name="title_advanced_caption_smime" translatable="false">S/MIME</string>
<string name="title_advanced_confirm_links">Confirm opening links</string>
<string name="title_advanced_confirm_images">Confirm showing images</string>
<string name="title_advanced_confirm_html">Show reformatted messages by default</string>
@ -402,7 +411,6 @@
<string name="title_advanced_secure">Hide from recent apps screen and prevent taking screenshots</string>
<string name="title_advanced_pin">PIN</string>
<string name="title_advanced_biometrics_timeout">Biometric authentication timeout</string>
<string name="title_advanced_smime" translatable="false">S/MIME</string>
<string name="title_advanced_manage_certificates">Manage public keys</string>
<string name="title_advanced_import_key">Import private key</string>
<string name="title_advanced_manage_keys">Manage private keys</string>

Loading…
Cancel
Save