Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Iamlooker committed Dec 10, 2023
1 parent daab36a commit b29ca14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions app/src/main/res/layout/app_detail_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,4 @@
app:icon="@drawable/favourite_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ private fun Context.getDrawableFromAttr(attrResId: Int): Drawable {
}

fun Context.getDrawableCompat(@DrawableRes resId: Int = R.drawable.background_border): Drawable =
AppCompatResources.getDrawable(this, resId) ?: throw IllegalStateException(
"Cannot find drawable, ID: $resId"
)
requireNotNull(AppCompatResources.getDrawable(this, resId)) { "Cannot find drawable, ID: $resId" }

fun Context.getColorFromAttr(@AttrRes attrResId: Int): ColorStateList {
val typedArray = obtainStyledAttributes(intArrayOf(attrResId))
Expand Down

0 comments on commit b29ca14

Please sign in to comment.