From 85adebe77d9c65bdb5ab436839eddb68c693454e Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 9 Feb 2023 09:58:39 +0100 Subject: [PATCH] Refactoring --- .../java/eu/faircode/email/FragmentCompose.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index c1fe62c8d2..0b4df3535f 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1807,23 +1807,23 @@ public class FragmentCompose extends FragmentBase { int colorActionForeground = Helper.resolveColor(actionBarContext, android.R.attr.textColorPrimary); View v = menu.findItem(R.id.menu_encrypt).getActionView(); - ImageButton ib = v.findViewById(R.id.button); + ImageButton ibEncrypt = v.findViewById(R.id.button); TextView tv = v.findViewById(R.id.text); v.setAlpha(state == State.LOADED && !dsn ? 1f : Helper.LOW_LIGHT); - ib.setEnabled(state == State.LOADED && !dsn); + ibEncrypt.setEnabled(state == State.LOADED && !dsn); if (EntityMessage.PGP_SIGNONLY.equals(encrypt) || EntityMessage.SMIME_SIGNONLY.equals(encrypt)) { - ib.setImageResource(R.drawable.twotone_gesture_24); - ib.setImageTintList(ColorStateList.valueOf(colorActionForeground)); + ibEncrypt.setImageResource(R.drawable.twotone_gesture_24); + ibEncrypt.setImageTintList(ColorStateList.valueOf(colorActionForeground)); tv.setText(EntityMessage.PGP_SIGNONLY.equals(encrypt) ? "P" : "S"); } else if (EntityMessage.PGP_SIGNENCRYPT.equals(encrypt) || EntityMessage.SMIME_SIGNENCRYPT.equals(encrypt)) { - ib.setImageResource(R.drawable.twotone_lock_24); - ib.setImageTintList(ColorStateList.valueOf(colorEncrypt)); + ibEncrypt.setImageResource(R.drawable.twotone_lock_24); + ibEncrypt.setImageTintList(ColorStateList.valueOf(colorEncrypt)); tv.setText(EntityMessage.PGP_SIGNENCRYPT.equals(encrypt) ? "P" : "S"); } else { - ib.setImageResource(R.drawable.twotone_lock_open_24); - ib.setImageTintList(ColorStateList.valueOf(colorActionForeground)); + ibEncrypt.setImageResource(R.drawable.twotone_lock_open_24); + ibEncrypt.setImageTintList(ColorStateList.valueOf(colorActionForeground)); tv.setText(null); }