Android Question [Solved] Bug in Webview or CustomLayoutDialog?

D

Deleted member 103

Guest
Hello,
I've downgraded my Nexus-7 from Android 5.1.1 to 4.4.4 today, and now it's as fast as buying it on 2013. :)
Unfortunately, I now notice an error when displaying Webview with CustomLayoutDialog, the title is cut off (see picture below).
I believe that the error lies in the CustomLayoutDialog, because after a test with only one webview, the error is no longer present.

B4X:
'With CustomLayoutDialog
Private Sub mnuHistory1
    Dim dialog As CustomLayoutDialog
   
    Dim sf As Object = dialog.ShowAsync("", "OK", "", "", Null, True)
    Wait For (sf) Dialog_Ready (DialogPanel As Panel)
    DialogPanel.LoadLayout("frmWebView")
    Dim WebView1 As WebView = DialogPanel.GetView(0)
    WebView1.LoadHtml(File.GetText(File.DirAssets,Starter.language.value("strHistoryFile")))
   
    Wait For (sf) Dialog_Result (Result As Int)
End Sub

'without CustomLayoutDialog
Private Sub mnuHistory2
    Activity.LoadLayout("frmWebView")
    WebView1.LoadHtml(File.GetText(File.DirAssets,Starter.language.value("strHistoryFile")))
End Sub
 

Attachments

  • CustomLayoutDialog_android_4.1.1.png
    CustomLayoutDialog_android_4.1.1.png
    26.3 KB · Views: 119
  • CustomLayoutDialog_android_4.4.4.png
    CustomLayoutDialog_android_4.4.4.png
    26.7 KB · Views: 127
  • CustomLayoutDialog_android_8.1.0.png
    CustomLayoutDialog_android_8.1.0.png
    40.6 KB · Views: 129
  • Only-Webview_android_4.4.4.png
    Only-Webview_android_4.4.4.png
    11.1 KB · Views: 117
D

Deleted member 103

Guest
Why don't you add some padding?
With padding 20dip, no change. :(

B4X:
Private Sub mnuHistory
    Dim dialog As CustomLayoutDialog
    
    Dim sf As Object = dialog.ShowAsync("", "OK", "", "", Null, True)
    Wait For (sf) Dialog_Ready (DialogPanel As Panel)
    DialogPanel.LoadLayout("frmWebView")
    Dim WebView1 As WebView = DialogPanel.GetView(0)
    WebView1.Padding = Array As Int(10dip, 20dip,10dip, 10dip)
    WebView1.LoadHtml(File.GetText(File.DirAssets,Starter.language.value("strHistoryFile")))
    
    Wait For (sf) Dialog_Result (Result As Int)
End Sub
 

Attachments

  • CustomLayoutDialog_android_4.4.4_and_padding_20dip.png
    CustomLayoutDialog_android_4.4.4_and_padding_20dip.png
    27.4 KB · Views: 132
Upvote 0
Top