[TIMOB-1510] Android: Add support for saveToPhotoGallery (Titanium.Media.saveToPhotoGallery)
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-05-28T16:04:52.000+0000 |
Affected Version/s | Release 1.7.0 |
Fix Version/s | 2014 Sprint 08, 2014 Sprint 08 SDK, Release 3.3.0 |
Components | Android |
Labels | module_media, parity, qe-testadded, tbs-1.9.0 |
Reporter | Bill Dawson |
Assignee | Vishal Duggal |
Created | 2011-04-15T02:54:47.000+0000 |
Updated | 2014-05-28T16:07:34.000+0000 |
Description
Currently only a log warning that it's not supported.
The code sample below demonstrates the feature required. Works fine on iphone.
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var image_view = Ti.UI.createImageView({
image: 'appcelerator.png',
height: 400,
width: 320
});
var button2 = Ti.UI.createButton({
top:90,
title:'save to gallery',
height:40
});
win1.add(button2);
button2.addEventListener('click', function(e){
win1.add(image_view);
var img = image_view.toBlob();
Titanium.Media.saveToPhotoGallery(img,{
"success": function(e){
alert('Saved to your camera roll.');
},
"error": function(e){
alert(e.error);
}
});
});
win1.open();
Associated helpdesk ticket:
http://support-admin.appcelerator.com/display/APP-612766 The image is saved on the systems' gallery and not on the filesystem of the app.I will be backporting the fix that's on the 3_0_X branch for 2_1_X in some capacity. Anyone's interested in push request for this one?
Here you go: https://github.com/appcelerator/titanium_mobile/pull/3427
This is still happening on Ti SDK 3.1.2.GA Tested on several devices (Android 4.0, 4.1, 4.2 and 4.3) PhoneGap solved this as per: http://simonmacdonald.blogspot.ca/2012/07/change-to-camera-code-in-phonegap-190.html I think this shouldn't be marked as trivial.
Any news on this one? Fix Version?
Test Code
Pull pending https://github.com/appcelerator/titanium_mobile/pull/5597