X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;ds=sidebyside;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Futils%2FGlobals.java;h=4562dbaec3f106ef5008283a74bee645785b5967;hb=658663a586eaf33b59986fa6d0fac93b36d8b5a6;hp=0dfe3252bd33ad02ca33764519cbefb626f3d516;hpb=8a79f5c25119bd8fcca18232d7168b5c40fc40df;p=mobile-ledger-staging.git
diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/Globals.java b/app/src/main/java/net/ktnx/mobileledger/utils/Globals.java
index 0dfe3252..4562dbae 100644
--- a/app/src/main/java/net/ktnx/mobileledger/utils/Globals.java
+++ b/app/src/main/java/net/ktnx/mobileledger/utils/Globals.java
@@ -1,25 +1,24 @@
/*
* Copyright © 2019 Damyan Ivanov.
- * This file is part of Mobile-Ledger.
- * Mobile-Ledger is free software: you can distribute it and/or modify it
+ * This file is part of MoLe.
+ * MoLe is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opinion), any later version.
*
- * Mobile-Ledger is distributed in the hope that it will be useful,
+ * MoLe is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License terms for details.
*
* You should have received a copy of the GNU General Public License
- * along with Mobile-Ledger. If not, see .
+ * along with MoLe. If not, see .
*/
package net.ktnx.mobileledger.utils;
import android.app.Activity;
import android.content.Context;
-import android.support.annotation.ColorInt;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
@@ -32,15 +31,15 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
public final class Globals {
- @ColorInt
- public static int tableRowLightBG;
- @ColorInt
- public static int tableRowDarkBG;
- @ColorInt
- public static int primaryDark, defaultTextColor;
+ private static final ThreadLocal dateFormatter =
+ new ThreadLocal() {
+ @Override
+ protected SimpleDateFormat initialValue() {
+ return new SimpleDateFormat("yyyy/MM/dd", Locale.US);
+ }
+ };
public static String[] monthNames;
- private static SimpleDateFormat ledgerDateFormatter =
- new SimpleDateFormat("yyyy/MM/dd", Locale.US);
+ public static String developerEmail = "dam+mole-crash@ktnx.net";
private static Pattern reLedgerDate =
Pattern.compile("^(?:(\\d+)/)??(?:(\\d\\d?)/)?(\\d\\d?)$");
public static void hideSoftKeyboard(Activity act) {
@@ -72,10 +71,9 @@ public final class Globals {
}
else toParse = dateString;
-// Log.d("globals", String.format("Parsing date '%s'", toParse));
- return ledgerDateFormatter.parse(toParse);
+ return dateFormatter.get().parse(toParse);
}
public static String formatLedgerDate(Date date) {
- return ledgerDateFormatter.format(date);
+ return dateFormatter.get().format(date);
}
}
\ No newline at end of file