Android Question WebView vs ImageView for Pitch & Zoom

fishwolf

Well-Known Member
Licensed User
Longtime User
I need show a big image and do pitch and zoom gesture.

i have tried to use WebView, with a bit of javascript code for set the size, and the gesture work fine.
but the time for load the image is long, and the webview show a white page.
I have tried to set a background image for loading, but is showed for a little time, also it must be load.

I have used the TouchImageView with no good result
The ImageView component don't manage the standard gesture as in native java?
 

warwound

Expert
Licensed User
Longtime User
You could use CSS styles to set a background color for your webpage - setting a background color won't take long (it won't take as long as setting a background image).
So that's one solution.
Another is TouchImageView which is an ImageView with pinch zoom and panning enabled.
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
change the color of background don't show to user that must wait the download image.
i will try to set a image background from the android asset, but i think that work fine only with LoadHtml metohd, not LoadUrl, right?

why TouchImageView has a not perfect gesture?
sometime the image is not controllable
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
change the color of background don't show to user that must wait the download image.
i will try to set a image background from the android asset, but i think that work fine only with LoadHtml metohd, not LoadUrl, right?

You can load an asset in a WebView using a synxtax like this:

B4X:
<img src ="file:///android_asset/my_image.jpg" />

HTML such as this should work regardless of whether you use LoadHTML or LoadUrl.

why TouchImageView has a not perfect gesture?
sometime the image is not controllable

I wrote TouchImageView as an exercise in learning java.
It's far from perfect but most people find it useable.
 
Upvote 0
Top