[TIMOB-4350] Android: Update ImageView with pinch-zoom and double-tap zoom support
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-11-02T01:24:19.000+0000 |
Affected Version/s | Release 1.7.0 |
Fix Version/s | Release 10.2.0 |
Components | Android |
Labels | ImageView, android, pinch, scale, zoom |
Reporter | Dawson Toth |
Assignee | Joshua Quick |
Created | 2011-06-08T09:58:37.000+0000 |
Updated | 2021-11-02T01:24:19.000+0000 |
Description
*Summary:*
Update
Ti.UI.ImageView
to support pinch-zoom and double-tap zoom support.
Remove usage of deprecated Java [ZoomControls](https://developer.android.com/reference/android/widget/ZoomControls) widget and use [ScaleGestureDetector](https://developer.android.com/reference/android/view/ScaleGestureDetector) instead.
*To-Do:*
Android's Ti.UI.ImageView
already has an [enableZoomControls](https://titaniumsdk.com/api/titanium/ui/imageview.html#enablezoomcontrols) property which shows the [ZoomControls](https://developer.android.com/reference/android/widget/ZoomControls) widget showing +/- buttons. Nobody uses this UI widget anymore. We should continue to support the "enableZoomControls" property, but re-purpose it to use the [ScaleGestureDetector](https://developer.android.com/reference/android/view/ScaleGestureDetector) instead.
*Parity Issue:*
On iOS, pinch-zooming an ImageView
is implemented via a ScrollView
by setting its [maxZoomScale](https://titaniumsdk.com/api/titanium/ui/scrollview.html#maxzoomscale) to a value greater than 1.0
. Unfortunately, this is a parity issue between the 2 platforms.
*Example Code:*
const window = Ti.UI.createWindow();
window.add(Ti.UI.createImageView({
image: "https://raw.githubusercontent.com/appcelerator/titanium_mobile/master/tests/Resources/ExifRotate270.jpg",
scalingMode: Ti.Media.IMAGE_SCALING_ASPECT_FIT,
enableZoomControls: true,
width: Ti.UI.FILL,
height: Ti.UI.FILL,
}));
window.open();
*Helpdesk Ticket:*
http://appc.me/APP-121155 http://appc.me/APP-422217 http://appc.me/APP-768251
Bumped to "Next Release".
Hi guys, is this feature, zoom & double tap, mentioned within this ticket still on the roadmap?
I don't think this is on any roadmap after no reaction in almost 6 years. To be fair it is not easily available in stock Android either. Would be a great feature still, for parity and as a sale argument.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/13146