Android Question Exmple Using RecyclerView Lib

Discussion in 'Android Questions' started by syerif, Jun 29, 2019.

  1. syerif

    syerif Member Licensed User

    Hi, Everyone

    can anyone provide a sample code program using the RecyclerView library (not amir-RecyclerView)
  2. DonManfred

    DonManfred Expert Licensed User

    What is RecyclerView Library? I only know the amir one.
  3. syerif

    syerif Member Licensed User

    I got it in another forum, I assume that the library is from this forum.

    after I tried it I finally found this

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

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

    #AdditionalRes : ..\res
    #BridgeLogger: True

    Sub Process_Globals
    End Sub

    Sub Globals
    Dim re As RecyclerView
    Dim jo As JavaObject
    Private img As ImageView
    Private lbl As Label
    Private btn As Button
    Dim lbl2 As Label
    Dim img2 As ImageView
    Dim btn2 As Button
    Dim Items As List
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
    Activity.Color = Colors.White
    Array As String("Item1","2222","Sevom","Ch","55","66666","7777","8888","LastItem"))
    're.SpanCount = 2
    End Sub

    Sub Activity_Resume
    End Sub

    Sub Activity_Pause (UserClosed As Boolean)
    End Sub

    Sub Recycler_onCreateItem(V As Object, Position As Int)
    Dim p As Panel = V
    If p.NumberOfViews = 0 Then
    Dim p2 As Panel : p2.Initialize("p2")
    '        Dim j As JavaObject = V
    '        p2.Height = j.RunMethod("getWidth",Null)
    '        p2.Color = Colors.RGB(Rnd(0,255),Rnd(0,255),Rnd(0,255))
            p.Height = 60dip
    End If
    For Each View1 As View In p.GetAllViewsRecursive
    If GetType(View1) = GetType(lbl) Then
                lbl2 = View1
                lbl2.Text = Items.Get(Position)
    Else If GetType(View1) = GetType(img) Then
                img2 = View1
                img2.Bitmap = 
    LoadBitmap(File.DirAssets,(Position+1) & ".png")
                img2.Left = 
    100%x - 60dip
    Else If GetType(View1) = GetType(btn) Then
                btn2 = View1
                btn2.Tag = Position
                btn2.Text  = Position + 
    End If
    End Sub

    Sub p2_Click
    Dim p3 As Panel = Sender
    ToastMessageShow("Item Clicked At #"&re.GetPosition(p3.Parent),False)
    End Sub

    #If JAVA
        public int Layout(){
            return R.layout.recycler_layout;
    #End If

    Sub btn_Click
    Dim b As Button = Sender
    ToastMessageShow("Button Clicked At #"& (b.Tag+1),False)
    End Sub
  4. asales

    asales Well-Known Member Licensed User

    Which fórum?
  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