Skip to content

Commit

Permalink
Fix desinger onInit method rightMenu param always null
Browse files Browse the repository at this point in the history
  • Loading branch information
aitsuki committed Jun 2, 2022
1 parent fa82ff6 commit 64535f1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions library/src/main/java/com/aitsuki/swipe/SwipeLayout.kt
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,6 @@ class SwipeLayout @JvmOverloads constructor(
rightMenu = child
}

if (!initDesigner) {
designer.onInit(this, leftMenu, rightMenu)
initDesigner = true
}

if (child.visibility != GONE) {
measureChild(child, widthMeasureSpec, heightMeasureSpec)
childWidth = childWidth.coerceAtLeast(child.measuredWidth)
Expand All @@ -487,6 +482,11 @@ class SwipeLayout @JvmOverloads constructor(
}
}

if (!initDesigner) {
designer.onInit(this, leftMenu, rightMenu)
initDesigner = true
}

childWidth += paddingLeft + paddingRight
childHeight += paddingTop + paddingBottom

Expand Down

0 comments on commit 64535f1

Please sign in to comment.