Giter Site home page Giter Site logo

minhnc / tigmimagepicker Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 3.0 10.98 MB

Appcelerator Titanium Photo Picker supporting multiple selections and UI customizations. Designed for iOS 8 with Photo framework ( PhotoKit )

License: Other

JavaScript 0.93% Objective-C 88.46% Ruby 3.27% Python 7.35%

tigmimagepicker's Introduction

GMImagePicker module for Appcelerator Titanium

Photo Picker supporting multiple selections and UI customizations. Designed for iOS 8 with Photo framework ( PhotoKit )

https://github.com/guillermomuntaner/GMImagePicker

Screenshots

Screenshot

Features

  1. Allows selection of multiple photos and videos TODO, even from different albums.
  2. Optional single selection mode.
  3. Optional camera access.
  4. Optional bottom toolbar with information about users selection.
  5. Full and customizable acces to smart collections(Favorites, Slo-mo or Recently deleted).
  6. Filter by collections & albums.
  7. Filter by media type.
  8. Customizable colors, fonts and labels to ease branding of the App.
  9. By default mimics UIImagePickerController in terms of features, appearance and behaviour.
  10. Dynamically sized grid view, easy to customize and fully compatible with iPhone 6/6+ and iPad.
  11. Works in landscape orientation and allow screen rotation!
  12. It can be used as Popover on iPad, with customizable size. TODO
  13. Fast & small memory footprint powered by PHCachingImageManager.
  14. Full adoption of new iOS8 PhotoKit. Returns and array of PHAssets.

Usage

<ios>
    <plist>
        <dict>
            <key>NSPhotoLibraryUsageDescription</key>
            <string>Access media in Photos</string>
        </dict>
    </plist>
</ios>
var picker = require('ti.gmimagepicker');
var sv;

(function() {
	var w = Ti.UI.createWindow({ layout: 'vertical' });
	
		var btn = Ti.UI.createButton({ title: 'Pick Photos', backgroundColor: 'blue', tintColor: 'white', width: 120, top: 60 });
			btn.addEventListener('click', showGMImagePicker);
		
		sv = Ti.UI.createScrollableView({ showPagingControl: true, backgroundColor: 'grey' });
		
	w.add(btn);
	w.add(sv);
	w.open();	
})();


function showGMImagePicker() {
	sv.removeAllChildren();
	
	picker.openPhotoGallery({
		maxSelectablePhotos: 10,
		// allowMultiple: false, // default is true
	    success: function (e) {
	        Ti.API.error('success: ' + JSON.stringify(e));
	        renderPhotos(e.media);
	    },
	    cancel: function (e) {
	    	Ti.API.error('cancel: ' + JSON.stringify(e));
	    },
	    error: function (e) {
	        Ti.API.error('error: ' + JSON.stringify(e));
	    }
	});
}

function renderPhotos(media) {
	var views = [];
    
    for (var i=0; i < media.length; i++) {
    	views.push( Ti.UI.createImageView({ image: media[i], width: '100%', height: Ti.UI.SIZE }) );
	};
	
	sv.setViews(views);
}

Minimum Requirement

Xcode 6 and iOS 8.

License

Copyright (c) 2016 Minh Nguyen

tigmimagepicker's People

Contributors

minhnc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tigmimagepicker's Issues

Crashes immediately on iPad even with an anchor window

Crashes immediately on iPad even with an anchor window.

For the native openImageGallery function on the iPad I usually have to create an anchor window as follows:

var tempWinForIpad = Titanium.UI.createWindow({  
                                                backgroundColor:'transparent'
                                            });
                                            tempWinForIpad.open();

However, with or without an anchor window this module immediately crashes on the iPad Air 2 simulator

.media does not populate with images when selecting >6 images

Me again :)

Everything is working beautifully except when I select > 6 photos. When selecting any # from 1-6 images, it works smoothly. For some reason both the success and error callbacks fire when running it with anywhere between 1-6 images (not an issue since my error callback is empty).

But when I select 7 or more images then .media is filled with errors.

Is this same thing happening to you or just me?

Thumbnail images incorrect when changing orientation.

If you have the picker open with the image grid showing, then change orientation, the image sizes (frames/bounds) get messed up.

Re-orienting back does not solve the jumble.

(For now, I'll lock the device orientation)

Appcelerator is not recognizing the module?

I unzipped your ti.gmimagepicker-iphone-1.0.0.zip into my modules directory like I have for many other modules, but for some reason it doesn't show up at all in my modules list on the TiApp Editor

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.