Refactoring

pull/214/head
M66B 1 year ago
parent a6c14910c4
commit 557296f437

@ -321,7 +321,6 @@ public class FragmentCompose extends FragmentBase {
// http://regex.info/blog/lightroom-goodies/jpeg-quality
private static final int MAX_QUOTE_LEVEL = 5;
private static final float LUMINANCE_THRESHOLD = 0.7f;
private static final int REQUEST_CONTACT_TO = 1;
private static final int REQUEST_CONTACT_CC = 2;
@ -7860,9 +7859,9 @@ public class FragmentCompose extends FragmentBase {
else {
Integer icolor = null;
float lum = (float) ColorUtils.calculateLuminance(color);
if (lum > LUMINANCE_THRESHOLD)
if (lum > Helper.BNV_LUMINANCE_THRESHOLD)
icolor = Color.BLACK;
else if ((1.0f - lum) > LUMINANCE_THRESHOLD)
else if ((1.0f - lum) > Helper.BNV_LUMINANCE_THRESHOLD)
icolor = Color.WHITE;
if (icolor == null)
itemColor = ContextCompat.getColorStateList(context, R.color.action_foreground);

@ -404,7 +404,6 @@ public class FragmentMessages extends FragmentBase
private static final int MAX_MORE = 100; // messages
private static final int MAX_SEND_RAW = 50; // messages
private static final float LUMINANCE_THRESHOLD = 0.7f;
private static final int ITEM_CACHE_SIZE = 10; // Default: 2 items
private static final int REQUEST_RAW = 1;
@ -7360,9 +7359,9 @@ public class FragmentMessages extends FragmentBase
Integer itemColor = null;
float lum = (float) ColorUtils.calculateLuminance(color);
if (lum > LUMINANCE_THRESHOLD)
if (lum > Helper.BNV_LUMINANCE_THRESHOLD)
itemColor = Color.BLACK;
else if ((1.0f - lum) > LUMINANCE_THRESHOLD)
else if ((1.0f - lum) > Helper.BNV_LUMINANCE_THRESHOLD)
itemColor = Color.WHITE;
if (itemColor != null)

@ -199,6 +199,7 @@ public class Helper {
static final int AUTH_AUTOLOCK_GRACE = 15; // seconds
static final int PIN_FAILURE_DELAY = 3; // seconds
static final long PIN_FAILURE_DELAY_MAX = 20 * 60 * 1000L; // milliseconds
static final float BNV_LUMINANCE_THRESHOLD = 0.7f;
static final String PGP_OPENKEYCHAIN_PACKAGE = "org.sufficientlysecure.keychain";
static final String PGP_BEGIN_MESSAGE = "-----BEGIN PGP MESSAGE-----";

Loading…
Cancel
Save