-
-
Save artanisdesign/ee42a395a6e7418000d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function showgallery(){ | |
Titanium.Media.openPhotoGallery({ | |
success:function(event){ | |
var cropRect = event.cropRect; | |
var image = event.media; | |
Ti.API.debug('Our type was: '+event.mediaType); | |
if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO){ | |
var uri = image.nativePath; | |
var igIntent = Ti.Android.createIntent({ | |
action:Ti.Android.ACTION_SEND, | |
packageName:"com.instagram.android", | |
type:"image/*" | |
}); | |
igIntent.putExtraUri(Titanium.Android.EXTRA_STREAM, uri); | |
setTimeout(function(){ | |
Ti.Android.currentActivity.startActivity(igIntent); | |
}, 400); | |
}else{ | |
// is this necessary? | |
} | |
Titanium.API.info('PHOTO GALLERY SUCCESS cropRect.x ' + cropRect.x + ' cropRect.y ' + cropRect.y + ' cropRect.height ' + cropRect.height + ' cropRect.width ' + cropRect.width); | |
}, | |
cancel:function(){ | |
}, | |
error:function(error){ | |
}, | |
allowEditing:true, | |
mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO] | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment