B4A Library: SubsamplingScaleImageView

Info
----
B4ALIBCONVERT (@knowmeid) Hamid
SubsamplingScaleImageView

Install (Additional Libraries folder):
  - SubsamplingScaleImageView.jar
  - subsampling-scale-image-view-3.10.0.aar
  - SubsamplingScaleImageView.xml

If you installed an earlier build of this library, delete its old
files first. Leftover jars/aars define the same classes twice and
make the B4A compiler fail while dexing.

Do not add two converted libraries that share the same Java package
(example: SmoothBottomBar + NiceBottomBar both use me.ibrahimsn.lib).
Dex merge then fails with 'Type ... is defined multiple times'.
Use only one of them in the same B4A project.

1. Copy ALL .jar/.aar and .xml files above into the same B4A additional libraries folder.
2. Libraries tab -> Refresh. Do this even if the library is already
   in the list: B4A keeps the previous .xml in memory, and a stale
   copy makes it skip dependencies without reporting anything.
3. Add the library to your project.

Wrapper compiled: YES

Project resources (res folder)
------------------------------
The library's own resources ship inside the .aar, so nothing has to be
copied for them to work. The res folder next to this file is a readable
copy: use it to look up attribute and style names.

Some native methods take a resource id, which B4A cannot produce. Put
the file in your own res folder, declare it, and look the id up by name:

    #AdditionalRes: ..\res, com.davemorrissey.labs.subscaleview

    ' res\menu\bottom_nav.xml -> id at runtime
    Dim id As Int = v.ResourceId("menu", "bottom_nav")
    v.inflateMenu(id)

ResourceId returns 0 when the name does not exist, and passing 0 to a
native method raises a Resources.NotFoundException.

Usage
-----
SubsamplingScaleImageView is an Android view.

  From code:
    Dim v As SubsamplingScaleImageView
    v.Initialize("v")
    Activity.AddView(v, 0, 50%y, 100%x, 50dip)

  From the Designer:
    Add View -> CustomView, then set CustomType to SubsamplingScaleImageView.SubsamplingScaleImageView

    Sub v_Ready()
    End Sub
    Sub v_ImageLoaded()
    End Sub
    Sub v_PreviewLoadError(Arg1 As Object)
    End Sub
    Sub v_ImageLoadError(Arg1 As Object)
    End Sub
    Sub v_TileLoadError(Arg1 As Object)
    End Sub
    Sub v_PreviewReleased()
    End Sub
    Sub v_ScaleChanged(Arg1 As Float, Arg2 As Int)
    End Sub
    Sub v_CenterChanged(Arg1 As Object, Arg2 As Int)
    End Sub

ImageSource:
    Dim o As ImageSource
    o.Initialize    ' only if the class has an Initialize method

SkiaPooledImageRegionDecoder:
    Dim o As SkiaPooledImageRegionDecoder
    o.Initialize    ' only if the class has an Initialize method

SkiaImageRegionDecoder:
    Dim o As SkiaImageRegionDecoder
    o.Initialize    ' only if the class has an Initialize method


Sample code (copy below)
========================
===== COPY BELOW =====
Activity.Color = 0xFFE8EAF6
Dim bar As SubsamplingScaleImageView
bar.Initialize(Me, "subsamplingscaleimageview")
Activity.AddView(bar, 0, 100%y - 70dip, 100%x, 70dip)

' Add tabs / styling here — see library README on GitHub.

Sub subsamplingscaleimageview_Ready()
End Sub

Sub subsamplingscaleimageview_ImageLoaded()
End Sub

Sub subsamplingscaleimageview_PreviewLoadError(Arg1 As Object)
End Sub

Sub subsamplingscaleimageview_ImageLoadError(Arg1 As Object)
End Sub

Sub subsamplingscaleimageview_TileLoadError(Arg1 As Object)
End Sub

Sub subsamplingscaleimageview_PreviewReleased()
End Sub

Sub subsamplingscaleimageview_ScaleChanged(Arg1 As Float, Arg2 As Int)
End Sub

Sub subsamplingscaleimageview_CenterChanged(Arg1 As Object, Arg2 As Int)
End Sub
===== COPY ABOVE =====

Overloaded methods get a numeric suffix (setImage, setImage2, ...)
because B4A does not support overloading.

B4ALIBCONVERT (@knowmeid) Hamid
Copyright (c) B4ALIBCONVERT — All rights reserved.
تبدیل خودکار کتابخانه GitHub به B4A | Automatic GitHub-to-B4A library converter.

Generated by B4ALIBCONVERT.