Code Monkey home page Code Monkey logo

ti.imagegallery's Introduction

Ti.ImageGallery

Image gallery widget for Appcelerator Titanium

With this image gallery it's possible to show a sequence of local images, scrolling them by lateral buttons or using a simple "navigation" panel of thumbnails. Images are zoomable, scrollable and pinchable on iOS and Android.

It uses https://github.com/apra-informatica/Ti.ImageViewer, which uses module org.iotashan.TiTouchImageView (on Android), and both these widget and module should be installed.

image

Installation

Add in your config.json, under dependencies:

"dependencies": {
    "it.apra.tiimagegallery": "*"
}

Usage

var imagesData = itemImages.map(function(itemImage){
	return {
		'filepath' : '...', // image detail path
		'filename' : '...', // image detail filename
		'filepathThumb' : '...', // image thumb path
		'fetchFunction' : function(params){ // function for fetching of detail image
			params = params || {};
			params.success = params.success || function(){return;};
			params.error = params.error || function(e) { Ti.API.warn(e); };
			
			// ...
		},
		'fetchFunctionThumb' : function(params){ // function for fetching of thumb image
			params = params || {};
			params.success = params.success || function(){return;};
			params.error = params.error || function(e) { Ti.API.warn(e); };
			
			// ...
		}
	};
});

gallery = Alloy.createWidget('it.apra.tiimagegallery', {
	'imagesData': imagesData,
	'backgroundColor' : 'white',
	'emptyViewLabelParams' : {'color' : 'black'},
	'thumbsDefaultImage' : '/images/imageUnavailable.png'
});

Args

  • imagesData: Images data array (object literals properties are showed in the example)
  • currentPage: Page to show (default 0)
  • backgroundColor: Background color (default 'black')
  • viewerParams: Optional parameters for the tiimageviewer widget
  • emptyViewLabelParams: Optional parameters for label used in empty views
  • loadingViewSpinnerImages: Optional array of images used in the loading spinner
  • thumbsDefaultImage: Optional image used as placeholder while thumbs are downloading
  • thumbsOpacity: Optional opacity of thumbnails view (default 0.9)
  • thumbsDefaultDown: If true keep down the thumbnails view as default
  • thumbsHidden: If true hide thumbnails view (as default hided only in case of handheld device)
  • showMultiple: If false only first image is showed

Functions

  • removeEventListeners: remove all listeners on controls
  • isThumbsViewerVisible: return if thumbs are visible

##Notes

  • Could be useful having a bidirectionality between detail and thumbnails viewer. Also a preload of images close to the current one would be nice.
  • Feel free to get the code and change it, any improving would be appreciated.

ti.imagegallery's People

Contributors

nonno avatar

Stargazers

Waqas Mahmood Khan avatar  avatar  avatar Konstantin Büschel avatar Dongwoo Gim avatar Michael Pauley avatar Dan Tamas avatar Roy Sinclair avatar samuele coppede avatar Ivan Carlos avatar Thibault Lenclos avatar Clem Blanco avatar Vincent Desdoigts avatar Joseph avatar

Watchers

James Cloos avatar  avatar Luca Cardinali avatar

ti.imagegallery's Issues

Screenshots

It sounds great, but a screenshot in the readme would be even better ;)

Example

Do you have a example app with this working?

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.