ui: fix edit layout crashes
Fix crashes that prevented android studio from showing layout previews of certain views.
This commit is contained in:
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
|
||||
|
|
4
app/src/main/java/org/oxycblt/auxio/ui/IconToolbar.kt
Normal file
4
app/src/main/java/org/oxycblt/auxio/ui/IconToolbar.kt
Normal file
|
@ -0,0 +1,4 @@
|
|||
package org.oxycblt.auxio.ui
|
||||
|
||||
class IconToolbar {
|
||||
}
|
Loading…
Reference in a new issue