Skip to content

Instantly share code, notes, and snippets.

@jezinka
Created April 16, 2017 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jezinka/e47c06d7e690b9fefc1ff06117f0b5fd to your computer and use it in GitHub Desktop.
Save jezinka/e47c06d7e690b9fefc1ff06117f0b5fd to your computer and use it in GitHub Desktop.
public static int getTimeDeltaMilliseconds(Context context) {
return 1000 * 60 * 60 * 24 * getDaysInPlanner(context);
}
public static int getDaysInPlanner(Context context) {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
String daysNoPrefs = sharedPref.getString(SettingsActivity.PREFS_DAYS_NO, "7");
return Integer.parseInt(daysNoPrefs);
}
private static int getFirstDay(Context context) {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
String firstDayPrefs = sharedPref.getString(SettingsActivity.PREFS_FIRST_DAY, "7");
return Integer.parseInt(firstDayPrefs);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment