I would add (um... I added to my version) GetDividerHeight (property or function).
Also, I think that an exception handler for an "index out of bound" error should be added to:
B4X:
'Returns the Panel stored at the specified index.
Public Sub GetPanel(Index As Int) As Panel
Dim p As Panel
p = panels.Get(Index) 'this is the parent panel
Return p.GetView(0)
End Sub
This is the desired result if you try to access an invalid index. If the developer would like for some reason to catch this error instead of fixing the code then it can be added in the developer's code.
This is an important concept. Library developers (CLV is a library in this regard) should avoid catching exceptions whenever possible. This is the developer responsibility to decide how to handle errors.
In this case it is a programming error so it is even more clear. If a developer tried to get an invalid panel then the code should help him fix this error. Returning a different panel (maybe the last one) will lead to other errors which will be more difficult to debug.
Without that error you would not get the correct result and not know why you dont get it. I agree with erel. The whole idea is not just to have an app without any crashes you want to have an app that does what you programmed it to do! Then u need to catch all errors and fix them.
If you declare an array with N elements and then you try to access the N+1 element you get an out of bound error.
This is the behavior of the Core library, I think (or I don't know from where you get the message ).
Don't you see a similitude?
I do not know if it is my fault in my poor English or my natural tone (which obviously I can not reproduce) but it seems that if I dare to give a hint it is often mistaken for criticism!
This was not my intention, my was a suggestion about the CLV.
I see many similarities between an "internal" array and any exceptions and elements of the CLV.
I also have some doubts about the dividerHeight: what do I do, hang and suit?
P.S. I don't know how to translate "taccio e mi adeguo?" (used google translate but I don't trust much this translation )
I think I've lost the thread, because it's exactly the message that you get: java.lang.IndexOutOfBoundsException: Invalid index 500, size is 5
I would certainly have forgotten what my question was (two days for me are too many ).