CustomListView - A flexible list based on ScrollView

Status
Not open for further replies.

fbritop

Active Member
Licensed User
Longtime User
Press on Ctrl + P (clean project) and then run your program. It will cause the compiler to make a full deployment and will run faster in debug mode.
Erel,
I think you understood all the way around. It runs faster in debug mode than in release mode. That's the wierd thing
 

LucaMs

Expert
Licensed User
Longtime User
[V. 1.70]

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
otherwise the app will crash.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Also, I think that an exception handler for an "index out of bound" error should be added to:
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.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
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.
 

ilan

Expert
Licensed User
Longtime User
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.
 

LucaMs

Expert
Licensed User
Longtime User
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?
 

LucaMs

Expert
Licensed User
Longtime User
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!

Mah!

Critiques, among other things, help to improve.
 

LucaMs

Expert
Licensed User
Longtime User
It was a healthy discussion about exceptions and libraries
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 )
 

LucaMs

Expert
Licensed User
Longtime User
That's true. This is why it is good that an out of bounds error is raised when the developer tries to access an invalid panel.
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 ).
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…