Hi
How can Access To label get value and set value
and how can stop video palying when scroll listview from this project
b4xmainpage code
info code
How can Access To label get value and set value
and how can stop video palying when scroll listview from this project
b4xmainpage code
B4X:
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private SimpleExoPlayer1 As SimpleExoPlayer
Dim SimpleExoPlayerView1 As SimpleExoPlayerView
Dim p As B4XView
Dim i As Int =0
Dim lb1 As B4XView
Dim btn1 As B4XView
End Sub
Sub Addstr()
Dim Links() As String
Links = Array As String("https://download.samplelib.com/mp4/sample-5s.mp4", "https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4" )
For Each link As String In Links
Dim s As Info = B4XPages.GetPage("info1")
p = xui.CreatePanel("")
p.Color=Colors.Transparent
p.SetLayoutAnimated(100,0,0,Root.Width,Root.Height )
p.LoadLayout("LayVideoPlayer")
lb1.Text=Rnd(1,1234)
btn1.Text="Change" & i
s.Lvinfo.Add(p,"")
SimpleExoPlayer1.Initialize("SimpleExoPlayer1")
SimpleExoPlayer1.Prepare(SimpleExoPlayer1.CreateUriSource(link))
SimpleExoPlayerView1.Player = SimpleExoPlayer1
i=i+1
Next
End Sub
Private Sub BtnShowVideo_Click
Dim info1 As Info
info1.Initialize
B4XPages.AddPage("info1",info1)
B4XPages.ShowPage("info1")
Addstr
End Sub
Private Sub btn1_Click
' hier I can not acces to lb1 to get value and add a value to it from btn 1
' Dim lb As Label =Sender
' Dim x As Int =lb.Text
Dim btn As Button =Sender
Dim x As Int =lb1.Text
x=x+1
btn.Text="change "& x
End Sub
info code
B4X:
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Dim Lvinfo As CustomListView
End Sub
'You can add more parameters here.
Public Sub Initialize As Object
Return Me
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("Layinfo")
End Sub