First ever attempt at slotting in views routine - Updated to V1.3a with scroller

Peter Simpson

Expert
Licensed User
Longtime User
Hello all,
After reading Ilans post a couple of days ago, I've been thinking about if I could create something a bit like what Ilan was doing.

The video shows V1.3a the beta version, I will update it to V2 which will be whenever I get some spare time, I will hopefully be placing the views within a scroll view. I have a strange feeling that this placing views within a scroll view and re-positioning them will not work too well, so I'll most probably scrap the whole project and recreate it to work with xCustomListView as currently It's based on standard views.

The code took me about three and a half hours to create and to optimise from start to finish which I'm really happy with. I'm a business app creator and I don't have any need for anything like this in any of my clients apps, so for me I'm stepping outside of my comfort zone a little here.

I decided to try my hand at this simply because both Ilan and Star-Dust motivated me to give it a go after reading Ilans post (just reading his post motivated me). Whilst watching movies and just doing basic house chores yesterday, Ideas on how to create this kept popping into my head, so this morning I gave it a go and here are my results to date.

V1.0 - Original release.
V1.1 - Re-optimised the vertical movement routine to remove an annoying bug.
V1.2 - Removed unwanted code and finally updated swipe gesture.
V1.3 - Added animation for smoothly placing the moving views back in between two items. Also removed the placement memory declaration as that was not actually needed.
V1.3a - Added scrolling (I didn't change the version number).

Please note:
I'm trying to update this little project of mine, but with clients bespoke Windows programs to develop, sadly this is playing second fiddle as I get 10 minutes or so spare.

Btn = 12
Btn = 4
Btn = 0
Btn = 6
Btn = 5
Btn = 1
Btn = 7
Btn = 2
Btn = 8
Btn = 10
Btn = 13
Btn = 9
Btn = 3
Btn = 11
(ArrayList) [Btn12, Btn4, Btn0, Btn6, Btn5, Btn1, Btn7, Btn2, Btn8, Btn10, Btn13, Btn9, Btn3, Btn11]

Slotting in views now with a full view scrolling routine V1.3a.

Enjoy...
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
Very cool stuff!
 

BillMeyer

Well-Known Member
Licensed User
Longtime User
I'm Enjoying...
 

Peter Simpson

Expert
Licensed User
Longtime User
Thanks @Cableguy and @BillMeyer,
I think that I'm going to have to recreate it using xCustomListView. For the last 20 minutes I've been trying to get it working in a scroll view, but I can't. 20 minutes isn't long I know that, but when I first created the post above, I did say that I thought I might have problems integrating it and I did.

Once I've sent my client the beta version of their new Windows software, I'll be taking a couple of days off. I'll recreate this project using xCLV and I'll see if it makes things any easier for me :(

No wonder I don't create this sort of stuff more often, it's too time consuming ;)...
 

Harris

Expert
Licensed User
Longtime User
I'll recreate this project using xCLV and I'll see if it makes things any easier for me :(
I am sure you shall find it will... It is very powerful - all in a class you can extend to meet your needs - as I have done. 99.9 percent is already there. I shall not write apps going forward without using xCLV for 95 percent of it. It just makes sense and reduces complexity by 95 percent....
Did that make sense?
 
Last edited:

Peter Simpson

Expert
Licensed User
Longtime User
Updated the video again, this time with a full view scrolling routine :eek:

I am sure you shall find it will... It is very powerful - all in a class you can extend to meet your needs - as I have done. 99.9 percent is already there. I shall not write apps going forward without using xCLV for 95 percent of it. It just makes sense and reduces complexity by 95 percent....
Did that make sense?

'reduces complexity' I disagree 100%, you can create a simple list in just 2 minutes with with a ListView ;)

I use xCLV for all my tables and lists in my apps these days, especially as I use lazy loading for lots of data. Actually, I've modified the original lazy loading code (I need to tidy up my messy modified lazy loading code). I pre-load the TYPE x amount at a times instead of fully populating the TYPE like in Erels example. Why you may ask, well I have customers that use one of my standard Windows invoicing and stock control solutions, that solution allows customers to add an item image for each item of stock. The database is MySQL so I created a companion app that links to my customers online MySQL databases. Some of my customers have thousands of stock items and images for each item, images are around 50k+ each in size, some are around 150k. So I modified Erels lazy loading routine (with my messy code that really does needs tiding up) to pre-loads the TYPE with x amount the data at a time, then the next batch when needed. That way it saves pre-loading thousands of images or rows of data (with image data for ImageViews) into the TYPE first. It actually works quite well, but I've only used my modified code for pre-loadin xCLV with images, every other xCLV that I use uses Erel's excellent code. I basically use the same lazy loading method in my VB.Net source code for lazy loading large lists of data into DataGridViews for my Windows programs.

So yes I do use xCLV, but for really simple lists I use ListView. For beautiful looking list, or lists of data mixed with images or interactive lists with buttons, spinners or edittext I always use xCLV :D

Believe it or not I did actually create a version with xCLV and I got 2 issues.
  1. The selected view wouldn't show on top (BringToFront) of the other views, I'll look into itimore closely at some other time.
  2. Same exact issue with scrolling, and no I'm not adding a ScrollView, xCLV does that for you. The very second the view starts to scroll it freezes with the ScrollView. It looks like the scrollview is having an issue with the library I'm using whilst trying to move the view and scrolling the scroll view.
Anyway I've quickly updated the video with my current progress using my original code. The scrolling list does in fact scroll a lot more smoothly, but I was experimenting with another idea at the time of recording which does not scroll as smoothly. Anyway you can see the current results. When I get the time, I'll get back to this mini project of mine then I'll go back to xCLV and I'll give that another to.

It's now time to get back to doing some paid work.
I'll get back to this little side project of mine in a few of days time. I'll look into xCLV again to see why I'm getting scrolling interactive issues with my views.

As I said previously, this is not the sort of thing I usually do using B4A, so this is a steep learning curve for me, I just thought that I should show my progress as I go along. I've not really spent that much time creating this considering that I'm learning new things at the exact same time.

Enjoy...
 
Last edited:
Top