https://github.com/caffeinalab/ti.tilt-image-view
FacebookPaper-style tilt-fullscreen Image viewer widget for Titanium Alloy.
https://github.com/caffeinalab/ti.tilt-image-view
Last synced: 6 months ago
JSON representation
FacebookPaper-style tilt-fullscreen Image viewer widget for Titanium Alloy.
- Host: GitHub
- URL: https://github.com/caffeinalab/ti.tilt-image-view
- Owner: caffeinalab
- License: apache-2.0
- Created: 2014-06-13T08:41:14.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-10-06T16:49:10.000Z (over 11 years ago)
- Last Synced: 2024-08-04T07:03:32.023Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 304 KB
- Stars: 53
- Watchers: 15
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ti.TiltImageView
### com.caffeinalab.titanium.tiltimageview
#### This module emulate the [Facebook Paper](https://www.facebook.com/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](http://docs.appcelerator.com/titanium/latest/#!/guide/Core_Motion_Module) 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](http://subjc.com/facebook-paper-photo-panner/) for making me understand some things about this widget.*
_iphone5s_spacegrey_portrait.png)
## Original "Facebook Paper" Controller

## Installation
#### Via Gittio
```
gittio install com.caffeinalab.titanium.tiltimageview
```
#### Via Github
Download the latest release, unzip in `app/widgets` and add in your *config.json*, under `dependencies`:
```json
"dependencies": {
"com.caffeinalab.titanium.tiltimageview": "*"
}
```
## Usage
### In Views
Require the widget in an Alloy View
```xml
```
And open when you need in the relative controller
```javascript
$.paperImageView.open();
```
### In Controllers
Instance the widget and open it
```javascript
var tilter = Alloy.createWidget('com.caffeinalab.titanium.tiltimageview', { /* constructor options */ });
tilter.open();
```
## Constructor options
#### `image` (String|Ti.Blob)
The image to show. Must be a **URL** or a `Ti.Blob`
#### `[closeOnClick]` (Boolean, default: `true`)
Add a listener to close the modal on the click over the image
#### `[title]` (String)
The title to show on the bottom of the View.
#### `[subtitle]` (String)
The subtitle to show
## API
#### `open()`
Open the widget.
#### `close()`
Close the widget