chthai64/SwipeRevealLayout

Swipe layout 0 width when parent uses layout_weight with a layout_width="0dp"

FranciscoG opened this issue · 1 comments

Title says it all.

If the parent container (in my case it's a linear layout) has a 0dp width and usinng layout_weight, when the SwipeRevealLayout handles onMeasure/onLayout it gives the child views a 0 width as well. However if I just give the parent LinearLayout a hard coded width or match_parent it works just fine.

android:layout_width="0dp"
android:layout_weight="0.48"

of course only minutes after posting this I found the solution that worked for me

all I had to do was add this to the parent LinearLayout: android:baselineAligned="false"

found the answer here: https://helw.net/2016/01/27/on-linearlayout-measures/