Jul 4, 2012 Replies: 180 Hello, Does it need a long explanation ? You can scroll in the two directions. This lib does not work with Android versions < 2. v1.01: I fixed a big bug in the original code. I added the function SmoothScrollTo. v1.02: I restarted from a fresh basis because of the many bugs in the original code. I fixed most of them (now, multitouch events and hardware keys are correctly handled) but a few are left and need more work (sometimes the wrong object get the focus and resizing is not perfectly handled). I noticed by the way that the stock scrollview is bugged and does not set the focus correctly if you move your finger very slowly. Thanks to Erel, I solved the problem with the B4A documentation. I added a new function: FullScroll. v1.03: I fixed all known bugs (including bugs found in ScrollView & HorizontalScrollView); I added the scrollbars; I added three new functions: - ScrollbarsVisibility - FadingEdges - GiveFocusToFirstVisible. v1.1: I fixed a problem with events that were not fired if declared in a class; I added two functions: ScrollingIsFinished and DisableTouchEventInterception. v1.2: SV2D appears now as a custom view in the designer with all its properties. v1.3: I fixed a bug (SV_2 = SV_1 did not work because the inner panel was declared in the wrong class). Enjoy, Fred Attachments ScrollView2D v1.3.zip ScrollView2D v1.3.zip 120.5 KB · Views: 6,841 Java source - ScrollView2D.zip Java source - ScrollView2D.zip 17.6 KB · Views: 2,477 Last edited: Jul 29, 2016 Click to expand...
Hello, Does it need a long explanation ? You can scroll in the two directions. This lib does not work with Android versions < 2. v1.01: I fixed a big bug in the original code. I added the function SmoothScrollTo. v1.02: I restarted from a fresh basis because of the many bugs in the original code. I fixed most of them (now, multitouch events and hardware keys are correctly handled) but a few are left and need more work (sometimes the wrong object get the focus and resizing is not perfectly handled). I noticed by the way that the stock scrollview is bugged and does not set the focus correctly if you move your finger very slowly. Thanks to Erel, I solved the problem with the B4A documentation. I added a new function: FullScroll. v1.03: I fixed all known bugs (including bugs found in ScrollView & HorizontalScrollView); I added the scrollbars; I added three new functions: - ScrollbarsVisibility - FadingEdges - GiveFocusToFirstVisible. v1.1: I fixed a problem with events that were not fired if declared in a class; I added two functions: ScrollingIsFinished and DisableTouchEventInterception. v1.2: SV2D appears now as a custom view in the designer with all its properties. v1.3: I fixed a bug (SV_2 = SV_1 did not work because the inner panel was declared in the wrong class). Enjoy, Fred
Erel B4X founder Staff member Licensed User Longtime User Jul 8, 2012 #21 The latest official libraries are included inside the IDE. So they get updated together with the IDE. Why would you want to automatically update the libraries when you don't want to update the IDE? New versions may depend on the new IDE (and framework). It is also possible for new versions to introduce bugs or breaking changes.
The latest official libraries are included inside the IDE. So they get updated together with the IDE. Why would you want to automatically update the libraries when you don't want to update the IDE? New versions may depend on the new IDE (and framework). It is also possible for new versions to introduce bugs or breaking changes.
mc73 Well-Known Member Licensed User Longtime User Jul 8, 2012 #22 Erel said: The latest official libraries are included inside the IDE. So they get updated together with the IDE. Why would you want to automatically update the libraries when you don't want to update the IDE? New versions may depend on the new IDE (and framework). It is also possible for new versions to introduce bugs or breaking changes. Click to expand... Just interested in the network lib to be honest, but I guess you are right. Till now, everything works great with 1.90, and as I've mentioned already, looking closely to 2.00 issues. Sooner or later, I'll update, after all the class addition is really great
Erel said: The latest official libraries are included inside the IDE. So they get updated together with the IDE. Why would you want to automatically update the libraries when you don't want to update the IDE? New versions may depend on the new IDE (and framework). It is also possible for new versions to introduce bugs or breaking changes. Click to expand... Just interested in the network lib to be honest, but I guess you are right. Till now, everything works great with 1.90, and as I've mentioned already, looking closely to 2.00 issues. Sooner or later, I'll update, after all the class addition is really great
Erel B4X founder Staff member Licensed User Longtime User Jul 8, 2012 #23 This is not really related to this thread. However v2.02 is not less stable than v1.90 or v1.92.
mc73 Well-Known Member Licensed User Longtime User Jul 8, 2012 #24 Erel said: This is not really related to this thread. However v2.02 is not less stable than v1.90 or v1.92. Click to expand... I'll give it a try, I respect your knowledge and experience.
Erel said: This is not really related to this thread. However v2.02 is not less stable than v1.90 or v1.92. Click to expand... I'll give it a try, I respect your knowledge and experience.
Informatix Expert Licensed User Longtime User Jul 8, 2012 #25 Currently, I'm fighting against bugs in this lib. I hope to solve them all during the coming week. It seems that the original author didn't care about hardware keys and what child view get the focus.
Currently, I'm fighting against bugs in this lib. I hope to solve them all during the coming week. It seems that the original author didn't care about hardware keys and what child view get the focus.
Informatix Expert Licensed User Longtime User Jul 9, 2012 #26 Here's a new version (1.02, see post #1). I restarted from a fresh basis because of the many bugs in the original code. I fixed most of them (now, multitouch events and hardware keys are correctly handled) but a few are left and need more work (sometimes the wrong object get the focus and resizing is not perfectly handled). I noticed by the way that the stock scrollview is bugged and does not set the focus correctly if you move your finger very slowly. Thanks to Erel, I solved the problem with the B4A documentation. I added a new function: FullScroll. I need your contribution: - tell me if this new code works better than the previous one (some parts have been rewritten and maybe new bugs have been introduced); - I don't know how I can set the scrollbars visible. "setHorizontalScrollbarEnabled" does not work. I suppose I have to define some attributes (e.g. android:scrollbars = "horizontal|vertical") but I'm a bit lost outside of B4A and pure Java. I'm not familiar with these styles/layouts in XML files and how you call them from your code.
Here's a new version (1.02, see post #1). I restarted from a fresh basis because of the many bugs in the original code. I fixed most of them (now, multitouch events and hardware keys are correctly handled) but a few are left and need more work (sometimes the wrong object get the focus and resizing is not perfectly handled). I noticed by the way that the stock scrollview is bugged and does not set the focus correctly if you move your finger very slowly. Thanks to Erel, I solved the problem with the B4A documentation. I added a new function: FullScroll. I need your contribution: - tell me if this new code works better than the previous one (some parts have been rewritten and maybe new bugs have been introduced); - I don't know how I can set the scrollbars visible. "setHorizontalScrollbarEnabled" does not work. I suppose I have to define some attributes (e.g. android:scrollbars = "horizontal|vertical") but I'm a bit lost outside of B4A and pure Java. I'm not familiar with these styles/layouts in XML files and how you call them from your code.
Informatix Expert Licensed User Longtime User Jul 11, 2012 #27 Here's a new version (v1.03): I fixed all known bugs (including bugs found in ScrollView & HorizontalScrollView); I added the scrollbars; I added three new functions: - ScrollbarsVisibility (sets the scrollbars visibility); - FadingEdges (defines whether the edges should be faded when the view is scrolled) - GiveFocusToFirstVisible (sets the focus to the first focusable view in the visible area of the ScrollView2D panel). I found a big bug in Scrollview and HorizontalScrollview (the focus is not properly handled when the Scrollview panel contains other panels with focusable children), so I submitted a bug report to the Android developpers. I didn't report two other bugs (minor) because I'm not sure for now they will occur on every device, with every Android version (it depends on other classes and how they interact). My library, of course, is free of all these bugs. The example program shows that SV2D works very well as a Scrollview or a HorizontalView. You can replace these views in your app with no harm. The only difference (if you have Gingerbread or a later version): there's no glowing effect when you overscroll (because these functions are not available in API 7). I NEED YOUR REPORT. Please tell me if everything works as expected on your device. Fred
Here's a new version (v1.03): I fixed all known bugs (including bugs found in ScrollView & HorizontalScrollView); I added the scrollbars; I added three new functions: - ScrollbarsVisibility (sets the scrollbars visibility); - FadingEdges (defines whether the edges should be faded when the view is scrolled) - GiveFocusToFirstVisible (sets the focus to the first focusable view in the visible area of the ScrollView2D panel). I found a big bug in Scrollview and HorizontalScrollview (the focus is not properly handled when the Scrollview panel contains other panels with focusable children), so I submitted a bug report to the Android developpers. I didn't report two other bugs (minor) because I'm not sure for now they will occur on every device, with every Android version (it depends on other classes and how they interact). My library, of course, is free of all these bugs. The example program shows that SV2D works very well as a Scrollview or a HorizontalView. You can replace these views in your app with no harm. The only difference (if you have Gingerbread or a later version): there's no glowing effect when you overscroll (because these functions are not available in API 7). I NEED YOUR REPORT. Please tell me if everything works as expected on your device. Fred
U ukimiku Active Member Licensed User Longtime User Jul 12, 2012 #28 Thank you for the library. It works on XPERIA S under Android 2.3.7. Is there a way to fix the first column and scroll horizontally only the remaining columns? Thank you. Regards,
Thank you for the library. It works on XPERIA S under Android 2.3.7. Is there a way to fix the first column and scroll horizontally only the remaining columns? Thank you. Regards,
R Roger Garstang Well-Known Member Licensed User Longtime User Jul 12, 2012 #29 So, is there a standard view within Android that does this, or is this just combining a Horz and a Vert Scrollview together and handling all the events and sizes?
So, is there a standard view within Android that does this, or is this just combining a Horz and a Vert Scrollview together and handling all the events and sizes?
Informatix Expert Licensed User Longtime User Jul 12, 2012 #30 ukimiku said: Thank you for the library. It works on XPERIA S under Android 2.3.7. Click to expand... Fine. ukimiku said: Is there a way to fix the first column and scroll horizontally only the remaining columns? Click to expand... This view is just a scrolling container, nothing more. What you put inside it and how these children views work or interact with your app depends on you. Fixing a column is not very complicated. Put the whole column in a panel separated from the other columns and move this panel with each scroll change (more precisely, your code goes in the ScrollChanged event and adjust the left property of the "fixed column" panel).
ukimiku said: Thank you for the library. It works on XPERIA S under Android 2.3.7. Click to expand... Fine. ukimiku said: Is there a way to fix the first column and scroll horizontally only the remaining columns? Click to expand... This view is just a scrolling container, nothing more. What you put inside it and how these children views work or interact with your app depends on you. Fixing a column is not very complicated. Put the whole column in a panel separated from the other columns and move this panel with each scroll change (more precisely, your code goes in the ScrollChanged event and adjust the left property of the "fixed column" panel).
Informatix Expert Licensed User Longtime User Jul 12, 2012 #31 Roger Garstang said: So, is there a standard view within Android that does this, or is this just combining a Horz and a Vert Scrollview together and handling all the events and sizes? Click to expand... Basically, it's a merge between a HorzSv and a VertSv, but since these views have their own logic, you have to change a lot of things to make that work nicely (sometimes, the view must act as a VertSv, sometimes as a HorzSv, and sometimes in a new manner with the two directions taken in account). I had to fix a few bugs too. In the latest API (Jelly Bean), they removed almost all the code setting the focus to a child. I don't know why (too many bugs?). I fixed the code to make it work as stated in the source code comments. That explains why it took me quite a full time week to do the library. I need to know, now, if that works as expected on your device.
Roger Garstang said: So, is there a standard view within Android that does this, or is this just combining a Horz and a Vert Scrollview together and handling all the events and sizes? Click to expand... Basically, it's a merge between a HorzSv and a VertSv, but since these views have their own logic, you have to change a lot of things to make that work nicely (sometimes, the view must act as a VertSv, sometimes as a HorzSv, and sometimes in a new manner with the two directions taken in account). I had to fix a few bugs too. In the latest API (Jelly Bean), they removed almost all the code setting the focus to a child. I don't know why (too many bugs?). I fixed the code to make it work as stated in the source code comments. That explains why it took me quite a full time week to do the library. I need to know, now, if that works as expected on your device.
klaus Expert Licensed User Longtime User Jul 12, 2012 #32 Works fine on my Nexus One. I have added a ScrollView2D in the Table Class. Best regards.
O OlegVic New Member Licensed User Longtime User Jul 31, 2012 #33 mainSlider.Initialize(Activity.Width, Activity.Hight*2,"mainSlider") how i can increase invisible hight? (Ex.:Activity.Hight*3) Whithout changing visible hight. mainSlider.hight = Activity.Hight*3 - dont work. changing visible area. RESOLVED: NEED TO USE mainSlider.PANEL.hight = Activity.Hight*3 Last edited: Jul 31, 2012
mainSlider.Initialize(Activity.Width, Activity.Hight*2,"mainSlider") how i can increase invisible hight? (Ex.:Activity.Hight*3) Whithout changing visible hight. mainSlider.hight = Activity.Hight*3 - dont work. changing visible area. RESOLVED: NEED TO USE mainSlider.PANEL.hight = Activity.Hight*3
Informatix Expert Licensed User Longtime User Jul 31, 2012 #34 OlegVic said: mainSlider.Initialize(Activity.Width, Activity.Hight*2,"mainSlider") how i can increase invisible hight? (Ex.:Activity.Hight*3) Whithout changing visible hight. mainSlider.hight = Activity.Hight*3 - dont work. changing visible area. Click to expand... The width and height properties define the visible size of your ScrollView. If you want to change the dimensions of the inner panel, you must use the following properties: mainSlider.Panel.Height mainSlider.Panel.Width
OlegVic said: mainSlider.Initialize(Activity.Width, Activity.Hight*2,"mainSlider") how i can increase invisible hight? (Ex.:Activity.Hight*3) Whithout changing visible hight. mainSlider.hight = Activity.Hight*3 - dont work. changing visible area. Click to expand... The width and height properties define the visible size of your ScrollView. If you want to change the dimensions of the inner panel, you must use the following properties: mainSlider.Panel.Height mainSlider.Panel.Width
rbw152 Member Licensed User Longtime User Aug 9, 2012 #35 ScrollView2D library documentation! Hi guys can someone please post a link to the scrollview2d documentation? I can see from this thread that there is some available as Informatix says he created some with Erel but where is it? Thanks!
ScrollView2D library documentation! Hi guys can someone please post a link to the scrollview2d documentation? I can see from this thread that there is some available as Informatix says he created some with Erel but where is it? Thanks!
Informatix Expert Licensed User Longtime User Aug 17, 2012 #36 rbw152 said: Hi guys can someone please post a link to the scrollview2d documentation? I can see from this thread that there is some available as Informatix says he created some with Erel but where is it? Thanks! Click to expand... ScrollView2D has only five specific functions. The other functions are common to all views. The specific functions are described in the short text help appearing in B4A when you start to type them (autocompletion).
rbw152 said: Hi guys can someone please post a link to the scrollview2d documentation? I can see from this thread that there is some available as Informatix says he created some with Erel but where is it? Thanks! Click to expand... ScrollView2D has only five specific functions. The other functions are common to all views. The specific functions are described in the short text help appearing in B4A when you start to type them (autocompletion).
J johnaaronrose Active Member Licensed User Longtime User Aug 20, 2012 #37 I have a photo (in a Bitmap Global variable) that I want to be able to scroll both horizontally & vertically in a space on the screen (as I don't want to use the whole screen) for which I specify the Left, Width, Top & Height. The Initialize method allows me to set the Width & Height. When I try to specify the Left & Top, I get a Java Language Null Pointer Exception. Is there any way that I can define the Left & Top where the photo will be displayed?
I have a photo (in a Bitmap Global variable) that I want to be able to scroll both horizontally & vertically in a space on the screen (as I don't want to use the whole screen) for which I specify the Left, Width, Top & Height. The Initialize method allows me to set the Width & Height. When I try to specify the Left & Top, I get a Java Language Null Pointer Exception. Is there any way that I can define the Left & Top where the photo will be displayed?
klaus Expert Licensed User Longtime User Aug 20, 2012 #38 You can define the ScrollView properties Left, Top, Width and Height defining the area on the screen. Then with HorizontalPosition and VerticalPosition you can set the image position or with the ScrollChanged event you get the current postion of the image. Best regards.
You can define the ScrollView properties Left, Top, Width and Height defining the area on the screen. Then with HorizontalPosition and VerticalPosition you can set the image position or with the ScrollChanged event you get the current postion of the image. Best regards.
J johnaaronrose Active Member Licensed User Longtime User Aug 21, 2012 #39 klaus said: You can define the ScrollView properties Left, Top, Width and Height defining the area on the screen. Then with HorizontalPosition and VerticalPosition you can set the image position or with the ScrollChanged event you get the current postion of the image. Best regards. Click to expand... The SV2DPhoto ScrollView2D view only occupies part of the screen (i.e. other views are present on most of the screen) & is NOT at the top left corner. I'm using the code below: Code: SV2DPhoto.Initialize(ImageViewPhoto.Width, ImageViewPhoto.Height, "") SV2DPhoto.Left = ImageViewPhoto.Left SV2DPhoto.Top = ImageViewPhoto.Top SV2DPhoto.HorizontalScrollPosition = ImageViewPhoto.Left/2 SV2DPhoto.VerticalScrollPosition = ImageViewPhoto.Top/2 Log("SV2DPhotoWidth="&SV2DPhoto.Width) Log("SV2DPhotoHeight="&SV2DPhoto.Height) The app compiles but at run time I get a java.lang.NullPointerException on the SV2DPhoto.Left statement.
klaus said: You can define the ScrollView properties Left, Top, Width and Height defining the area on the screen. Then with HorizontalPosition and VerticalPosition you can set the image position or with the ScrollChanged event you get the current postion of the image. Best regards. Click to expand... The SV2DPhoto ScrollView2D view only occupies part of the screen (i.e. other views are present on most of the screen) & is NOT at the top left corner. I'm using the code below: Code: SV2DPhoto.Initialize(ImageViewPhoto.Width, ImageViewPhoto.Height, "") SV2DPhoto.Left = ImageViewPhoto.Left SV2DPhoto.Top = ImageViewPhoto.Top SV2DPhoto.HorizontalScrollPosition = ImageViewPhoto.Left/2 SV2DPhoto.VerticalScrollPosition = ImageViewPhoto.Top/2 Log("SV2DPhotoWidth="&SV2DPhoto.Width) Log("SV2DPhotoHeight="&SV2DPhoto.Height) The app compiles but at run time I get a java.lang.NullPointerException on the SV2DPhoto.Left statement.
Informatix Expert Licensed User Longtime User Aug 21, 2012 #40 johnaaronrose said: The SV2DPhoto ScrollView2D view only occupies part of the screen (i.e. other views are present on most of the screen) & is NOT at the top left corner. I'm using the code below: Code: SV2DPhoto.Initialize(ImageViewPhoto.Width, ImageViewPhoto.Height, "") SV2DPhoto.Left = ImageViewPhoto.Left SV2DPhoto.Top = ImageViewPhoto.Top SV2DPhoto.HorizontalScrollPosition = ImageViewPhoto.Left/2 SV2DPhoto.VerticalScrollPosition = ImageViewPhoto.Top/2 Log("SV2DPhotoWidth="&SV2DPhoto.Width) Log("SV2DPhotoHeight="&SV2DPhoto.Height) The app compiles but at run time I get a java.lang.NullPointerException on the SV2DPhoto.Left statement. Click to expand... I'm sorry but I don't understand at all what you're trying to do. Upload the full code because this part of the code has no sense to me. I wonder if you don't make a confusion between moving an image on screen and scrolling it (meaning you see it through a window and scrolls it inside this window). If you want to move an image, look at TouchImageView.
johnaaronrose said: The SV2DPhoto ScrollView2D view only occupies part of the screen (i.e. other views are present on most of the screen) & is NOT at the top left corner. I'm using the code below: Code: SV2DPhoto.Initialize(ImageViewPhoto.Width, ImageViewPhoto.Height, "") SV2DPhoto.Left = ImageViewPhoto.Left SV2DPhoto.Top = ImageViewPhoto.Top SV2DPhoto.HorizontalScrollPosition = ImageViewPhoto.Left/2 SV2DPhoto.VerticalScrollPosition = ImageViewPhoto.Top/2 Log("SV2DPhotoWidth="&SV2DPhoto.Width) Log("SV2DPhotoHeight="&SV2DPhoto.Height) The app compiles but at run time I get a java.lang.NullPointerException on the SV2DPhoto.Left statement. Click to expand... I'm sorry but I don't understand at all what you're trying to do. Upload the full code because this part of the code has no sense to me. I wonder if you don't make a confusion between moving an image on screen and scrolling it (meaning you see it through a window and scrolls it inside this window). If you want to move an image, look at TouchImageView.