|
|
@ -137,14 +137,9 @@ public class EditHabitFragment extends DialogFragment
|
|
|
|
{
|
|
|
|
{
|
|
|
|
getDialog().setTitle(R.string.create_habit);
|
|
|
|
getDialog().setTitle(R.string.create_habit);
|
|
|
|
modifiedHabit = new Habit();
|
|
|
|
modifiedHabit = new Habit();
|
|
|
|
|
|
|
|
modifiedHabit.freqNum = 1;
|
|
|
|
int defaultNum = prefs.getInt("pref_default_habit_freq_num", modifiedHabit.freqNum);
|
|
|
|
modifiedHabit.freqDen = 1;
|
|
|
|
int defaultDen = prefs.getInt("pref_default_habit_freq_den", modifiedHabit.freqDen);
|
|
|
|
modifiedHabit.color = prefs.getInt("pref_default_habit_color", modifiedHabit.color);
|
|
|
|
int defaultColor = prefs.getInt("pref_default_habit_color", modifiedHabit.color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modifiedHabit.color = defaultColor;
|
|
|
|
|
|
|
|
modifiedHabit.freqNum = defaultNum;
|
|
|
|
|
|
|
|
modifiedHabit.freqDen = defaultDen;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (mode == EDIT_MODE)
|
|
|
|
else if (mode == EDIT_MODE)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -268,11 +263,6 @@ public class EditHabitFragment extends DialogFragment
|
|
|
|
|
|
|
|
|
|
|
|
if (!validate()) return;
|
|
|
|
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;
|
|
|
|
Command command = null;
|
|
|
|
Habit savedHabit = null;
|
|
|
|
Habit savedHabit = null;
|
|
|
|
|
|
|
|
|
|
|
|