Android Example my share creation simple carousell

For the First I said Thank Too Much For Great Mr.Errel That my Inspirator, StarDust and All Of member that i can't say person by person, i wish yours appologize of my bad english, this my first shared creations. myCarousell
 
Last edited:

dody

New Member
B4X:
#Region  Project Attributes
    #ApplicationLabel: myCarousel
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: true
    #IncludeTitle: false
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Private xui As XUI
End Sub

Sub Globals
    
    'These global variables will be redeclared each time the activity is created.
    Public ImageView1 As ImageView
    Public Button1 As B4XView
    Public Button2 As B4XView
    Public Button3 As B4XView
    Public xBitMap As Bitmap
    Public btnLogin As Button
    Private Button4 As Button
    Private Button5 As Button
    Private Button6 As Button
    
    Private a As Int
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("imageRoll.bal")
    ImageView1.SetVisibleAnimated(0,False)
    ImageView1.Bitmap=LoadBitmap(File.DirAssets,"intro1.png")
    ImageView1.SetVisibleAnimated(100,True)
    a=0
    Do While a < 4
    a=a+1
        If a=1 Then
            Button4.Visible=True
            Button5.Visible=False
            Button6.Visible=False
            ImageView1.SetVisibleAnimated(0,False)
            ImageView1.Bitmap=LoadBitmap(File.DirAssets,"intro1.png")
            ImageView1.SetVisibleAnimated(1500,True)
            Sleep(3500)
        else if a =2 Then
            Button4.Visible=False
            Button5.Visible=True
            Button6.Visible=False
            ImageView1.SetVisibleAnimated(0,False)
            ImageView1.Bitmap=LoadBitmap(File.DirAssets,"intro2.png")
            ImageView1.SetVisibleAnimated(1500,True)
            Sleep(3500)
        Else
            a=3
            Button4.Visible=False
            Button5.Visible=False
            Button6.Visible=True
            ImageView1.SetVisibleAnimated(0,False)
            ImageView1.Bitmap=LoadBitmap(File.DirAssets,"intro3.png")
            ImageView1.SetVisibleAnimated(1500,True)
            Sleep(3500)
End If
If a >= 3 Then
    a=0
End If   
Loop
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Private Sub Button3_Click
    cond3
End Sub

Private Sub Button2_Click
    cond2
End Sub
Private Sub Button1_Click
    cond1
End Sub
Private Sub btnLogin_Click
    MsgboxAsync("Hello world", "This is the title")
End Sub

Private Sub Button6_Click
    cond3
End Sub

Private Sub Button5_Click
    cond2
End Sub

Private Sub Button4_Click
    cond1
End Sub

Sub cond1
    Button4.Visible=True
    Button5.Visible=False
    Button6.Visible=False
    ImageView1.SetVisibleAnimated(0,False)
    ImageView1.Bitmap=LoadBitmap(File.DirAssets,"intro1.png")
    ImageView1.SetVisibleAnimated(1500,True)
    Sleep(3500)
End Sub

Sub cond2
    Button4.Visible=False
    Button5.Visible=True
    Button6.Visible=False
    ImageView1.SetVisibleAnimated(0,False)
    ImageView1.Bitmap=LoadBitmap(File.DirAssets,"intro2.png")
    ImageView1.SetVisibleAnimated(1500,True)
    Sleep(3500)
End Sub

Sub cond3
    a=3
    Button4.Visible=False
    Button5.Visible=False
    Button6.Visible=True
    ImageView1.SetVisibleAnimated(0,False)
    ImageView1.Bitmap=LoadBitmap(File.DirAssets,"intro3.png")
    ImageView1.SetVisibleAnimated(1500,True)
    Sleep(3500)
End Sub
 
Top