ui: fix edit layout crashes

Fix crashes that prevented android studio from showing layout previews
of certain views.
This commit is contained in:
Alexander Capehart
2023-07-27 15:42:19 -06:00
parent 6ac757b952
commit 507bc516ce
3 changed files with 8 additions and 2 deletions
@@ -59,8 +59,10 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
override fun onAttachedToWindow() {
super.onAttachedToWindow()
if (!isInEditMode) {
(layoutParams as CoordinatorLayout.LayoutParams).behavior = Behavior(context)
}
}
private fun findTitleView(): TextView {
val titleView = titleView
@@ -255,7 +255,7 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
}
private fun getCornerRadiusRes() =
if (uiSettings.roundMode) {
if (!isInEditMode && uiSettings.roundMode) {
SIZING_CORNER_RADII[sizing]
} else {
null
@@ -0,0 +1,4 @@
package org.oxycblt.auxio.ui
class IconToolbar {
}