@@ -23,6 +23,7 @@ import android.app.Activity
2323import android.content.Context
2424import android.content.Intent
2525import android.os.Bundle
26+ import android.provider.Settings
2627import androidx.appcompat.app.AppCompatActivity
2728import dagger.Lazy
2829import nl.dionsegijn.konfetti.core.Party
@@ -226,6 +227,12 @@ class ListHabitsScreen
226227 override fun showConfetti (color : PaletteColor , x : Float , y : Float ) {
227228 if (x == 0f && y == 0f ) return
228229 if (preferences.isConfettiAnimationDisabled) return
230+ if (Settings .Global .getFloat(
231+ activity.contentResolver,
232+ Settings .Global .ANIMATOR_DURATION_SCALE ,
233+ 1f
234+ ) == 0f
235+ ) return
229236 val baseColor = themeSwitcher.currentTheme!! .color(color).toInt()
230237 rootView.get().konfettiView.start(
231238 Party (
@@ -299,30 +306,36 @@ class ListHabitsScreen
299306 command.selected.size
300307 )
301308 }
309+
302310 is ChangeHabitColorCommand -> {
303311 return activity.resources.getQuantityString(
304312 R .plurals.toast_habits_changed,
305313 command.selected.size
306314 )
307315 }
316+
308317 is CreateHabitCommand -> {
309318 return activity.resources.getString(R .string.toast_habit_created)
310319 }
320+
311321 is DeleteHabitsCommand -> {
312322 return activity.resources.getQuantityString(
313323 R .plurals.toast_habits_deleted,
314324 command.selected.size
315325 )
316326 }
327+
317328 is EditHabitCommand -> {
318329 return activity.resources.getQuantityString(R .plurals.toast_habits_changed, 1 )
319330 }
331+
320332 is UnarchiveHabitsCommand -> {
321333 return activity.resources.getQuantityString(
322334 R .plurals.toast_habits_unarchived,
323335 command.selected.size
324336 )
325337 }
338+
326339 else -> return null
327340 }
328341 }
@@ -335,9 +348,11 @@ class ListHabitsScreen
335348 adapter.refresh()
336349 activity.showMessage(activity.resources.getString(R .string.habits_imported))
337350 }
351+
338352 ImportDataTask .NOT_RECOGNIZED -> {
339353 activity.showMessage(activity.resources.getString(R .string.file_not_recognized))
340354 }
355+
341356 else -> {
342357 activity.showMessage(activity.resources.getString(R .string.could_not_import))
343358 }
0 commit comments