mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Set default habit frequency to daily
This commit is contained in:
@@ -137,14 +137,9 @@ public class EditHabitFragment extends DialogFragment
|
||||
{
|
||||
getDialog().setTitle(R.string.create_habit);
|
||||
modifiedHabit = new Habit();
|
||||
|
||||
int defaultNum = prefs.getInt("pref_default_habit_freq_num", modifiedHabit.freqNum);
|
||||
int defaultDen = prefs.getInt("pref_default_habit_freq_den", modifiedHabit.freqDen);
|
||||
int defaultColor = prefs.getInt("pref_default_habit_color", modifiedHabit.color);
|
||||
|
||||
modifiedHabit.color = defaultColor;
|
||||
modifiedHabit.freqNum = defaultNum;
|
||||
modifiedHabit.freqDen = defaultDen;
|
||||
modifiedHabit.freqNum = 1;
|
||||
modifiedHabit.freqDen = 1;
|
||||
modifiedHabit.color = prefs.getInt("pref_default_habit_color", modifiedHabit.color);
|
||||
}
|
||||
else if (mode == EDIT_MODE)
|
||||
{
|
||||
@@ -268,11 +263,6 @@ public class EditHabitFragment extends DialogFragment
|
||||
|
||||
if (!validate()) return;
|
||||
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putInt("pref_default_habit_freq_num", modifiedHabit.freqNum);
|
||||
editor.putInt("pref_default_habit_freq_den", modifiedHabit.freqDen);
|
||||
editor.apply();
|
||||
|
||||
Command command = null;
|
||||
Habit savedHabit = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user