Revert "Fix for issue #168"

This reverts commit cef8b5fbd0.
pull/175/head
RegularCoder 9 years ago
parent 04500791f2
commit f2a0c95168

@ -39,9 +39,6 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
private WidgetPreferences widgetPrefs;
//Used to show meaningful message if a habit is deleted
private Boolean habitNotFound = false;
@Override
public void onAppWidgetOptionsChanged(@Nullable Context context,
@Nullable AppWidgetManager manager,
@ -100,6 +97,7 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
for (int id : widgetIds)
update(context, manager, id);
}, 500);
}
@NonNull
@ -107,10 +105,7 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
{
long habitId = widgetPrefs.getHabitIdFromWidgetId(widgetId);
Habit habit = habits.getById(habitId);
if (habit == null) {
habitNotFound = true;
throw new RuntimeException("habit not found");
}
if (habit == null) throw new RuntimeException("habit not found");
return habit;
}
@ -124,11 +119,6 @@ public abstract class BaseWidgetProvider extends AppWidgetProvider
{
RemoteViews errorView =
new RemoteViews(context.getPackageName(), R.layout.widget_error);
if(habitNotFound) {
errorView.setCharSequence(R.id.label, "setText", context.getString(R.string.habit_not_found));
}
manager.updateAppWidget(widgetId, errorView);
}

@ -102,7 +102,6 @@
<string name="hint_landscape">You can see more days by putting your phone in landscape mode.</string>
<string name="delete_habits">Delete Habits</string>
<string name="delete_habits_message">The habits will be permanently deleted. This action cannot be undone.</string>
<string name="habit_not_found">Habit deleted / not found</string>
<string name="weekends">Weekends</string>
<string name="any_weekday">Monday to Friday</string>
<string name="any_day">Any day of the week</string>

Loading…
Cancel
Save