Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim MF_File As MF_File
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.
Dim ListView1 As ListView
Dim pdfv As PDFViewer
Dim i,pc As Int=0
Dim iv
Private Button1 As Button
Dim fileselezionato As String
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("pdf")
Activity.Title = "XXX Plus"
'Imposto ListView a tutta altezza
ListView1.Height = 100%y
Dim testPath As String = File.DirRootExternal&"/xxxplus/"
Dim Bitmap1 As Bitmap
Bitmap1.Initialize(File.DirAssets, "pdf-icon.png")
If pdfv.IsInitialized = False Then
pdfv.init
End If
Activity.AddView(pdfv,0,50%y,-1,-1)
pdfv.Visible = False
Log("MF_File.ListFiles")
Dim files As List
files = MF_File.ListFiles(testPath, "*.pdf", True, False)
If files.IsInitialized Then
For Each f As String In files
Log(" " & f)
ListView1.AddTwoLinesAndBitmap(f, "File Pdf", Bitmap1)
Next
End If
End Sub
Sub ListView1_ItemClick (Position As Int, Value As Object)
ProgressDialogShow2("Anteprima File selezionato...",False)
DoEvents
ListView1.Height = 40%y
fileselezionato = Value
Button1.Visible = True
Button1.Text = "Click Here to " & Value & " to XXX"
'Leggo File Pdf in anteprima
pdfv.Visible = True
pdfv.getpdf(File.DirRootExternal&"/Ocrplus/"& Value)
If pdfv.isValid Then
'Log("pagecount:"&pdfv.PageCount)
pdfv.scrollToPage(0)
pc=pdfv.GetPageCount
pdfv.zoom(1.0)
ProgressDialogHide
Else
ProgressDialogHide
Msgbox("Error pdf file!","Error")
'Activity.Finish
'Return
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_KeyPress(KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK AND ListView1.Height = 40%y Then
Button1.Visible = False
pdfv.Visible = False
ListView1.Height = 100%y
Return True
Else If KeyCode = KeyCodes.KEYCODE_BACK AND ListView1.Height = 100%y Then
Activity.Finish
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
' Rivedere per far tornare indietro su immagini
End Sub