From 9522dcad8ae0c4ad52c9adbf73d6784bc05449e0 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 1 Apr 2018 15:23:55 +0200 Subject: migrated some views over to app compat text styles --- .../java/de/pixart/messenger/ui/OmemoActivity.java | 37 -------- src/main/res/layout/activity_edit_account.xml | 33 +++----- src/main/res/layout/captcha.xml | 11 +-- src/main/res/layout/certificate_information.xml | 99 ---------------------- src/main/res/layout/contact.xml | 5 +- src/main/res/layout/contact_key.xml | 8 +- src/main/res/layout/dialog_block_contact.xml | 11 ++- src/main/res/layout/dialog_clear_history.xml | 9 +- src/main/res/layout/magic_create.xml | 12 +-- src/main/res/layout/presence_template.xml | 3 +- src/main/res/layout/welcome.xml | 11 +-- src/main/res/values/styles.xml | 5 ++ 12 files changed, 43 insertions(+), 201 deletions(-) delete mode 100644 src/main/res/layout/certificate_information.xml (limited to 'src/main') diff --git a/src/main/java/de/pixart/messenger/ui/OmemoActivity.java b/src/main/java/de/pixart/messenger/ui/OmemoActivity.java index 1ee2f9355..b278e146c 100644 --- a/src/main/java/de/pixart/messenger/ui/OmemoActivity.java +++ b/src/main/java/de/pixart/messenger/ui/OmemoActivity.java @@ -14,8 +14,6 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; -import java.security.cert.X509Certificate; - import de.pixart.messenger.Config; import de.pixart.messenger.R; import de.pixart.messenger.crypto.axolotl.FingerprintStatus; @@ -125,10 +123,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); @@ -212,37 +206,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 01cd2b5de..e0ef55c6e 100644 --- a/src/main/res/layout/activity_edit_account.xml +++ b/src/main/res/layout/activity_edit_account.xml @@ -180,10 +180,7 @@ android:id="@+id/os_optimization_headline" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/battery_optimizations_enabled" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeHeadline" - android:textStyle="bold" /> + android:textAppearance="@style/TextAppearance.AppCompat.Title" /> + android:textAppearance="@style/TextAppearance.AppCompat.Body1" />