B4A Library SD: ViewExtra

Discussion in 'Additional libraries, classes and official updates' started by Star-Dust, Dec 13, 2017.

  1. Star-Dust

    Star-Dust Expert Licensed User

    This library adds some elements of view.

    SwitchView: Android and IOS
    SD_Spinner: Animated spinner with images
    UpDown: A view that allows you to increase or decrease a number within the set limits
    AlfabeticListView: A ListView that places the items in alphabetical order and a separator for each letter
    SeparatorListView: A ListView that allows you to add separating lines between the components

    For Tree ListView see SD MENU

    SD_ViewExtra


    Author: Star-Dust
    Version: 0.05
    • AlfabetListView
      • Events:
        • ItemClick (Position As Int, Value As Object)
        • ItemLongClick (Position As Int, Value As Object)
      • Functions:
        • Add (Text As String, ReturnValue As Object, Image As Bitmap) As String
        • Add_not_resfresh (Text As String, ReturnValue As Object, Image As Bitmap) As String
          This Metohd Add Item but non refresh. You can Refresh ListView.Invalidate
        • Class_Globals As String
        • Clear As String
        • DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) As String
        • GetBase As Panel
        • getImageView As ImageView
        • getLabel As Label
        • getSize As Int
        • Initialize (vCallback As Object, vEventName As String) As String
        • Invalidate As String
        • IsInitialized As Boolean
          Tests whether the object has been initialized.
        • RemoveAt (index As Int) As String
      • Properties:
        • ImageView As ImageView [read only]
        • Label As Label [read only]
        • Size As Int [read only]
    • SD_Spinner
      • Events:
        • ItemClick (Position As Int, Value As String)
        • LongClick
      • Fields:
        • Animation As Boolean
        • BColor As Int
        • BColorList As Int
        • GrayDisplay As Boolean
        • HintColor As Int
        • Left As Int
        • MyAct As Panel
        • RoundCorner As Boolean
        • SelectedID As String
        • SelectedIndex As Int
        • SelectedItem As String
        • Tag As Object
        • TColor As Int
        • Top As Int
      • Functions:
        • Add (Text As String, TextHelp As String, ID As String, BackgroundColor As Int, TextColor As Int, Gravities As Int, Image As Bitmap) As String
        • AddAll (L As List, TextHelp As String, BackgroundColor As Int, TextColor As Int, Gravities As Int) As String
        • Class_Globals As String
        • Clear As String
        • Close As String
        • Corner (Colore As Int) As ColorDrawable
        • DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) As String
        • GetBase As Panel
        • GetHelpText (Position As Int) As String
        • GetID (Position As Int) As String
        • GetItem (Position As Int) As String
        • GetItemFromID (ID As String) As String
        • Initialize (vCallback As Object, vEventName As String) As String
        • Invalidate As String
        • IsInitialized As Boolean
          Tests whether the object has been initialized.
        • Oper As String
        • RemoveID (ID As String) As String
        • RemoveIndex (Position As Int) As String
        • RoundBorders (B0 As Bitmap, radius As Int) As Bitmap
        • SetBackgroundDrawable (Draw As ColorDrawable) As String
        • SetBackgroundImage (Bitmap As Bitmap) As String
        • SetID (ID As String) As String
        • SetIndex (Position As Int) As String
        • SetLabelTextSize (TextSizeLabel As Int) As String
        • SetValue (Value As String) As String
        • Size As Int
    • SeparatorListView
      • Events:
        • ItemClick (Position As Int, Value As Object)
        • ItemLongClick (Position As Int, Value As Object)
      • Functions:
        • Add (Text As String, Text2 As String, Bitmap As Bitmap, ReturnValue As Object) As String
        • Add_Separate_Line As String
          This Metohd Add Item but non refresh. You can Refresh ListView.Invalidate
        • Class_Globals As String
        • Clear As String
        • DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) As String
        • GetBase As Panel
        • getImageView As ImageView
        • getLabel As Label
        • getSecondLabel As Label
        • getSize As Int
        • Initialize (vCallback As Object, vEventName As String) As String
        • Invalidate As String
        • IsInitialized As Boolean
          Tests whether the object has been initialized.
        • RemoveAt (index As Int) As String
      • Properties:
        • ImageView As ImageView [read only]
        • Label As Label [read only]
        • SecondLabel As Label [read only]
        • Size As Int [read only]
    • SwitchView
      • Events:
        • Click
      • Fields:
        • CircleColor As Int
        • ColorBackground As Int
        • DisableCircleColor As Int
        • DisableColorBackground As Int
        • iosType As Boolean
        • Tag As Object
      • Functions:
        • AddToPanel (View As Panel, Left As Int, top As Int, width As Int, height As Int) As String
        • Class_Globals As String
        • DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) As String
          Don't call on code
        • GetBase As Panel
        • getChecked As Boolean
        • Initialize (vCallback As Object, vEventName As String) As String
        • IsInitialized As Boolean
          Tests whether the object has been initialized.
        • setChecked (Value As Boolean) As String
      • Properties:
        • Checked As Boolean
    • UpDown
      • Events:
        • ChangeValue
      • Fields:
        • MaxValue As Int
        • MinValue As Int
        • StepIncremental As Int
        • Tag As Object
      • Functions:
        • Class_Globals As String
        • Corner (Colore As Int) As ColorDrawable
        • DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) As String
          Don't call on code
        • GetBase As Panel
        • getValue As Int
        • Initialize (Callback As Object, EventName As String) As String
          Initialize Custom View - Used by Designer and by code via AddToParent
          Initialize(Me,"Name")
          #Event: NameClass_ChangeValue
        • IsInitialized As Boolean
          Tests whether the object has been initialized.
        • setValue (NewValue As Int) As String
      • Properties:
        • Value As Int
    test2.gif Screen2.png Screen5.png Screen6.png 1.png AlfabeticListView.png SeparatorListView.png
     

    Attached Files:

    Last edited: Apr 21, 2018
  2. Star-Dust

    Star-Dust Expert Licensed User

    AlfabeticalListVIew Example
    Code:
    Sub Process_Globals
        
    'These global variables will be declared once when the application starts.
        'These variables can be accessed from all modules.
        Dim My_List() As String = Array As String("Zucca","Bar","Birra","Carta","Cintura","Diario","Dado","Fulmine","Asterisco","Elica","Tifone","Danno","Tattica","Cane","Falsario","Estero","Faro","Acqua","Asso")
    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 AlfabetListView1 As AlfabetListView
    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")
        Activity.LoadLayout("main")
      
        AlfabetListView1.GetBase.Visible=
    False
                  
    For i=0 To My_List.Length-1
                    
    If I Mod 2 = 0 Then
                        AlfabetListView1.Add(My_List(i),i,
    LoadBitmap(File.DirAssets,"arrow.png"))
                    
    Else
                        AlfabetListView1.Add(My_List(i),i,
    Null)
                    
    End If
                
    Next
          AlfabetListView1.GetBase.Visible=
    True
        
    End Sub
    AlfabeticListView.png
     
  3. Star-Dust

    Star-Dust Expert Licensed User

    SeparatorListView Example

    Code:
    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 SeparatorListView1 As SeparatorListView
    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")
        Activity.LoadLayout("main")
     
        SeparatorListView1.GetBase.Visible=
    False
     
                SeparatorListView1.Label.Gravity=
    Gravity.LEFT
                SeparatorListView1.SecondLabel.Gravity=
    Gravity.LEFT
                
    For i=1 To 10
                    SeparatorListView1.Add(
    Chr(i+64), "Voce " & i,Null,i)
                    
    If i Mod 3 =0 Then SeparatorListView1.Add_Separate_Line
                
    Next
         SeparatorListView1.GetBase.Visible=
    True
    End Sub
    SeparatorListView.png
     
    Last edited: Feb 7, 2018
  4. Star-Dust

    Star-Dust Expert Licensed User

    Update release 0.04

    remove QuestiontTime Class
     
  5. Star-Dust

    Star-Dust Expert Licensed User

    Update release 0.05

    add event LongClick on Class SD_Spinner
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice