In my app I'm pulling 25 records at a time from a DB and building a page to display in Webview. Scrolling down is not a problem but scrolling up requires loading the 25 records and then programatically scrolling to the bottom of the page for seamless viewing.
I'm using WebviewExtras library for the scroll (and have also tried WebveiwExtended library) and after the records are rendered, the scroll seems to get skipped over, or it happens and then immediately jumps to the top of the webview again.
In the test below, the scroll happens exactly every other time.
Does anyone know what's going on here? @warwound ?
And here is the log:
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
true
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
false
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
true
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
false
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
true
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
false
Any suggestions are appreciated!
-Bryon
I'm using WebviewExtras library for the scroll (and have also tried WebveiwExtended library) and after the records are rendered, the scroll seems to get skipped over, or it happens and then immediately jumps to the top of the webview again.
In the test below, the scroll happens exactly every other time.
Does anyone know what's going on here? @warwound ?
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
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 web As WebView
Private wvx As WebViewExtras
Private HTML 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("Layout1")
web.Initialize("web")
Activity.AddView(web,0,0,100%x,100%y)
HTML=File.ReadString(File.DirAssets,"latin-lipsum.txt")
Render
End Sub
Sub Activity_Resume
Dim t As Int
Render
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Render()
web.LoadHtml("")
Dim strg As String
For t= 0 To 10
strg=strg & HTML
Next
web.LoadHtml(strg)
Log(wvx.GetContentHeight(web))
Log(wvx.pageDown(web,True))
End Sub
And here is the log:
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
true
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
false
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
true
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
false
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
true
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
81944
false
Any suggestions are appreciated!
-Bryon