Android Question Can I Have a Selected Item From an XCustomListView be Only in Center of Screen

Mahares

Expert
Licensed User
Longtime User
I have an XCustomListView with a transparent panel in the center of the screen. I would like the selected item to always be inside the transparent panel and its text font become automatically larger than the rest when the panel is wrapped around it.

Please see the Undesired.png look which I achieved from my attached complete project. But, I really want the Desired.png look which I am seeking help with. I also like the xCustomListView to be bottomless, meaning when you scroll the items up or down endlessly, the list repeats itself in circle without stopping at the top or bottom of the list. (project and screenshots attached)
I hope someone can figure out what I am stuck in. Thank you
 

Attachments

  • Desired.png
    Desired.png
    30.3 KB · Views: 221
  • Undesired.png
    Undesired.png
    16.3 KB · Views: 226
  • xCustomListViewScreenCenteredSelection.zip
    16.1 KB · Views: 170

Mahares

Expert
Licensed User
Longtime User
Search for "wheel" - there are few solutions in the forum.
Since you referred me to the search engine, I did use your NewWheel class, but it does not address my needs. I included a working project example using your class to show the issues: Here are the issues:
1. You cannot scroll up and down the list as a normal customlistview or listview does
2. It only displays 3 items at a time on the screen
3. You can select any of the 3 items. I only want the center value to be allowed as the selected
4. I like to make use of the xCustomListView versatility if it can achieve what I want in Desired.png image.

If anyone is interested in what I want to achieve, I have a link to a very short video here:
https://www.dropbox.com/s/xjd5pi23wg8zr2m/customlistviewscroll.mp4?dl=0
 

Attachments

  • DerezNewWheelWithMaharesExample.zip
    10 KB · Views: 173
Upvote 0

derez

Expert
Licensed User
Longtime User
Since you referred me to the search engine, I did use your NewWheel class, but it does not address my needs. I included a working project example using your class to show the issues: Here are the issues:
1. You cannot scroll up and down the list as a normal customlistview or listview does
2. It only displays 3 items at a time on the screen
3. You can select any of the 3 items. I only want the center value to be allowed as the selected
...

You have selected the wrong wheel... try this one https://www.b4x.com/android/forum/threads/wheelview-library.17028/
If you increse the height you'll be able to see many items like in a scrollview, but the selected is always the center item.

If you want an input dialog which disappears after selection - look at Klaus's clswheelhttps://www.b4x.com/android/forum/threads/class-clswheel-input-wheels.24319/clswheel
 
Upvote 0

derez

Expert
Licensed User
Longtime User
I used experience from the wheels classes and modified a little the xcustomlist to make a wheel like Mahares wants.
It is showing the item in the center with larger font and it is cyclic - there is no beginning or end to the list.
User can select only the centerline item, then its font changes to red until another item is selected.
The modification is :
B4X:
Private Sub sv_VScrollChanged (Position As Double)
        'ScrollHandler
    CallSubDelayed2(CallBack, EventName & "_ScrollChanged",Position )
End Sub
Checked only in B4A.
In the attached example each item in the list is a panel with a label. You can define more views to be on the same panel since this is a xCustomList.

list.png
 

Attachments

  • Mahares2.zip
    13.9 KB · Views: 186
Last edited:
Upvote 0
Top