B4A Library FreshDownloadView

https://github.com/dudu90/FreshDownloadView

A download progressbar with cool animation


output_mx3I5c.gif


FreshDownloadView
Author:
SMM
Version: 0.01
  • FreshDownloadView
    Events:
    • _click
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • 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)
    • reset
    • showDownloadError
    • showDownloadOk
      showDownLoadOK
    • startDownload
    • upDateProgress (progress As Float)
    • upDateProgress2 (progress As Int)
    • using As Boolean
      get Use Status
      Return type: @return:if use by some task.
    Properties:
    • Background As Drawable
    • CircularColor As Int
    • CircularWidth As Float
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Parent As Object [read only]
    • ProgressColor As Int
    • ProgressTextSize As Float
    • Radius As Float
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int

note : My eyes believe that arrow is not centered correctly I think we need to find the correct dips I think 200dip is the best so far :)



Sample

B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
    #AdditionalRes: ..\fdres
#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.
    Dim time As Timer
  
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 fd As FreshDownloadView
    Dim progress As Float
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")
    time.Initialize("time",2000)
    time.Enabled=True
    fd.Initialize("fd")
    Activity.AddView(fd,0,0,200dip,200dip)
    fd.startDownload
  
End Sub
Sub time_tick
    If progress<1 Then
        progress=progress+0.1
    fd.upDateProgress(progress)
    End If
  
End Sub
Sub fd_click
    fd.showDownloadError
End Sub
 

Attachments

  • FreshDownloadView.zip
    24.4 KB · Views: 287
  • fdres.zip
    902 bytes · Views: 297
Top