Peter Finch
Member
My App uses the sliding drawer as per AppCompat and a Screen snapshot - all works exactly as expected with the sliding drawer, until I do a PrtSc (activity snapshot). The items on the sliding drawer then fail to respond for a period - I cant decide if it is for a time (propbably not) or until I slide the draw in an out/press on the hamburger or do a long press, but after some time they become responsive again - any ideas - I tried a sleep(0) before the PrtSc to no avail.
The PrtSc routine is:
and the sliding drawer:
What am I doing wrong/leaving out? I tested with a modified AppCompat attached.
The PrtSc routine is:
B4X:
Sub PrtSc_Click
'capture screenshot
Dim download As String = File.DirRootExternal & "/Download/"
DateTime.DateFormat = "yyyyMMdd-HHmmss"
Dim x As B4XView = Activity 'XUI library
Dim bmp As Bitmap = x.Snapshot
Dim out As OutputStream = File.OpenOutput(download, DateTime.Date(DateTime.Now) & ".jpg", False)
bmp.WriteToStream(out, 80, "JPEG")
out.Close
ToastMessageShow("Snapshot in Download folder",True)
B4X:
Sub Globals
Private ACToolBarLight1 As ACToolBarLight
Private ToolbarHelper As ACActionBar
Private Drawer As B4XDrawer
Private ListView1 As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Drawer.Initialize(Me, "Drawer", Activity, 300dip)
Drawer.CenterPanel.LoadLayout("1")
ToolbarHelper.Initialize
ToolbarHelper.ShowUpIndicator = True 'set to true to show the up arrow
Dim bd As BitmapDrawable
bd.Initialize(LoadBitmap(File.DirAssets, "hamburger.png"))
ToolbarHelper.UpIndicatorDrawable = bd
ACToolBarLight1.InitMenuListener
Drawer.LeftPanel.LoadLayout("Left")
For i = 1 To 10
ListView1.AddSingleLine("Line " & i)
Next
Dim b As Button
b.Initialize("PrtSc")
b.Text = "PrtSc"
ACToolBarLight1.AddView(b, 60dip, 40dip, Gravity.RIGHT)
End Sub