Skip to content
Snippets Groups Projects
Commit a2235747 authored by Mohamed Metwalli's avatar Mohamed Metwalli
Browse files

Rely on view's context to prevent crash in UI test

parent db645fa2
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ fun setChecked(switch: Switch, status: Boolean?) { ...@@ -25,7 +25,7 @@ fun setChecked(switch: Switch, status: Boolean?) {
@BindingAdapter("animation") @BindingAdapter("animation")
fun setAnimation(view: LottieAnimationView, animation: Int?) { fun setAnimation(view: LottieAnimationView, animation: Int?) {
if (animation != null) { if (animation != null) {
val appContext = CoronaWarnApplication.getAppContext() val appContext = view.context.applicationContext
val type = appContext.resources.getResourceTypeName(animation) val type = appContext.resources.getResourceTypeName(animation)
if (type == DRAWABLE_TYPE) { if (type == DRAWABLE_TYPE) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment