From 71beb92dd33f0a61298a949ff5a74c835867a352 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 28 Feb 2018 22:18:33 +0100 Subject: [PATCH] migrated some views over to app compat text styles --- .../siacs/conversations/ui/OmemoActivity.java | 35 -------- src/main/res/layout/activity_edit_account.xml | 17 ++-- src/main/res/layout/captcha.xml | 3 - .../res/layout/certificate_information.xml | 88 ------------------- src/main/res/layout/contact.xml | 5 +- src/main/res/layout/contact_key.xml | 8 +- src/main/res/layout/dialog_block_contact.xml | 3 +- src/main/res/layout/dialog_clear_history.xml | 7 +- src/main/res/layout/magic_create.xml | 13 +-- src/main/res/layout/presence_template.xml | 3 +- src/main/res/layout/welcome.xml | 7 +- src/main/res/values/styles.xml | 4 + 12 files changed, 23 insertions(+), 170 deletions(-) delete mode 100644 src/main/res/layout/certificate_information.xml diff --git a/src/main/java/eu/siacs/conversations/ui/OmemoActivity.java b/src/main/java/eu/siacs/conversations/ui/OmemoActivity.java index e63024c43..dd4829784 100644 --- a/src/main/java/eu/siacs/conversations/ui/OmemoActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/OmemoActivity.java @@ -127,10 +127,6 @@ public abstract class OmemoActivity extends XmppActivity { CompoundButton.OnCheckedChangeListener onCheckedChangeListener) { ContactKeyBinding binding = DataBindingUtil.inflate(getLayoutInflater(), R.layout.contact_key, keys, true); - if (Config.X509_VERIFICATION && status.getTrust() == FingerprintStatus.Trust.VERIFIED_X509) { - binding.key.setOnClickListener(v -> showX509Certificate(account, fingerprint)); - binding.keyType.setOnClickListener(v -> showX509Certificate(account, fingerprint)); - } binding.tglTrust.setVisibility(View.VISIBLE); registerForContextMenu(binding.getRoot()); binding.getRoot().setTag(R.id.TAG_ACCOUNT, account); @@ -214,37 +210,6 @@ public abstract class OmemoActivity extends XmppActivity { builder.create().show(); } - private void showX509Certificate(Account account, String fingerprint) { - X509Certificate x509Certificate = account.getAxolotlService().getFingerprintCertificate(fingerprint); - if (x509Certificate != null) { - showCertificateInformationDialog(CryptoHelper.extractCertificateInformation(x509Certificate)); - } else { - Toast.makeText(this, R.string.certificate_not_found, Toast.LENGTH_SHORT).show(); - } - } - - private void showCertificateInformationDialog(Bundle bundle) { - View view = getLayoutInflater().inflate(R.layout.certificate_information, null); - final String not_available = getString(R.string.certicate_info_not_available); - TextView subject_cn = (TextView) view.findViewById(R.id.subject_cn); - TextView subject_o = (TextView) view.findViewById(R.id.subject_o); - TextView issuer_cn = (TextView) view.findViewById(R.id.issuer_cn); - TextView issuer_o = (TextView) view.findViewById(R.id.issuer_o); - TextView sha1 = (TextView) view.findViewById(R.id.sha1); - - subject_cn.setText(bundle.getString("subject_cn", not_available)); - subject_o.setText(bundle.getString("subject_o", not_available)); - issuer_cn.setText(bundle.getString("issuer_cn", not_available)); - issuer_o.setText(bundle.getString("issuer_o", not_available)); - sha1.setText(bundle.getString("sha1", not_available)); - - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.certificate_information); - builder.setView(view); - builder.setPositiveButton(R.string.ok, null); - builder.create().show(); - } - @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { ScanActivity.onRequestPermissionResult(this, requestCode, grantResults); diff --git a/src/main/res/layout/activity_edit_account.xml b/src/main/res/layout/activity_edit_account.xml index 7bb630ecb..3f6e6a45e 100644 --- a/src/main/res/layout/activity_edit_account.xml +++ b/src/main/res/layout/activity_edit_account.xml @@ -162,9 +162,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/battery_optimizations_enabled" - android:textColor="?attr/color_text_primary" - android:textSize="?attr/TextSizeHeadline" - android:textStyle="bold"/> + android:textAppearance="@style/TextAppearance.AppCompat.Title"/> + android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>