Y Yuri Cinesi Active Member Licensed User May 30, 2018 #1 I'm using a textbox to have the user input a search criteria. The app then searches a file and populates the listview with all the items it found matching that criteria. For some reason any item that is more than two lines displays the black bars shown in the screenshot. The color of those black bars is determined by listview.sv.color, but I can't simply change its value since it determines the divider. This is not xCustomListView as I'm using an older version of B4A (7.01) and when I tried to use it if I recall correctly it required some features not present in this version. How can I fix this? I've been completely unable to replicate this behaviour in a smaller project, no matter how similar I make the conditions. It also seems to happen randomly sometimes with some listviews I have separated using TabStripViewPager, within the same app. Attachments Screenshot_2018-05-30-08-38-40[1].png 193.8 KB · Views: 538 Last edited: May 30, 2018
I'm using a textbox to have the user input a search criteria. The app then searches a file and populates the listview with all the items it found matching that criteria. For some reason any item that is more than two lines displays the black bars shown in the screenshot. The color of those black bars is determined by listview.sv.color, but I can't simply change its value since it determines the divider. This is not xCustomListView as I'm using an older version of B4A (7.01) and when I tried to use it if I recall correctly it required some features not present in this version. How can I fix this? I've been completely unable to replicate this behaviour in a smaller project, no matter how similar I make the conditions. It also seems to happen randomly sometimes with some listviews I have separated using TabStripViewPager, within the same app.
Erel B4X founder Staff member Licensed User Longtime User May 30, 2018 #2 Yuri Cinesi said: This is not xCustomListView as I'm using an older version of B4A (7.01) and when I tried to use it if I recall correctly it required some features not present in this version. Click to expand... xCustomListView is the way to go. It is more powerful than the older CustomListView class. How are you adding items? Upvote 0
Yuri Cinesi said: This is not xCustomListView as I'm using an older version of B4A (7.01) and when I tried to use it if I recall correctly it required some features not present in this version. Click to expand... xCustomListView is the way to go. It is more powerful than the older CustomListView class. How are you adding items?
Y Yuri Cinesi Active Member Licensed User May 30, 2018 #3 I'm using .addTextItem. I'd actually prefer to stick with the current CustomListView as I edited it a bit, but if necessary I can try switching. For reference, I added lazy loading at around 75% of the total height of the view. This doesn't apply for this specific customlistview however. Last edited: May 30, 2018 Upvote 0
I'm using .addTextItem. I'd actually prefer to stick with the current CustomListView as I edited it a bit, but if necessary I can try switching. For reference, I added lazy loading at around 75% of the total height of the view. This doesn't apply for this specific customlistview however.
Erel B4X founder Staff member Licensed User Longtime User May 31, 2018 #4 Make sure that you are not reusing the same drawable for multiple views. This can cause such issues. Upvote 0
Y Yuri Cinesi Active Member Licensed User May 31, 2018 #5 Sorry, but I'm not quite sure what you mean. How can I check? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User May 31, 2018 #6 If you modified CustomListView and changed the way it creates the items then make sure that you are not using the same ColorDrawable or a similar drawable multiple times. Upvote 0
If you modified CustomListView and changed the way it creates the items then make sure that you are not using the same ColorDrawable or a similar drawable multiple times.
Y Yuri Cinesi Active Member Licensed User May 31, 2018 #7 I haven't edited the way it adds items. I can upload the customlistview class if that would help Upvote 0
Erel B4X founder Staff member Licensed User Longtime User May 31, 2018 #8 You need to switch to xCustomClassView and try to reproduce it. Upvote 0
Y Yuri Cinesi Active Member Licensed User May 31, 2018 #9 I'm trying to switch, but it throws the following warning: Cannot access view's dimension before it is added to its parent. If I edit those lines it keeps crashing in different points throwing errors about nullpointerexceptions. The same happens with the example linked in the post about xcustomlistview. Upvote 0
I'm trying to switch, but it throws the following warning: Cannot access view's dimension before it is added to its parent. If I edit those lines it keeps crashing in different points throwing errors about nullpointerexceptions. The same happens with the example linked in the post about xcustomlistview.
LucaMs Expert Licensed User Longtime User May 31, 2018 #10 Sarai pure Yuri Cinesi ma mi sembri tanto italiano, vista l'app Yuri Cinesi said: I'm trying to switch, but it throws the following warning: Cannot access view's dimension before it is added to its parent. If I edit those lines it keeps crashing in different points throwing errors about nullpointerexceptions. The same happens with the example linked in the post about xcustomlistview. Click to expand... We don't know how you are using CLV (probably not in the right way ) and we don't know "those lines". However, in some cases, you could/should call routines using CallSubDelayed from Activity_Create, so that the UI is completely created. Upvote 0
Sarai pure Yuri Cinesi ma mi sembri tanto italiano, vista l'app Yuri Cinesi said: I'm trying to switch, but it throws the following warning: Cannot access view's dimension before it is added to its parent. If I edit those lines it keeps crashing in different points throwing errors about nullpointerexceptions. The same happens with the example linked in the post about xcustomlistview. Click to expand... We don't know how you are using CLV (probably not in the right way ) and we don't know "those lines". However, in some cases, you could/should call routines using CallSubDelayed from Activity_Create, so that the UI is completely created.
Y Yuri Cinesi Active Member Licensed User May 31, 2018 #11 LucaMs said: We don't know how you are using CLV (probably not in the right way ) and we don't know "those lines". However, in some cases, you could/should call routines using CallSubDelayed from Activity_Create, so that the UI is completely created. Click to expand... As I wrote above the example downloaded from the xcustomlistview post also crashes as well, which makes me think it's something to do with my version of B4A rather than how I'm using CLV. The lines that error out are line 58,445 and 446 within the customlistview.bas file. I'm using the file as is, without editing anything. I've attached a couple screenshots. Attachments Screenshot1.png 83.1 KB · Views: 566 Screenshot2.png 73.9 KB · Views: 530 Last edited: May 31, 2018 Upvote 0
LucaMs said: We don't know how you are using CLV (probably not in the right way ) and we don't know "those lines". However, in some cases, you could/should call routines using CallSubDelayed from Activity_Create, so that the UI is completely created. Click to expand... As I wrote above the example downloaded from the xcustomlistview post also crashes as well, which makes me think it's something to do with my version of B4A rather than how I'm using CLV. The lines that error out are line 58,445 and 446 within the customlistview.bas file. I'm using the file as is, without editing anything. I've attached a couple screenshots.
Erel B4X founder Staff member Licensed User Longtime User May 31, 2018 #12 Yuri Cinesi said: As I wrote above the example downloaded from the xcustomlistview post also crashes as well, which makes me think it's something to do with my version of B4A rather than how I'm using CLV. Click to expand... In older versions of B4A, it was not possible to set the size of a view without adding it to a parent. This is now possible and is very useful. This is the cause of the error. Upvote 0
Yuri Cinesi said: As I wrote above the example downloaded from the xcustomlistview post also crashes as well, which makes me think it's something to do with my version of B4A rather than how I'm using CLV. Click to expand... In older versions of B4A, it was not possible to set the size of a view without adding it to a parent. This is now possible and is very useful. This is the cause of the error.
Y Yuri Cinesi Active Member Licensed User May 31, 2018 #13 Were all the versions of xcustomlistview made with this feature or is there an older version I could use? Or am I just SOL? Upvote 0
Were all the versions of xcustomlistview made with this feature or is there an older version I could use? Or am I just SOL?
Erel B4X founder Staff member Licensed User Longtime User May 31, 2018 #14 xCLV which is based on XUI should be used with B4A v8+. Note that you will soon need B4A v8+ anyway. android.jar / targetSdkVersion / minSdkVersion Upvote 0
xCLV which is based on XUI should be used with B4A v8+. Note that you will soon need B4A v8+ anyway. android.jar / targetSdkVersion / minSdkVersion