From a98b0013feee4298b35d26b365693d6fc10d805a Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 4 Apr 2021 10:05:10 +0200 Subject: [PATCH] Refactoring --- app/src/main/java/eu/faircode/email/FragmentAbout.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentAbout.java b/app/src/main/java/eu/faircode/email/FragmentAbout.java index 69097bf5f4..aa41df1358 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAbout.java +++ b/app/src/main/java/eu/faircode/email/FragmentAbout.java @@ -51,6 +51,8 @@ public class FragmentAbout extends FragmentBase { setSubtitle(R.string.menu_about); setHasOptionsMenu(true); + final Context context = getContext(); + View view = inflater.inflate(R.layout.fragment_about, container, false); TextView tvVersion = view.findViewById(R.id.tvVersion); @@ -65,18 +67,18 @@ public class FragmentAbout extends FragmentBase { long last = 0; try { - PackageManager pm = getContext().getPackageManager(); + PackageManager pm = context.getPackageManager(); PackageInfo pi = pm.getPackageInfo(BuildConfig.APPLICATION_ID, 0); last = pi.lastUpdateTime; } catch (Throwable ex) { Log.e(ex); } - DateFormat DF = Helper.getDateTimeInstance(getContext(), DateFormat.SHORT, DateFormat.SHORT); + DateFormat DF = Helper.getDateTimeInstance(context, DateFormat.SHORT, DateFormat.SHORT); tvUpdated.setText(getString(R.string.app_updated, last == 0 ? "-" : DF.format(last))); ibUpdate.setVisibility( - Helper.hasValidFingerprint(getContext()) || BuildConfig.DEBUG + Helper.hasValidFingerprint(context) || BuildConfig.DEBUG ? View.VISIBLE : View.GONE); ibUpdate.setOnClickListener(new View.OnClickListener() { @Override @@ -96,8 +98,6 @@ public class FragmentAbout extends FragmentBase { } }); - final Context context = getContext(); - TypedValue style = new TypedValue(); context.getTheme().resolveAttribute(R.style.TextAppearance_AppCompat_Small, style, true);