Android Question How works ScrollView2D together with ZoomImageView?

Wosl

Member
Dear All!

I try to integrate zooming capability (ZoomImageView) with window scrolling (ScrollView2D). Here is a simple code snippet (complete code attached) with three ImageViews. The second one should have zoom capability:
B4X:
Sub Globals
    Public ScrollView2DMain As ScrollView2D
    Public ImageView1 As ImageView, ImageView2 As ImageView, ImageView3 As ImageView
    Public PanelMain As Panel
    Public ZoomImageView1 As ZoomImageView
End Sub

Sub Activity_Create (FirstTime As Boolean)   
    Activity.LoadLayout ("MainScroll")
    ScrollView2DMain.Panel.LoadLayout ("MainLayout")
    ScrollView2DMain.Panel.Height = PanelMain.Height
    ScrollView2DMain.Panel.Width  = PanelMain.Width

    bmp=xui.LoadBitmap (File.DirAssets, "image0.jpg")
    ZoomImageView1.SetBitmap(bmp)
    ImageView2 = ZoomImageView1.ImageView
End Sub

In general, the zooming with two fingers of second chart seems to work but not as expected (more or less inoperable). My assumption is that both, ScrollView2D and ZoomImageView, are conflicting regarding implemented gestures:

Scroll and Pan (ScrollView2D)
Zoom in/out (ZoomImageView)

Has anyone experience how to integrate ScrollView2D and ZoomImageView? Does this not work at all? Any suggestions about alternative solutions are appreciated.

Best regards
Wosl
 
Top