Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Roamler/roamler.imageViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

roamler.imageViewer

Cross Platform (iOS & Android) widget for viewing and zooming images

This image viewer is a Facebook-like image viewer to be able to view an image full screen with zoom capabilities. You can dismiss the image just like on Facebook by swiping it away in any direction you want.

Dependencies

There is only one dependency, which is for Android. You'll need TiTouchImageView to get this to work. Just download that module and add it to your app.

Installation

To install this widget, unzip the latest version in the app/widget directory (create the widget directory if it doesn't exist) and then add the widget to config.json file.

"dependencies": {
    "roamler.imageViewer": "1.0"
}

Implementation

The implementation is really simple. You basically only need one line of code in your controller

Alloy.createWidget('roamler.imageViewer').openImageViewer(image);

But be aware, the image has to be a blob, remote images don't work. I would recommend using To.ImageView to fetch remote images properly including a callback in which you can insert this module, like below

require('To.ImageCache').cache('http://example.com/image.jpg', 25000, function(blob){
    Alloy.createWidget('roamler.imageViewer').openImageViewer(blob);
});

iOS Screenshot

Simulator Screenshot