#Region Project Attributes
#ApplicationLabel: ITSS Aeropuerto
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#MultiDex: true
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#BridgeLogger:true
#AdditionalJar: com.google.android.gms:play-services-auth
#AdditionalJar: com.google.android.gms:play-services-base
#AdditionalJar: com.google.firebase:firebase-common
#AdditionalJar: com.google.firebase:firebase-auth
#AdditionalJar: com.google.firebase:firebase-database
#AdditionalJar: com.google.firebase:firebase-core
#AdditionalJar: com.google.firebase:firebase-common
#AdditionalJar: com.google.firebase:firebase-firestore
#AdditionalJar: com.google.gms:google-services
#AdditionalJar: grpc-core-1.20.0.jar
#AdditionalJar: grpc-protobuf-1.20.0.jar
#AdditionalJar: grpc-okhttp-1.20.0.jar
#AdditionalJar: grpc-android-1.20.0.aar
#AdditionalJar: opencensus-api-0.20.0.jar
#AdditionalJar: grpc-stub-1.20.0.jar
#AdditionalJar: grpc-protobuf-lite-1.20.0.jar
#AdditionalJar: opencensus-contrib-http-util-0.20.0.jar
#AdditionalJar: opencensus-contrib-grpc-metrics-0.20.0.jar
#AdditionalJar: grpc-context-1.20.0.jar
#AdditionalJar: glide-3.8.0.jar
#AdditionalJar: guava-27.1-android.jar
#ExcludeClasses: com.google.guava:guava-jdk5
#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 auth As FirebaseAuth
Dim Imagen_perfil As String
Dim fs As Firestore
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 inicio_etiqueta As Label
Private Image_Perfil_View1 As ImageView
Dim Imagen_perfil As String
Private btnSignOut As Button
Private btnloginFacebook As Button
Private btnlogingogle As Button
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("inicio")
'If auth.CurrentUser.IsInitialized Then Auth_SignedIn(auth.CurrentUser)
fs.Initialize("Firestore",True)
Dim driver As CollectionReference = fs.collection("Drivers","DriverCollection")
If driver <> Null Then
Log("Setting query to get driver DonManfred")
driver.whereEqualTo("id","DonManfred").limit(1).fetch("DriverFetch")
wait for DriverFetch_Snapshot(snap As QuerySnapshot)
Log($"Driver_Snapshot(${snap.Size},${snap})"$)
Dim meta As SnapshotMetadata = snap.Metadata
Dim documents As List = snap.Documents
'Log(documents)
If documents.IsInitialized Then
If documents.Size > 0 Then
For i = 0 To documents.Size-1
Dim docsnap As DocumentSnapshot = documents.Get(i)
Log("Query4DonManfred DocumentNo: #"&i&": "&docsnap.Id)
Next
End If
Else
Log("Snapshot does not contain a list of Documents...")
End If
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btnlogingogle_Click
Starter.auth.SignInWithGoogle
End Sub
Sub btnloginFacebook_Click
Starter.facebook.SignIn
End Sub
Sub btnSignOut_Click
Starter.auth.SignOutFromGoogle
Starter.facebook.SignOut
inicio_etiqueta.Text = "Te esperamos nuevamente!"
Image_Perfil_View1.Bitmap = Null
End Sub
'Sub Auth_SignedIn (User As FirebaseUser)
' Log("SignedIn: " & User.DisplayName)
' inicio_etiqueta.Text = "Hola, Bienvenido " & User.DisplayName
'End Sub
Sub SetState
If Starter.auth.CurrentUser.IsInitialized Then
Dim usuario As FirebaseUser = Starter.auth.CurrentUser
inicio_etiqueta.Text = "Hola: " & usuario.DisplayName
Imagen_perfil=usuario.PhotoUrl
Dim links As Map
links.Initialize
links.Put(Image_Perfil_View1, usuario.PhotoUrl)
CallSubDelayed2(imageDownLoader, "Download", links)
End If
End Sub