B4A Library FiftyShadesOf

https://github.com/florent37/FiftyShadesOf

An elegant context-care loading placeholder for Android

fifty.gif


@DependsOn(values={"android-support-v4"})

FiftyShadesOf
Author:
SMM
Version: 0.01
  • FiftyShadesOf
    Methods:
    • Initialize
    • IsInitialized As Boolean
    • Start
    • Stop
    • except (views() As ViewWrapper) As Fiftyshadeswrapper
    • on (views() As ViewWrapper) As Fiftyshadeswrapper
      Apply FiftyShadesOf on an array of views
    • on2 (viewGroup As ViewGroup) As Fiftyshadeswrapper
      Apply FiftyShadesOf on a ViewGroup




Sample

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim fs As FiftyShadesOf
    Dim call As CallSubUtils
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.
    Dim text As Label
    Dim img As ImageView
   
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("Layout1")
   
    text.Initialize("txt")
    img.Initialize("img")
   
    Activity.AddView(img,0,0,50dip,30dip)
    Activity.AddView(text,60dip,0,100%x-60dip,30dip)
   
   
    fs.Initialize
    fs.on2( Activity).except(Array As View(img)).Start
'    fs.on( Array As View ( img,text)).Start
   
    call.Initialize
    call.CallSubPlus(Me,"data_ready",3000)
End Sub
Sub data_ready
   
    img.Bitmap=LoadBitmap(File.DirAssets,"ba.png")
    text.Text="Data loaded successfully."
    fs.Stop
End Sub
 

Attachments

  • FiftyShadesOf.zip
    10.9 KB · Views: 335
Top