The attached project wraps this Github project. The library files are in the /files folder of the B4A project. Copy them to your additional library folder. You will also need to download the images that are used in the B4A project from here (they are too big to zip along with the B4A project). Copy them into the /files folder of the B4A project once you have downloaded and unzipped it.
The pic on the right is set to "auto unveil". The pic on the left is set to "manual unveil". Drag your finger from top right to bottom left or bottom left to top right to unveil more/less of the background image of the pic on the left.
Also posting the Java source code.
splitimageview
Author: Johan Schoeman
Version: 1
The pic on the right is set to "auto unveil". The pic on the left is set to "manual unveil". Drag your finger from top right to bottom left or bottom left to top right to unveil more/less of the background image of the pic on the left.
Also posting the Java source code.
splitimageview
Author: Johan Schoeman
Version: 1
- SplitImageView
Fields:- ba As BA
- BringToFront
- DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
- Initialize (EventName As String)
- Invalidate
- Invalidate2 (arg0 As Rect)
- Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- IsInitialized As Boolean
- RemoveView
- RequestFocus As Boolean
- SendToBack
- SetBackgroundImage (arg0 As Bitmap)
- SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
- SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
- SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
- clearColorFilter
- isEnableAutomaticAnimation As Boolean
- AutomaticAnimationDuration As Int
Set the duration of the automatic animation.
If the automatic animation has already started this wont take effect.
Call this before calling setEnableAutomaticAnimation - Background As Drawable
- BackgroundImageBitmap As Bitmap [write only]
Sets a Bitmap as the background content of this SplitImageView. - BackgroundImageDrawable As Drawable [write only]
Sets a Bitmap as the background content of this SplitImageView. - Color As Int [write only]
- ColorFilter As Int [write only]
- EnableAutomaticAnimation As Boolean [write only]
Will enable automatic animation. For this to work the foreground drawable and background
drawable will have to be set. Also when enabled touch unveil will not work. - Enabled As Boolean
- ForegroundImageBitmap As Bitmap [write only]
Sets a Bitmap as the foreground content of this SplitImageView. - ForegroundImageDrawable As Drawable [write only]
Sets a Bitmap as the foreground content of this SplitImageView. - Height As Int
- ImageAlpha As Int
Returns the alpha that will be applied to the drawables of this SplitImageView. - Left As Int
- SplitPercent As Int [write only]
This method will set the percentage of split that is applied to the Images.
Lesser the value more the amount that is reveled.
By default this is 50%. - Tag As Object
- Top As Int
- UnveilOnTouch As Boolean [write only]
Enables the touch to unveil feature - Visible As Boolean
- Width As Int