B4A Library DriveImageView

It wraps this Github project. Posting the following:
1. B4A project demonstrating the library
2. B4A library files (2x Jar and 1 x XML) - copy them to your additional library folder
3. The Java code

Note: there is a file called placeholder.pnd in the B4A project's /Objects/res/drawable folder. It needs to be there is you start a new project (it needs to be set to read-only)

It seems to work best with images that are just about 100% square.

1.png



....or pass a color such as for eg "#66FF0000" to make the colors transparent

2.png



Sample code:

B4X:
#Region  Project Attributes
    #ApplicationLabel: b4aDriveImageView
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: landscape
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private div1, div2 As DriveImageView

End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")


    Dim bm As Bitmap
    bm.Initialize(File.dirassets,"pluto.jpg")
    div1.ImageBitmap = bm

    div1.AnimateTextDuration = 5000
'   div1.animateText                                        'same as above but has a default value of 3000ms assiged to it
    div1.FolderCorner = 20                                  'the height for the folder corner on the right
    div1.BackgroundColor = "#FFAA44"                        'red
    div1.CustomFolderSpacing = 100                          'make the folder size bigger smaller in x direction
    div1.CustomHeight = 35                                  'the height of the overlay
    div1.FolderText = "Photo 1 of 2"                        'text for the folder
    div1.MainText = "Pluto"                                'main text

    div1.DivideColor = "#FFFFFF"                            'white
    div1.TextColor = "#FFFFFF"                              'black

    bm.Initialize(File.DirAssets,"stitch.jpg")
    div2.ImageBitmap = bm

    div2.AnimateTextDuration = 5000
'   div2.animateText                                        'same as above but has a default value of 3000ms assiged to it
    div2.FolderCorner = 15                                  'the height for the folder corner on the right
    div2.BackgroundColor = "#c8c8c8"                        'red
    div2.CustomFolderSpacing = 100                          'make the folder size bigger smaller in x direction
    div2.CustomHeight = 35                                  'the height of the overlay
    div2.FolderText = "Photo 2 of 2"                        'text for the folder
    div2.MainText = "Stitch"                                'main text
    div2.ImageScaleType = div2.ScaleTypeCentreCrop

    div2.DivideColor = "#00FFFF"                            'white
    div2.TextColor = "#FF00FF"                              'black


End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

The library:

DriveImageView
Author:
Github: Yannick Signer, Wrapped by: Johan Schoeman
Version: 1
  • DriveImageView
    Fields:
    • ScaleTypeCentre As String
    • ScaleTypeCentreCrop As String
    • ScaleTypeCentreInside As String
    • ScaleTypeFitCentre As String
    • ScaleTypeFitEnd As String
    • ScaleTypeFitStart As String
    • ScaleTypeFitXY As String
    • ScaleTypeMatrix As String
    • ba As BA
    Methods:
    • 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)
    • animateText
      This animates the text with a duration of 3 seconds.
    Properties:
    • AnimateTextDuration As Int [write only]
      This a animates a "blend-in" animation of the figure. The duration can be customised.
    • Background As Drawable
    • BackgroundColor As String [write only]
      Sets the background-color of the main figure on the canvas.
    • Color As Int [write only]
    • CustomFolderSpacing As Float [write only]
      Sets the spacing between the left border of the DriveImageView and the crack before the folder-text.
    • CustomHeight As Float [write only]
      Sets the custom height of the whole figure. This recalculates the text-sizes inside the Canvas.
    • DivideColor As String [write only]
      Sets the background-color of the divider figure.
    • Enabled As Boolean
    • FolderCorner As Float [write only]
      Sets the height and width of the folder corner.
    • FolderText As String [write only]
      Sets the folder text
    • Height As Int
    • ImageBitmap As Bitmap [write only]
      Sets the image bimap
    • ImageScaleType As String [write only]
      Sets the image scale type
    • Left As Int
    • MainText As String [write only]
      Sets the main text
    • Tag As Object
    • TextColor As String [write only]
      Sets the text-color of both text's (main-text and folder-text)
    • Top As Int
    • Visible As Boolean
    • Width As Int
 

Attachments

  • b4aDriveImageView.zip
    86 KB · Views: 317
  • DriveImageViewLibFiles.zip
    26.3 KB · Views: 305
  • TheJavaCode.zip
    38.9 KB · Views: 281
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
The link is offensive and should be removed from the forum. Please remove it from this thread and post your own thread. No place on this forum for what is presented in the link you posted. And totally irrelevant to the lib posted. I have reported your post to the moderator of this forum and asked for it to be removed.
 
Last edited:

fernando1987

Active Member
Licensed User
Hello, I didn't write that post. The truth is, I just found out from a notice sent to my email. I think someone accessed my account, although it wasn't me. Please excuse me. I don't understand the content well. My native language is Spanish, not English. I'm worried that someone has access to my account...
 

LucaMs

Expert
Licensed User
Longtime User
Hello, I didn't write that post. The truth is, I just found out from a notice sent to my email. I think someone accessed my account, although it wasn't me. Please excuse me. I don't understand the content well. My native language is Spanish, not English. I'm worried that someone has access to my account...
I believe him, he has been a member for years and has always written "regular" posts.

[Although for a moment I thought he had abused... alcohol 😄 ]
 

fernando1987

Active Member
Licensed User
I believe him, he has been a member for years and has always written "regular" posts.

[Although for a moment I thought he had abused... alcohol 😄 ]
no, not at all jjjjj now someone knows if changing the password will be enough, I'm worried about the security of my account
 

josejad

Expert
Licensed User
Longtime User
Not the only post with this problem today. Erel suggested to turn the 2FA auth on not long ago when we had other SPAM cases
 

TILogistic

Expert
Licensed User
Longtime User
Yes, I saw that post this morning.
and I really thought it was NOT you who posted it, some Bot is capturing the passwords when you log in, you just have to be careful and change the passwords periodically.

Note:
I thought: this is another joke from the LucaMS student.

sorry, it's a joke LucaMS

@oparra

🤣🤣🤣🤣
 
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
Hello, I didn't write that post. The truth is, I just found out from a notice sent to my email. I think someone accessed my account, although it wasn't me. Please excuse me. I don't understand the content well. My native language is Spanish, not English. I'm worried that someone has access to my account...
If it was not you then I am sorry about my response. Just thought the content to that link is inappropriate.
 
Top