My splitpane contains a customlistview with textareas which have to measure height baesd on text length. So I have to turn off the handle resize event in layout designer.
To add a SplitPane PositionChanged_Event, we can first get its dividers and then add a change listener to its positionProperty.
To add a SplitPane PositionChanged_Event, we can first get its dividers and then add a change listener to its positionProperty.
B4X:
Sub init
Dim jo As JavaObject
jo=upperRightSplitPane
addPositionChangedEvent(jo.RunMethodJO("getDividers",Null).RunMethodJO("get",Array(0)),"dividerPosition")
End Sub
Sub addPositionChangedEvent(divider As Object,eventName As String)
Dim Obj As Reflector
Obj.Target = divider
Obj.AddChangeListener(eventName, "positionProperty")
End Sub
Sub dividerPosition_changed(old As Object, new As Object)
CallSubDelayed(Me,"ListViewParent_Resize")
End Sub