B4A Library CreditCardView

Discussion in 'Additional libraries, classes and official updates' started by jahswani, Jun 23, 2015.

  1. jahswani

    jahswani Active Member Licensed User

    You sometimes ask your users to enter their card information.Sometimes it's boring this is a lib to render the experience more cool.
    Depends On nineoldandroids-2.4.0.jar
    Copy jar and XML to your additional lib folder.
    copy the 3 fonts files in the example to your assets folder.
    Please buy me a beer if you think this lib is awesome.
    • CreditCardView
      • ontoggle
      • ba As BA
      • AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
      • 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)
      • isShowingFront As Boolean

        Return type: @return:
      • setCardValidThru (month As Int, year As Int)

      • setValidThruText (valid As String, thru As String)
      • toggleCardFace
      • Background As Drawable
      • CardCvv As Integer [write only]
      • CardName As String [write only]
      • CardNumber As String [write only]
      • Color As Int [write only]
      • CvvTextInput As EditText [write only]
      • Enabled As Boolean
      • ExpirationTextInput As EditText [write only]
      • Flag As CardFlag [write only]
      • Height As Int
      • InformationText As String [write only]
      • Left As Int
      • MonthYearText As String [write only]
      • NameTextInput As EditText [write only]
      • NumberTextInput As EditText [write only]
      • Tag As Object
      • Top As Int
      • Visible As Boolean
      • Width As Int

    #Region  Project Attributes
    #ApplicationLabel: LibEx
    #VersionCode: 1
    'SupportedOrientations possible values: unspecified, landscape or portrait.
        #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
    #End Region
    #AdditionalRes : ..\res

    #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 etName As EditText
    Private etNumber As EditText
    Private etExpiration As EditText
    Private etCvv As EditText
    Private btnclose As Button
    Private btnturn As Button
    Private card As CreditCardView
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
       card.CardNumber = 
    "3744 4444 4444 4444"
       card.CardName = 
    "Uncle Scrooge"
       card.MonthYearText = 
       card.InformationText = 

        card.ExpirationTextInput = etExpiration
        card.CvvTextInput = etCvv
        card.NumberTextInput = etNumber
        card.NameTextInput = etName
    End Sub

    Sub Activity_Resume

    End Sub

    Sub Activity_Pause (UserClosed As Boolean)

    End Sub

    Sub btnclose_Click
        card.CardNumber = 
        card.CardName = 
        etExpiration.Text = 
        etCvv.Text = 
        etName.Text = 
        etNumber.Text = 
    End Sub
    Sub card_ontoggle
    'TO DO
        ToastMessageShow("I'm in the toggle event",True)
    End Sub
    Sub btnturn_Click
    End Sub

    Attached Files:

  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