Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4350] Android: Update ImageView with pinch-zoom and double-tap zoom support

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2021-11-02T01:24:19.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sRelease 10.2.0
ComponentsAndroid
LabelsImageView, android, pinch, scale, zoom
ReporterDawson Toth
AssigneeJoshua Quick
Created2011-06-08T09:58:37.000+0000
Updated2021-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

Comments

  1. Dawson Toth 2011-08-15

    Bumped to "Next Release".
  2. Yakup Kalin 2017-04-18

    Hi guys, is this feature, zoom & double tap, mentioned within this ticket still on the roadmap?
  3. AppDev 2017-08-08

    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.
  4. Joshua Quick 2021-10-26

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/13146

JSON Source