This module emulate the Facebook Paper tilt-fullscreen ImageViewer.
It provides a scrollable, pinchable, zoomable and fullscreen ImageViewer.
The widget is fully compatible with iOS and Android, with different features.
On iOS 7+, it uses the new ti.coremotion Titanium module to move the image across your movements. So you need to install the ti.coremotion module or this feature will not work.
On Android, due system limitations, the image is not pinchable/zoomable.
Thanks to this post by SubjC for making me understand some things about this widget.
gittio install com.caffeinalab.titanium.tiltimageview
Download the latest release, unzip in app/widgets
and add in your config.json, under dependencies
:
"dependencies": {
"com.caffeinalab.titanium.tiltimageview": "*"
}
Require the widget in an Alloy View
<Widget src="com.caffeinalab.titanium.tiltimageview" id="paperImageView" image="http://lorempixel.com/1024/1024/city" title="This is the title!" />
And open when you need in the relative controller
$.paperImageView.open();
Instance the widget and open it
var tilter = Alloy.createWidget('com.caffeinalab.titanium.tiltimageview', { /* constructor options */ });
tilter.open();
The image to show. Must be a URL or a Ti.Blob
Add a listener to close the modal on the click over the image
The title to show on the bottom of the View.
The subtitle to show
Open the widget.
Close the widget