+ public static int tableRowDarkBG;
+ @ColorInt
+ public static int primaryDark, defaultTextColor;
+ public static String[] monthNames;
+ private static SimpleDateFormat ledgerDateFormatter =
+ new SimpleDateFormat("yyyy/MM/dd", Locale.US);
+ public static void hideSoftKeyboard(Activity act) {
+ // hide the keyboard
+ View v = act.getCurrentFocus();
+ if (v != null) {
+ InputMethodManager imm =
+ (InputMethodManager) act.getSystemService(Context.INPUT_METHOD_SERVICE);
+ imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
+ }
+ }
+ public static Date parseLedgerDate(String dateString) {
+ try {
+ return ledgerDateFormatter.parse(dateString);
+ }
+ catch (ParseException e) {
+ throw new RuntimeException(String.format("Error parsing date '%s'", dateString), e);
+ }
+ }
+ public static String formatLedgerDate(Date date) {
+ return ledgerDateFormatter.format(date);
+ }