Git Product home page Git Product logo

ti.tilt-image-view's Introduction

Ti.TiltImageView

com.caffeinalab.titanium.tiltimageview

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.

image

Original "Facebook Paper" Controller

image

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:

"dependencies": {
    "com.caffeinalab.titanium.tiltimageview": "*"
}

Usage

In Views

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();

In Controllers

Instance the widget and open it

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

ti.tilt-image-view's People

Contributors

kopiro avatar

Watchers

James Cloos avatar Josh Lambert avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.