luciano deri Active Member Licensed User Longtime User Jan 8, 2015 #1 Code: Copy Sub PScreen_Touch (Action As Int, x As Float, y As Float) Select Action Case Activity.ACTION_DOWN startscroll = True Case Activity.ACTION_UP 'only when make clik startscroll = false Case 3 'start scroll ? ..... End Select End Sub Hello everybody. I use HorizontalScroolView for show some page my program, i would like center the page on the screen every times that the user scroll over 50%x, but i dont' know how intercept event when scroll finish. Thanks. I thinked test the action panel_touch of panel on HorizontalScroolView, but haven't a end_scroll action. Last edited: Jan 8, 2015
Code: Copy Sub PScreen_Touch (Action As Int, x As Float, y As Float) Select Action Case Activity.ACTION_DOWN startscroll = True Case Activity.ACTION_UP 'only when make clik startscroll = false Case 3 'start scroll ? ..... End Select End Sub Hello everybody. I use HorizontalScroolView for show some page my program, i would like center the page on the screen every times that the user scroll over 50%x, but i dont' know how intercept event when scroll finish. Thanks. I thinked test the action panel_touch of panel on HorizontalScroolView, but haven't a end_scroll action.
Erel B4X founder Staff member Licensed User Longtime User Jan 9, 2015 #2 You should handle the ScrollChanged event. Upvote 0
luciano deri Active Member Licensed User Longtime User Jan 9, 2015 #3 This event is active every move on scroll, i need intercept when this move is finished and correct the position for centered the panel on screen. Last edited: Jan 12, 2015 Upvote 0
This event is active every move on scroll, i need intercept when this move is finished and correct the position for centered the panel on screen.
Erel B4X founder Staff member Licensed User Longtime User Jan 11, 2015 #4 You can use a timer to find when the scroll finishes. Disable and enable a timer inside the event. Upvote 0
klaus Expert Licensed User Longtime User Jan 11, 2015 #5 You could try the attached project. It does what you want. It is based on Erels suggestion. I have added the Touch event for the HorizontalScrollView, there I : - calculate the approximate time needed to finish the scrolling - enable a timer with the calculated time In the Timer_Tick routine I check the ScrollPosition and according to its value set the final position. I use this method in the ClsWheels Class. Attachments HScrollPages.zip HScrollPages.zip 7.6 KB · Views: 1,307 Last edited: Mar 5, 2019 Upvote 0
You could try the attached project. It does what you want. It is based on Erels suggestion. I have added the Touch event for the HorizontalScrollView, there I : - calculate the approximate time needed to finish the scrolling - enable a timer with the calculated time In the Timer_Tick routine I check the ScrollPosition and according to its value set the final position. I use this method in the ClsWheels Class.
L Luiz Fernando Orlandini Active Member Licensed User Longtime User Feb 25, 2015 #7 klaus said: You could try the attached project. It does what you want. It is based on Erels suggestion. I have added the Touch event for the HorizontalScrollView, there I : - calculate the approximate time needed to finish the scrolling - enable a timer with the calculate time In the Timer_Tick routine I check the ScrollPosition and according to its value set the final position. I use this method in the ClsWheels Class. Click to expand... Cool I need something like that, but for B4i. What can I use instead of Reflector? Upvote 0
klaus said: You could try the attached project. It does what you want. It is based on Erels suggestion. I have added the Touch event for the HorizontalScrollView, there I : - calculate the approximate time needed to finish the scrolling - enable a timer with the calculate time In the Timer_Tick routine I check the ScrollPosition and according to its value set the final position. I use this method in the ClsWheels Class. Click to expand... Cool I need something like that, but for B4i. What can I use instead of Reflector?
Erel B4X founder Staff member Licensed User Longtime User Feb 25, 2015 #8 It is possible to implement a similar solution with the ScrollChanged event and a timer (start a new thread in B4i forum if you need more assistance). Upvote 0
It is possible to implement a similar solution with the ScrollChanged event and a timer (start a new thread in B4i forum if you need more assistance).
klaus Expert Licensed User Longtime User Feb 25, 2015 #9 Luiz Fernando Orlandini said: Cool I need something like that, but for B4i. Click to expand... As a first step set the ScrollView.PagingEnabled property to True. Upvote 0
Luiz Fernando Orlandini said: Cool I need something like that, but for B4i. Click to expand... As a first step set the ScrollView.PagingEnabled property to True.
L Luiz Fernando Orlandini Active Member Licensed User Longtime User Feb 25, 2015 #10 Erel said: It is possible to implement a similar solution with the ScrollChanged event and a timer (start a new thread in B4i forum if you need more assistance). Click to expand... Yes Erel. I need some help. Upvote 0
Erel said: It is possible to implement a similar solution with the ScrollChanged event and a timer (start a new thread in B4i forum if you need more assistance). Click to expand... Yes Erel. I need some help.