[jira] [Created] (CB-8769) Must specify platform when adding from source location
Tim Barham created CB-8769: -- Summary: Must specify platform when adding from source location Key: CB-8769 URL: https://issues.apache.org/jira/browse/CB-8769 Project: Apache Cordova Issue Type: Bug Components: CordovaLib Reporter: Tim Barham Assignee: Tim Barham When you add a platform from a source location (like a local folder, git url, tarball etc), in every case except a local folder you have to include the platform name, like this: {{cordova platform add windows@https://github.com/apache/cordova-windows.git}} The platform name should not be required - we should extract it from whatever we download. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8706) Camera should use filepicker if saveToPhotoAlbum is true
[ https://issues.apache.org/jira/browse/CB-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386483#comment-14386483 ] ASF GitHub Bot commented on CB-8706: Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/78#discussion_r27377731 --- Diff: src/windows/CameraProxy.js --- @@ -43,399 +43,468 @@ module.exports = { // 11 cameraDirection:0 takePicture: function (successCallback, errorCallback, args) { -var encodingType = args[5]; -var targetWidth = args[3]; -var targetHeight = args[4]; var sourceType = args[2]; -var destinationType = args[1]; -var mediaType = args[6]; -var allowCrop = !!args[7]; -var saveToPhotoAlbum = args[9]; -var cameraDirection = args[11]; - -// resize method :) -var resizeImage = function (file) { -var tempPhotoFileName = ; -if (encodingType == Camera.EncodingType.PNG) { -tempPhotoFileName = camera_cordova_temp_return.png; -} else { -tempPhotoFileName = camera_cordova_temp_return.jpg; -} - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; -file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) { - Windows.Storage.FileIO.readBufferAsync(storageFile).then(function(buffer) { -var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); -var imageData = data: + file.contentType + ;base64, + strBase64; -var image = new Image(); -image.src = imageData; -image.onload = function() { -var imageWidth = targetWidth, -imageHeight = targetHeight; -var canvas = document.createElement('canvas'); - -canvas.width = imageWidth; -canvas.height = imageHeight; -canvas.getContext(2d).drawImage(this, 0, 0, imageWidth, imageHeight); - -var fileContent = canvas.toDataURL(file.contentType).split(',')[1]; - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +if (sourceType != Camera.PictureSourceType.CAMERA) { +takePictureFromFile(successCallback, errorCallback, args); +} else { +takePictureFromCamera(successCallback, errorCallback, args); +} +} +}; -storageFolder.createFileAsync(tempPhotoFileName, Windows.Storage.CreationCollisionOption.generateUniqueName).done(function (storagefile) { -var content = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(fileContent); - Windows.Storage.FileIO.writeBufferAsync(storagefile, content).then(function () { -successCallback(ms-appdata:///local/ + storagefile.name); -}, function () { -errorCallback(Resize picture error.); -}); -}); -}; -}); -}, function () { -errorCallback(Can't access localStorage folder); -}); -}; +// Resize method +function resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType) { +var tempPhotoFileName = ; +if (encodingType == Camera.EncodingType.PNG) { +tempPhotoFileName = camera_cordova_temp_return.png; +} else { +tempPhotoFileName = camera_cordova_temp_return.jpg; +} -// because of asynchronous method, so let the successCallback be called in it. -var resizeImageBase64 = function (file) { +var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting) +.then(function (storageFile) { return Windows.Storage.FileIO.readBufferAsync(storageFile); }) +.then(function(buffer) { +var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); +var imageData = data: + file.contentType + ;base64, + strBase64; +var image = new Image();
[jira] [Commented] (CB-6092) Deploying plugins for iOS frameworks breaks symlinks
[ https://issues.apache.org/jira/browse/CB-6092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386414#comment-14386414 ] Miquel commented on CB-6092: Hi Colin, Don't know exactly what are you trying to do. If your intention is to add Google Admob ads, you should use the plugin (not the library itself). See [phonegap admob plugin|https://github.com/appfeel/admob-google-cordova] for more detailed info: {code:xml} gap:plugin name=com.phonegap.plugins.facebookconnect version=0.11.0 source=plugins.cordova.io param name=APP_ID value=myid / param name=APP_NAME value=myname / /gap:plugin gap:plugin name=com.admob.google source=plugins.cordova.io / {code} Otherwise, if you are using the library as a dependency, because you are building a plugin, this is the right way to use it. Deploying plugins for iOS frameworks breaks symlinks Key: CB-6092 URL: https://issues.apache.org/jira/browse/CB-6092 Project: Apache Cordova Issue Type: Bug Components: Plugman, Registry Web Affects Versions: 3.3.0 Environment: OSX 10.9.1 Reporter: Song Zheng Priority: Critical Fix For: Master my Plugin has an included ios framework, which resides in Opentok.framework directory. Most iOS frameworks have symlinks within the directory. For example, in the current framework I use, these are the folders listed and their corresponding symlinks: Headers - Versions/Current/Headers Opentok - Versions/Current/Opentok Resources - Versions/Current/Resources Versions After publishing my plugin, symlinks seems to be missing. When I install the plugin into my app, typing 'ls' in my framework directory only produces one folder: Versions Plugin publish seems to be unable to upload symlinks? This issue does not exist if I install the plugin directly from the git source: 'cordova plugin add https://github.com/opentok/cordova-plugin-opentok' ML thread: http://markmail.org/thread/2mbqwaviwvuitngh -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8706) Camera should use filepicker if saveToPhotoAlbum is true
[ https://issues.apache.org/jira/browse/CB-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386474#comment-14386474 ] ASF GitHub Bot commented on CB-8706: Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/78#discussion_r27377359 --- Diff: src/windows/CameraProxy.js --- @@ -43,399 +43,468 @@ module.exports = { // 11 cameraDirection:0 takePicture: function (successCallback, errorCallback, args) { -var encodingType = args[5]; -var targetWidth = args[3]; -var targetHeight = args[4]; var sourceType = args[2]; -var destinationType = args[1]; -var mediaType = args[6]; -var allowCrop = !!args[7]; -var saveToPhotoAlbum = args[9]; -var cameraDirection = args[11]; - -// resize method :) -var resizeImage = function (file) { -var tempPhotoFileName = ; -if (encodingType == Camera.EncodingType.PNG) { -tempPhotoFileName = camera_cordova_temp_return.png; -} else { -tempPhotoFileName = camera_cordova_temp_return.jpg; -} - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; -file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) { - Windows.Storage.FileIO.readBufferAsync(storageFile).then(function(buffer) { -var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); -var imageData = data: + file.contentType + ;base64, + strBase64; -var image = new Image(); -image.src = imageData; -image.onload = function() { -var imageWidth = targetWidth, -imageHeight = targetHeight; -var canvas = document.createElement('canvas'); - -canvas.width = imageWidth; -canvas.height = imageHeight; -canvas.getContext(2d).drawImage(this, 0, 0, imageWidth, imageHeight); - -var fileContent = canvas.toDataURL(file.contentType).split(',')[1]; - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +if (sourceType != Camera.PictureSourceType.CAMERA) { +takePictureFromFile(successCallback, errorCallback, args); +} else { +takePictureFromCamera(successCallback, errorCallback, args); +} +} +}; -storageFolder.createFileAsync(tempPhotoFileName, Windows.Storage.CreationCollisionOption.generateUniqueName).done(function (storagefile) { -var content = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(fileContent); - Windows.Storage.FileIO.writeBufferAsync(storagefile, content).then(function () { -successCallback(ms-appdata:///local/ + storagefile.name); -}, function () { -errorCallback(Resize picture error.); -}); -}); -}; -}); -}, function () { -errorCallback(Can't access localStorage folder); -}); -}; +// Resize method +function resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType) { +var tempPhotoFileName = ; +if (encodingType == Camera.EncodingType.PNG) { +tempPhotoFileName = camera_cordova_temp_return.png; +} else { +tempPhotoFileName = camera_cordova_temp_return.jpg; +} -// because of asynchronous method, so let the successCallback be called in it. -var resizeImageBase64 = function (file) { +var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting) +.then(function (storageFile) { return Windows.Storage.FileIO.readBufferAsync(storageFile); }) +.then(function(buffer) { +var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); +var imageData = data: + file.contentType + ;base64, + strBase64; +var image = new Image();
[jira] [Commented] (CB-8706) Camera should use filepicker if saveToPhotoAlbum is true
[ https://issues.apache.org/jira/browse/CB-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386467#comment-14386467 ] ASF GitHub Bot commented on CB-8706: Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/78#discussion_r27377322 --- Diff: src/windows/CameraProxy.js --- @@ -43,399 +43,468 @@ module.exports = { // 11 cameraDirection:0 takePicture: function (successCallback, errorCallback, args) { -var encodingType = args[5]; -var targetWidth = args[3]; -var targetHeight = args[4]; var sourceType = args[2]; -var destinationType = args[1]; -var mediaType = args[6]; -var allowCrop = !!args[7]; -var saveToPhotoAlbum = args[9]; -var cameraDirection = args[11]; - -// resize method :) -var resizeImage = function (file) { -var tempPhotoFileName = ; -if (encodingType == Camera.EncodingType.PNG) { -tempPhotoFileName = camera_cordova_temp_return.png; -} else { -tempPhotoFileName = camera_cordova_temp_return.jpg; -} - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; -file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) { - Windows.Storage.FileIO.readBufferAsync(storageFile).then(function(buffer) { -var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); -var imageData = data: + file.contentType + ;base64, + strBase64; -var image = new Image(); -image.src = imageData; -image.onload = function() { -var imageWidth = targetWidth, -imageHeight = targetHeight; -var canvas = document.createElement('canvas'); - -canvas.width = imageWidth; -canvas.height = imageHeight; -canvas.getContext(2d).drawImage(this, 0, 0, imageWidth, imageHeight); - -var fileContent = canvas.toDataURL(file.contentType).split(',')[1]; - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +if (sourceType != Camera.PictureSourceType.CAMERA) { +takePictureFromFile(successCallback, errorCallback, args); +} else { +takePictureFromCamera(successCallback, errorCallback, args); +} +} +}; -storageFolder.createFileAsync(tempPhotoFileName, Windows.Storage.CreationCollisionOption.generateUniqueName).done(function (storagefile) { -var content = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(fileContent); - Windows.Storage.FileIO.writeBufferAsync(storagefile, content).then(function () { -successCallback(ms-appdata:///local/ + storagefile.name); -}, function () { -errorCallback(Resize picture error.); -}); -}); -}; -}); -}, function () { -errorCallback(Can't access localStorage folder); -}); -}; +// Resize method +function resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType) { --- End diff -- This method contains a lot of duplicated functionality from `resizeImageBase64`. Consider reuse of `resizeImageBase64` for B64 encoding purposes. Camera should use filepicker if saveToPhotoAlbum is true Key: CB-8706 URL: https://issues.apache.org/jira/browse/CB-8706 Project: Apache Cordova Issue Type: Bug Components: Plugin Camera Reporter: Murat Sutunc Assignee: Murat Sutunc Priority: Minor Currently camera plugin is saving pictures programmatically to pictures library. It should use filePicker to not require unnecessary capabilities. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail:
[jira] [Created] (CB-8770) Specify Camera Direction
Matthew Keable created CB-8770: -- Summary: Specify Camera Direction Key: CB-8770 URL: https://issues.apache.org/jira/browse/CB-8770 Project: Apache Cordova Issue Type: New Feature Reporter: Matthew Keable Priority: Minor Would it be possible to add an option similar to the camera plugin that allows the user to specify the direction of the camera when they call camera.captureVideo? -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8706) Camera should use filepicker if saveToPhotoAlbum is true
[ https://issues.apache.org/jira/browse/CB-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386471#comment-14386471 ] ASF GitHub Bot commented on CB-8706: Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/78#discussion_r27377337 --- Diff: src/windows/CameraProxy.js --- @@ -43,399 +43,468 @@ module.exports = { // 11 cameraDirection:0 takePicture: function (successCallback, errorCallback, args) { -var encodingType = args[5]; -var targetWidth = args[3]; -var targetHeight = args[4]; var sourceType = args[2]; -var destinationType = args[1]; -var mediaType = args[6]; -var allowCrop = !!args[7]; -var saveToPhotoAlbum = args[9]; -var cameraDirection = args[11]; - -// resize method :) -var resizeImage = function (file) { -var tempPhotoFileName = ; -if (encodingType == Camera.EncodingType.PNG) { -tempPhotoFileName = camera_cordova_temp_return.png; -} else { -tempPhotoFileName = camera_cordova_temp_return.jpg; -} - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; -file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) { - Windows.Storage.FileIO.readBufferAsync(storageFile).then(function(buffer) { -var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); -var imageData = data: + file.contentType + ;base64, + strBase64; -var image = new Image(); -image.src = imageData; -image.onload = function() { -var imageWidth = targetWidth, -imageHeight = targetHeight; -var canvas = document.createElement('canvas'); - -canvas.width = imageWidth; -canvas.height = imageHeight; -canvas.getContext(2d).drawImage(this, 0, 0, imageWidth, imageHeight); - -var fileContent = canvas.toDataURL(file.contentType).split(',')[1]; - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +if (sourceType != Camera.PictureSourceType.CAMERA) { +takePictureFromFile(successCallback, errorCallback, args); +} else { +takePictureFromCamera(successCallback, errorCallback, args); +} +} +}; -storageFolder.createFileAsync(tempPhotoFileName, Windows.Storage.CreationCollisionOption.generateUniqueName).done(function (storagefile) { -var content = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(fileContent); - Windows.Storage.FileIO.writeBufferAsync(storagefile, content).then(function () { -successCallback(ms-appdata:///local/ + storagefile.name); -}, function () { -errorCallback(Resize picture error.); -}); -}); -}; -}); -}, function () { -errorCallback(Can't access localStorage folder); -}); -}; +// Resize method +function resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType) { +var tempPhotoFileName = ; +if (encodingType == Camera.EncodingType.PNG) { +tempPhotoFileName = camera_cordova_temp_return.png; +} else { +tempPhotoFileName = camera_cordova_temp_return.jpg; +} -// because of asynchronous method, so let the successCallback be called in it. -var resizeImageBase64 = function (file) { +var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting) +.then(function (storageFile) { return Windows.Storage.FileIO.readBufferAsync(storageFile); }) +.then(function(buffer) { +var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); +var imageData = data: + file.contentType + ;base64, + strBase64; +var image = new Image();
[jira] [Commented] (CB-8706) Camera should use filepicker if saveToPhotoAlbum is true
[ https://issues.apache.org/jira/browse/CB-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386472#comment-14386472 ] ASF GitHub Bot commented on CB-8706: Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/78#discussion_r27377348 --- Diff: src/windows/CameraProxy.js --- @@ -43,399 +43,468 @@ module.exports = { // 11 cameraDirection:0 takePicture: function (successCallback, errorCallback, args) { -var encodingType = args[5]; -var targetWidth = args[3]; -var targetHeight = args[4]; var sourceType = args[2]; -var destinationType = args[1]; -var mediaType = args[6]; -var allowCrop = !!args[7]; -var saveToPhotoAlbum = args[9]; -var cameraDirection = args[11]; - -// resize method :) -var resizeImage = function (file) { -var tempPhotoFileName = ; -if (encodingType == Camera.EncodingType.PNG) { -tempPhotoFileName = camera_cordova_temp_return.png; -} else { -tempPhotoFileName = camera_cordova_temp_return.jpg; -} - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; -file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) { - Windows.Storage.FileIO.readBufferAsync(storageFile).then(function(buffer) { -var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); -var imageData = data: + file.contentType + ;base64, + strBase64; -var image = new Image(); -image.src = imageData; -image.onload = function() { -var imageWidth = targetWidth, -imageHeight = targetHeight; -var canvas = document.createElement('canvas'); - -canvas.width = imageWidth; -canvas.height = imageHeight; -canvas.getContext(2d).drawImage(this, 0, 0, imageWidth, imageHeight); - -var fileContent = canvas.toDataURL(file.contentType).split(',')[1]; - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +if (sourceType != Camera.PictureSourceType.CAMERA) { +takePictureFromFile(successCallback, errorCallback, args); +} else { +takePictureFromCamera(successCallback, errorCallback, args); +} +} +}; -storageFolder.createFileAsync(tempPhotoFileName, Windows.Storage.CreationCollisionOption.generateUniqueName).done(function (storagefile) { -var content = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(fileContent); - Windows.Storage.FileIO.writeBufferAsync(storagefile, content).then(function () { -successCallback(ms-appdata:///local/ + storagefile.name); -}, function () { -errorCallback(Resize picture error.); -}); -}); -}; -}); -}, function () { -errorCallback(Can't access localStorage folder); -}); -}; +// Resize method +function resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType) { +var tempPhotoFileName = ; +if (encodingType == Camera.EncodingType.PNG) { +tempPhotoFileName = camera_cordova_temp_return.png; +} else { +tempPhotoFileName = camera_cordova_temp_return.jpg; +} -// because of asynchronous method, so let the successCallback be called in it. -var resizeImageBase64 = function (file) { +var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting) +.then(function (storageFile) { return Windows.Storage.FileIO.readBufferAsync(storageFile); }) +.then(function(buffer) { +var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); +var imageData = data: + file.contentType + ;base64, + strBase64; +var image = new Image();
[jira] [Commented] (CB-8706) Camera should use filepicker if saveToPhotoAlbum is true
[ https://issues.apache.org/jira/browse/CB-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386473#comment-14386473 ] ASF GitHub Bot commented on CB-8706: Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/78#discussion_r27377356 --- Diff: src/windows/CameraProxy.js --- @@ -43,399 +43,468 @@ module.exports = { // 11 cameraDirection:0 takePicture: function (successCallback, errorCallback, args) { -var encodingType = args[5]; -var targetWidth = args[3]; -var targetHeight = args[4]; var sourceType = args[2]; -var destinationType = args[1]; -var mediaType = args[6]; -var allowCrop = !!args[7]; -var saveToPhotoAlbum = args[9]; -var cameraDirection = args[11]; - -// resize method :) -var resizeImage = function (file) { -var tempPhotoFileName = ; -if (encodingType == Camera.EncodingType.PNG) { -tempPhotoFileName = camera_cordova_temp_return.png; -} else { -tempPhotoFileName = camera_cordova_temp_return.jpg; -} - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; -file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) { - Windows.Storage.FileIO.readBufferAsync(storageFile).then(function(buffer) { -var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); -var imageData = data: + file.contentType + ;base64, + strBase64; -var image = new Image(); -image.src = imageData; -image.onload = function() { -var imageWidth = targetWidth, -imageHeight = targetHeight; -var canvas = document.createElement('canvas'); - -canvas.width = imageWidth; -canvas.height = imageHeight; -canvas.getContext(2d).drawImage(this, 0, 0, imageWidth, imageHeight); - -var fileContent = canvas.toDataURL(file.contentType).split(',')[1]; - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +if (sourceType != Camera.PictureSourceType.CAMERA) { +takePictureFromFile(successCallback, errorCallback, args); +} else { +takePictureFromCamera(successCallback, errorCallback, args); +} +} +}; -storageFolder.createFileAsync(tempPhotoFileName, Windows.Storage.CreationCollisionOption.generateUniqueName).done(function (storagefile) { -var content = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(fileContent); - Windows.Storage.FileIO.writeBufferAsync(storagefile, content).then(function () { -successCallback(ms-appdata:///local/ + storagefile.name); -}, function () { -errorCallback(Resize picture error.); -}); -}); -}; -}); -}, function () { -errorCallback(Can't access localStorage folder); -}); -}; +// Resize method +function resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType) { +var tempPhotoFileName = ; +if (encodingType == Camera.EncodingType.PNG) { +tempPhotoFileName = camera_cordova_temp_return.png; +} else { +tempPhotoFileName = camera_cordova_temp_return.jpg; +} -// because of asynchronous method, so let the successCallback be called in it. -var resizeImageBase64 = function (file) { +var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting) +.then(function (storageFile) { return Windows.Storage.FileIO.readBufferAsync(storageFile); }) +.then(function(buffer) { +var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); +var imageData = data: + file.contentType + ;base64, + strBase64; +var image = new Image();
[jira] [Commented] (CB-8706) Camera should use filepicker if saveToPhotoAlbum is true
[ https://issues.apache.org/jira/browse/CB-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386470#comment-14386470 ] ASF GitHub Bot commented on CB-8706: Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/78#discussion_r27377331 --- Diff: src/windows/CameraProxy.js --- @@ -43,399 +43,468 @@ module.exports = { // 11 cameraDirection:0 takePicture: function (successCallback, errorCallback, args) { -var encodingType = args[5]; -var targetWidth = args[3]; -var targetHeight = args[4]; var sourceType = args[2]; -var destinationType = args[1]; -var mediaType = args[6]; -var allowCrop = !!args[7]; -var saveToPhotoAlbum = args[9]; -var cameraDirection = args[11]; - -// resize method :) -var resizeImage = function (file) { -var tempPhotoFileName = ; -if (encodingType == Camera.EncodingType.PNG) { -tempPhotoFileName = camera_cordova_temp_return.png; -} else { -tempPhotoFileName = camera_cordova_temp_return.jpg; -} - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; -file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) { - Windows.Storage.FileIO.readBufferAsync(storageFile).then(function(buffer) { -var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); -var imageData = data: + file.contentType + ;base64, + strBase64; -var image = new Image(); -image.src = imageData; -image.onload = function() { -var imageWidth = targetWidth, -imageHeight = targetHeight; -var canvas = document.createElement('canvas'); - -canvas.width = imageWidth; -canvas.height = imageHeight; -canvas.getContext(2d).drawImage(this, 0, 0, imageWidth, imageHeight); - -var fileContent = canvas.toDataURL(file.contentType).split(',')[1]; - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +if (sourceType != Camera.PictureSourceType.CAMERA) { +takePictureFromFile(successCallback, errorCallback, args); +} else { +takePictureFromCamera(successCallback, errorCallback, args); +} +} +}; -storageFolder.createFileAsync(tempPhotoFileName, Windows.Storage.CreationCollisionOption.generateUniqueName).done(function (storagefile) { -var content = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(fileContent); - Windows.Storage.FileIO.writeBufferAsync(storagefile, content).then(function () { -successCallback(ms-appdata:///local/ + storagefile.name); -}, function () { -errorCallback(Resize picture error.); -}); -}); -}; -}); -}, function () { -errorCallback(Can't access localStorage folder); -}); -}; +// Resize method +function resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType) { +var tempPhotoFileName = ; +if (encodingType == Camera.EncodingType.PNG) { +tempPhotoFileName = camera_cordova_temp_return.png; +} else { +tempPhotoFileName = camera_cordova_temp_return.jpg; +} -// because of asynchronous method, so let the successCallback be called in it. -var resizeImageBase64 = function (file) { +var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting) +.then(function (storageFile) { return Windows.Storage.FileIO.readBufferAsync(storageFile); }) +.then(function(buffer) { +var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); +var imageData = data: + file.contentType + ;base64, + strBase64; +var image = new Image();
[jira] [Commented] (CB-8706) Camera should use filepicker if saveToPhotoAlbum is true
[ https://issues.apache.org/jira/browse/CB-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386468#comment-14386468 ] ASF GitHub Bot commented on CB-8706: Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/78#discussion_r27377326 --- Diff: src/windows/CameraProxy.js --- @@ -43,399 +43,468 @@ module.exports = { // 11 cameraDirection:0 takePicture: function (successCallback, errorCallback, args) { -var encodingType = args[5]; -var targetWidth = args[3]; -var targetHeight = args[4]; var sourceType = args[2]; -var destinationType = args[1]; -var mediaType = args[6]; -var allowCrop = !!args[7]; -var saveToPhotoAlbum = args[9]; -var cameraDirection = args[11]; - -// resize method :) -var resizeImage = function (file) { -var tempPhotoFileName = ; -if (encodingType == Camera.EncodingType.PNG) { -tempPhotoFileName = camera_cordova_temp_return.png; -} else { -tempPhotoFileName = camera_cordova_temp_return.jpg; -} - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; -file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).then(function (storageFile) { - Windows.Storage.FileIO.readBufferAsync(storageFile).then(function(buffer) { -var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); -var imageData = data: + file.contentType + ;base64, + strBase64; -var image = new Image(); -image.src = imageData; -image.onload = function() { -var imageWidth = targetWidth, -imageHeight = targetHeight; -var canvas = document.createElement('canvas'); - -canvas.width = imageWidth; -canvas.height = imageHeight; -canvas.getContext(2d).drawImage(this, 0, 0, imageWidth, imageHeight); - -var fileContent = canvas.toDataURL(file.contentType).split(',')[1]; - -var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +if (sourceType != Camera.PictureSourceType.CAMERA) { +takePictureFromFile(successCallback, errorCallback, args); +} else { +takePictureFromCamera(successCallback, errorCallback, args); +} +} +}; -storageFolder.createFileAsync(tempPhotoFileName, Windows.Storage.CreationCollisionOption.generateUniqueName).done(function (storagefile) { -var content = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(fileContent); - Windows.Storage.FileIO.writeBufferAsync(storagefile, content).then(function () { -successCallback(ms-appdata:///local/ + storagefile.name); -}, function () { -errorCallback(Resize picture error.); -}); -}); -}; -}); -}, function () { -errorCallback(Can't access localStorage folder); -}); -}; +// Resize method +function resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType) { +var tempPhotoFileName = ; +if (encodingType == Camera.EncodingType.PNG) { +tempPhotoFileName = camera_cordova_temp_return.png; +} else { +tempPhotoFileName = camera_cordova_temp_return.jpg; +} -// because of asynchronous method, so let the successCallback be called in it. -var resizeImageBase64 = function (file) { +var storageFolder = Windows.Storage.ApplicationData.current.localFolder; +file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting) +.then(function (storageFile) { return Windows.Storage.FileIO.readBufferAsync(storageFile); }) +.then(function(buffer) { +var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer); +var imageData = data: + file.contentType + ;base64, + strBase64; +var image = new Image();
[jira] [Closed] (CB-8649) Media Plugin WP8.1 Media.getDuration returns -1 for audio (mp3) asset
[ https://issues.apache.org/jira/browse/CB-8649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vladimir Kotikov closed CB-8649. Resolution: Duplicate Media Plugin WP8.1 Media.getDuration returns -1 for audio (mp3) asset - Key: CB-8649 URL: https://issues.apache.org/jira/browse/CB-8649 Project: Apache Cordova Issue Type: Bug Reporter: Kim Hansen Assignee: Vladimir Kotikov Priority: Minor It is understood that WP8.1 is not supported (hence minor priority) but when support is added this is fixable. Media plugin 0.2.13, Cordova 4.2.0, Tools for Apache Cordova The duration can be found at Media.node.duration -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8337) Keyboard plugin resizes incorrectly with external keyboard attached
[ https://issues.apache.org/jira/browse/CB-8337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386743#comment-14386743 ] ASF GitHub Bot commented on CB-8337: Github user agrieve commented on the pull request: https://github.com/apache/cordova-plugins/pull/18#issuecomment-87696102 Merged this in, but last I recall discussing the plugin on the dev mailinglist, I don't think anyone was interested in pursuing it. Might try raising the subject again to see, but otherwise I think it'd be awesome if you wanted to fork it and maintain a defacto version of it? Keyboard plugin resizes incorrectly with external keyboard attached --- Key: CB-8337 URL: https://issues.apache.org/jira/browse/CB-8337 Project: Apache Cordova Issue Type: Bug Components: Plugin Keyboard Environment: iOS Reporter: Connor Pearson When using an external keyboard, the keyboard plugin should only shrink the webview enough to accommodate the accessory bar. It instead shrinks an area the size of the full keyboard, leaving an empty space. See http://i.imgur.com/pKh53JR.png -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-6092) Deploying plugins for iOS frameworks breaks symlinks
[ https://issues.apache.org/jira/browse/CB-6092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386713#comment-14386713 ] Colin Bau commented on CB-6092: --- hi Miquel I just want to build success in PGB (build.phonegap.com) with Android and iOS for now I use your code in my PGB's config.xml but still build fail in iOS... Deploying plugins for iOS frameworks breaks symlinks Key: CB-6092 URL: https://issues.apache.org/jira/browse/CB-6092 Project: Apache Cordova Issue Type: Bug Components: Plugman, Registry Web Affects Versions: 3.3.0 Environment: OSX 10.9.1 Reporter: Song Zheng Priority: Critical Fix For: Master my Plugin has an included ios framework, which resides in Opentok.framework directory. Most iOS frameworks have symlinks within the directory. For example, in the current framework I use, these are the folders listed and their corresponding symlinks: Headers - Versions/Current/Headers Opentok - Versions/Current/Opentok Resources - Versions/Current/Resources Versions After publishing my plugin, symlinks seems to be missing. When I install the plugin into my app, typing 'ls' in my framework directory only produces one folder: Versions Plugin publish seems to be unable to upload symlinks? This issue does not exist if I install the plugin directly from the git source: 'cordova plugin add https://github.com/opentok/cordova-plugin-opentok' ML thread: http://markmail.org/thread/2mbqwaviwvuitngh -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-6092) Deploying plugins for iOS frameworks breaks symlinks
[ https://issues.apache.org/jira/browse/CB-6092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386714#comment-14386714 ] Colin Bau commented on CB-6092: --- hi Miquel I just want to build success in PGB (build.phonegap.com) with Android and iOS for now I use your code in my PGB's config.xml but still build fail in iOS... Deploying plugins for iOS frameworks breaks symlinks Key: CB-6092 URL: https://issues.apache.org/jira/browse/CB-6092 Project: Apache Cordova Issue Type: Bug Components: Plugman, Registry Web Affects Versions: 3.3.0 Environment: OSX 10.9.1 Reporter: Song Zheng Priority: Critical Fix For: Master my Plugin has an included ios framework, which resides in Opentok.framework directory. Most iOS frameworks have symlinks within the directory. For example, in the current framework I use, these are the folders listed and their corresponding symlinks: Headers - Versions/Current/Headers Opentok - Versions/Current/Opentok Resources - Versions/Current/Resources Versions After publishing my plugin, symlinks seems to be missing. When I install the plugin into my app, typing 'ls' in my framework directory only produces one folder: Versions Plugin publish seems to be unable to upload symlinks? This issue does not exist if I install the plugin directly from the git source: 'cordova plugin add https://github.com/opentok/cordova-plugin-opentok' ML thread: http://markmail.org/thread/2mbqwaviwvuitngh -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8768) if MainActivity is killed by Android OS after a plugin started a new activity onActivityResult gets called before the plugin needed to handle the result is loaded
[ https://issues.apache.org/jira/browse/CB-8768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386737#comment-14386737 ] ASF GitHub Bot commented on CB-8768: Github user thehuijb closed the pull request at: https://github.com/apache/cordova-android/pull/170 if MainActivity is killed by Android OS after a plugin started a new activity onActivityResult gets called before the plugin needed to handle the result is loaded -- Key: CB-8768 URL: https://issues.apache.org/jira/browse/CB-8768 Project: Apache Cordova Issue Type: Bug Components: Android Reporter: Serge Huijben if one of the plugins launches startActivityForResult and the Android OS decides to kill our MainActivity. what happens when the launched activity is closed. the previous activity (our MainActivity is relaunched and onActivityResult is called, our mainActivity however has not yet had the time to load all onload=true plugins so therefore the savedInstanceState callBackService can not be called. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8768) if MainActivity is killed by Android OS after a plugin started a new activity onActivityResult gets called before the plugin needed to handle the result is loaded
[ https://issues.apache.org/jira/browse/CB-8768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386736#comment-14386736 ] ASF GitHub Bot commented on CB-8768: Github user thehuijb commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/170#discussion_r27392930 --- Diff: framework/src/org/apache/cordova/CordovaActivity.java --- @@ -314,10 +318,52 @@ public void startActivityForResult(Intent intent, int requestCode, Bundle option * @param intentAn Intent, which can return result data to the caller (various data can be attached to Intent extras). */ @Override -protected void onActivityResult(int requestCode, int resultCode, Intent intent) { +protected void onActivityResult(final int requestCode, final int resultCode, final Intent intent) { LOG.d(TAG, Incoming Result. Request code = + requestCode); super.onActivityResult(requestCode, resultCode, intent); -cordovaInterface.onActivityResult(requestCode, resultCode, intent); +// check if plugins are ready to receive the result +if (this.pluginsReady) { +cordovaInterface.onActivityResult(requestCode, resultCode, intent); +this.findCallbackTries = 0; +} else { +/** + * If the Android OS kills this activity when a plugin launches an a new activity + * the onActivityResult event fires before the onResume event + * so we have to wait for the plugins to be loaded again before we can hand the result to the correct plugin. + */ +final ScheduledThreadPoolExecutor exec = new ScheduledThreadPoolExecutor(1); --- End diff -- thanks for having a look and commenting. if MainActivity is killed by Android OS after a plugin started a new activity onActivityResult gets called before the plugin needed to handle the result is loaded -- Key: CB-8768 URL: https://issues.apache.org/jira/browse/CB-8768 Project: Apache Cordova Issue Type: Bug Components: Android Reporter: Serge Huijben if one of the plugins launches startActivityForResult and the Android OS decides to kill our MainActivity. what happens when the launched activity is closed. the previous activity (our MainActivity is relaunched and onActivityResult is called, our mainActivity however has not yet had the time to load all onload=true plugins so therefore the savedInstanceState callBackService can not be called. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8337) Keyboard plugin resizes incorrectly with external keyboard attached
[ https://issues.apache.org/jira/browse/CB-8337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386738#comment-14386738 ] ASF GitHub Bot commented on CB-8337: Github user asfgit closed the pull request at: https://github.com/apache/cordova-plugins/pull/18 Keyboard plugin resizes incorrectly with external keyboard attached --- Key: CB-8337 URL: https://issues.apache.org/jira/browse/CB-8337 Project: Apache Cordova Issue Type: Bug Components: Plugin Keyboard Environment: iOS Reporter: Connor Pearson When using an external keyboard, the keyboard plugin should only shrink the webview enough to accommodate the accessory bar. It instead shrinks an area the size of the full keyboard, leaving an empty space. See http://i.imgur.com/pKh53JR.png -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8345) Splash screen does not display on Android.
[ https://issues.apache.org/jira/browse/CB-8345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386718#comment-14386718 ] ASF subversion and git services commented on CB-8345: - Commit 9b3f750085c08de9a4210079af52786851da4f80 in cordova-plugin-splashscreen's branch refs/heads/master from [~agrieve] [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-splashscreen.git;h=9b3f750 ] CB-8345 Make default for splashscreen resource screen (which is what template and CLI assume it to be) Splash screen does not display on Android. -- Key: CB-8345 URL: https://issues.apache.org/jira/browse/CB-8345 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaLib Environment: OS: Ubuntu 14.04 LTS/x64 Node.js: 0.10.35 Cordova: 4.2.0 Reporter: Tomo Masakura Assignee: Andrew Grieve Splash screen does not display on Android. On iOS it is displayed. {quote} $ cordova --version 4.2.0 $ cordova create project1 $ cd project1 $ cordova platform add android ios $ cordova emulate {quote} The iOS simulator splash screen is displayed. However, the Android Emulator it is not displayed. It seems to be resolved by adding the following sentence to the config.xml, but wanting to be displayed in the default state. {quote} preference name=SplashScreen value=screen / {quote} It seems to be solved by modifying the CordovaActivity.java. {quote} $ diff -Nur CordovaActivity.java.orig CordovaActivity.java --- CordovaActivity.java.orig 2015-01-22 16:39:42.0 +0900 +++ CordovaActivity.java2015-01-22 16:39:56.0 +0900 @@ -359,7 +359,7 @@ init(); } this.splashscreenTime = preferences.getInteger(SplashScreenDelay, this.splashscreenTime); -String splash = preferences.getString(SplashScreen, null); +String splash = preferences.getString(SplashScreen, screen); if(this.splashscreenTime 0 splash != null) { this.splashscreen = getResources().getIdentifier(splash, drawable, getClass().getPackage().getName());; {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8345) Splash screen does not display on Android.
[ https://issues.apache.org/jira/browse/CB-8345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386719#comment-14386719 ] Andrew Grieve commented on CB-8345: --- Thanks [~tomo_masakura]! I've fixed it up. Splash screen does not display on Android. -- Key: CB-8345 URL: https://issues.apache.org/jira/browse/CB-8345 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaLib Environment: OS: Ubuntu 14.04 LTS/x64 Node.js: 0.10.35 Cordova: 4.2.0 Reporter: Tomo Masakura Assignee: Andrew Grieve Splash screen does not display on Android. On iOS it is displayed. {quote} $ cordova --version 4.2.0 $ cordova create project1 $ cd project1 $ cordova platform add android ios $ cordova emulate {quote} The iOS simulator splash screen is displayed. However, the Android Emulator it is not displayed. It seems to be resolved by adding the following sentence to the config.xml, but wanting to be displayed in the default state. {quote} preference name=SplashScreen value=screen / {quote} It seems to be solved by modifying the CordovaActivity.java. {quote} $ diff -Nur CordovaActivity.java.orig CordovaActivity.java --- CordovaActivity.java.orig 2015-01-22 16:39:42.0 +0900 +++ CordovaActivity.java2015-01-22 16:39:56.0 +0900 @@ -359,7 +359,7 @@ init(); } this.splashscreenTime = preferences.getInteger(SplashScreenDelay, this.splashscreenTime); -String splash = preferences.getString(SplashScreen, null); +String splash = preferences.getString(SplashScreen, screen); if(this.splashscreenTime 0 splash != null) { this.splashscreen = getResources().getIdentifier(splash, drawable, getClass().getPackage().getName());; {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8768) if MainActivity is killed by Android OS after a plugin started a new activity onActivityResult gets called before the plugin needed to handle the result is loaded
[ https://issues.apache.org/jira/browse/CB-8768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386728#comment-14386728 ] ASF GitHub Bot commented on CB-8768: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/170#discussion_r27391907 --- Diff: framework/src/org/apache/cordova/CordovaActivity.java --- @@ -314,10 +318,52 @@ public void startActivityForResult(Intent intent, int requestCode, Bundle option * @param intentAn Intent, which can return result data to the caller (various data can be attached to Intent extras). */ @Override -protected void onActivityResult(int requestCode, int resultCode, Intent intent) { +protected void onActivityResult(final int requestCode, final int resultCode, final Intent intent) { LOG.d(TAG, Incoming Result. Request code = + requestCode); super.onActivityResult(requestCode, resultCode, intent); -cordovaInterface.onActivityResult(requestCode, resultCode, intent); +// check if plugins are ready to receive the result +if (this.pluginsReady) { +cordovaInterface.onActivityResult(requestCode, resultCode, intent); +this.findCallbackTries = 0; +} else { +/** + * If the Android OS kills this activity when a plugin launches an a new activity + * the onActivityResult event fires before the onResume event + * so we have to wait for the plugins to be loaded again before we can hand the result to the correct plugin. + */ +final ScheduledThreadPoolExecutor exec = new ScheduledThreadPoolExecutor(1); --- End diff -- Using a separate thread to accomplish what you want here is a bit overcomplicated and as is has the unwanted side-effect that the callback will be called on a non-UI thread. We also don't want to wait for a resume event to fire this. I'd suggest instead: - Call `CordovaInterfaceImpl.onActivityResult()`, as before (probably just revert all changes to CordovaActivity). - Have `onActivityResult` just store the result if no initialization has happened yet. - Change `CordovaInterfaceImpl.setPluginManager(pluginManager)` to `onCordovaInit(pluginManager)` - Have `onCordovaInit` dispatch any pending result to the pluginManager (plugins services should be registered by now). if MainActivity is killed by Android OS after a plugin started a new activity onActivityResult gets called before the plugin needed to handle the result is loaded -- Key: CB-8768 URL: https://issues.apache.org/jira/browse/CB-8768 Project: Apache Cordova Issue Type: Bug Components: Android Reporter: Serge Huijben if one of the plugins launches startActivityForResult and the Android OS decides to kill our MainActivity. what happens when the launched activity is closed. the previous activity (our MainActivity is relaunched and onActivityResult is called, our mainActivity however has not yet had the time to load all onload=true plugins so therefore the savedInstanceState callBackService can not be called. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-6289) Keyboard for Android
[ https://issues.apache.org/jira/browse/CB-6289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386741#comment-14386741 ] ASF GitHub Bot commented on CB-6289: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-plugins/pull/15#discussion_r27393159 --- Diff: keyboard/src/android/Keyboard.java --- @@ -0,0 +1,124 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + License); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ +package org.apache.cordova.labs.keyboard; + +import org.apache.cordova.CallbackContext; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.CordovaWebView; +import org.apache.cordova.LOG; +import org.json.JSONArray; +import org.json.JSONException; + +import android.app.Activity; +import android.content.Context; +import android.graphics.Rect; +import android.util.DisplayMetrics; +import android.view.View; +import android.view.ViewTreeObserver.OnGlobalLayoutListener; +import android.view.inputmethod.InputMethodManager; + +public class Keyboard extends CordovaPlugin { +/** +* Delta height of the visible area, to be treated as keyboard opening. +*/ +private final static int MinHeghtDelta = 100; +private static final String TAG = Keyboard; + +public void initialize(CordovaInterface cordova, CordovaWebView webView) { +super.initialize(cordova, webView); + +Activity activity = cordova.getActivity(); +DisplayMetrics metrics = new DisplayMetrics(); + activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); +final float density = metrics.density; + +final CordovaWebView appView = webView; + +final View rootView = activity.getWindow().getDecorView().findViewById(android.R.id.content).getRootView(); +OnGlobalLayoutListener list = new OnGlobalLayoutListener() { +int previousHeightDifference = 0; + +@Override +public void onGlobalLayout() { +LOG.d(TAG, Entering global layout notification); + + Rect visibleRect = new Rect(); +//r will be populated with the coordinates of your view that area still visible. +rootView.getWindowVisibleDisplayFrame(visibleRect); + +int visibleHeight = visibleRect.bottom - visibleRect.top; +int viewHeight = rootView.getRootView().getHeight(); +int heightDifference = (int)((viewHeight - visibleHeight) / density); +if (heightDifference MinHeghtDelta + heightDifference != previousHeightDifference) { +// If the height of the view is bigger then +// visible area by delta, then assume that keyboard +// is shown on the screen. +appView.sendJavascript(Keyboard.isVisible = true; if (Keyboard.onshow) Keyboard.onshow();); +} +else if (heightDifference != previousHeightDifference + (previousHeightDifference - heightDifference) MinHeghtDelta){ +// If the difference between visible and view area dropped by the delta +// then assume that this means that keyboard is hidden. +appView.sendJavascript(Keyboard.isVisible = false; if (Keyboard.onhide) Keyboard.onhide();); --- End diff -- Rather than calling an `onhide` function, I'd suggest you wire this up to fire a window event via `cordova.fireWindowEvent` Keyboard for Android Key: CB-6289 URL: https://issues.apache.org/jira/browse/CB-6289 Project:
[jira] [Commented] (CB-8717) Write cordova-android@4.0.0 release notes
[ https://issues.apache.org/jira/browse/CB-8717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386764#comment-14386764 ] ASF subversion and git services commented on CB-8717: - Commit d96d49329b59e521a02f51b71218426d4d80468c in cordova-android's branch refs/heads/master from [~agrieve] [ https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;h=d96d493 ] CB-8717 Add note to releasenotes about removal of hidekeyboard and showkeyboard events Write cordova-android@4.0.0 release notes - Key: CB-8717 URL: https://issues.apache.org/jira/browse/CB-8717 Project: Apache Cordova Issue Type: Task Components: Android Reporter: Andrew Grieve Assignee: Andrew Grieve Priority: Minor These will be hefty! Best to get them done before starting release process. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8345) Splash screen does not display on Android.
[ https://issues.apache.org/jira/browse/CB-8345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386717#comment-14386717 ] ASF subversion and git services commented on CB-8345: - Commit ba6730e5941a4e33f8b38e80b038a741671bcc9f in cordova-plugin-splashscreen's branch refs/heads/master from [~agrieve] [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-splashscreen.git;h=ba6730e ] Revert CB-8345 android: Make splash the default resource ID instead of null This reverts commit 1d89a2aa1bf0b714d0debf5928cd85e66bbd090b. There were some other changes in there that weren't meant to be made! Splash screen does not display on Android. -- Key: CB-8345 URL: https://issues.apache.org/jira/browse/CB-8345 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaLib Environment: OS: Ubuntu 14.04 LTS/x64 Node.js: 0.10.35 Cordova: 4.2.0 Reporter: Tomo Masakura Assignee: Andrew Grieve Splash screen does not display on Android. On iOS it is displayed. {quote} $ cordova --version 4.2.0 $ cordova create project1 $ cd project1 $ cordova platform add android ios $ cordova emulate {quote} The iOS simulator splash screen is displayed. However, the Android Emulator it is not displayed. It seems to be resolved by adding the following sentence to the config.xml, but wanting to be displayed in the default state. {quote} preference name=SplashScreen value=screen / {quote} It seems to be solved by modifying the CordovaActivity.java. {quote} $ diff -Nur CordovaActivity.java.orig CordovaActivity.java --- CordovaActivity.java.orig 2015-01-22 16:39:42.0 +0900 +++ CordovaActivity.java2015-01-22 16:39:56.0 +0900 @@ -359,7 +359,7 @@ init(); } this.splashscreenTime = preferences.getInteger(SplashScreenDelay, this.splashscreenTime); -String splash = preferences.getString(SplashScreen, null); +String splash = preferences.getString(SplashScreen, screen); if(this.splashscreenTime 0 splash != null) { this.splashscreen = getResources().getIdentifier(splash, drawable, getClass().getPackage().getName());; {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-6092) Deploying plugins for iOS frameworks breaks symlinks
[ https://issues.apache.org/jira/browse/CB-6092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386732#comment-14386732 ] Miquel commented on CB-6092: Which is yout config.xml? Which is the error log/message in PGB? I think it's better if you could ask a question in stackoverflow with phonegap-plugins tag or open an issue in https://github.com/appfeel/admob-google-cordova/issues. In this way we won't mess up this thread and I can give better follow up. Deploying plugins for iOS frameworks breaks symlinks Key: CB-6092 URL: https://issues.apache.org/jira/browse/CB-6092 Project: Apache Cordova Issue Type: Bug Components: Plugman, Registry Web Affects Versions: 3.3.0 Environment: OSX 10.9.1 Reporter: Song Zheng Priority: Critical Fix For: Master my Plugin has an included ios framework, which resides in Opentok.framework directory. Most iOS frameworks have symlinks within the directory. For example, in the current framework I use, these are the folders listed and their corresponding symlinks: Headers - Versions/Current/Headers Opentok - Versions/Current/Opentok Resources - Versions/Current/Resources Versions After publishing my plugin, symlinks seems to be missing. When I install the plugin into my app, typing 'ls' in my framework directory only produces one folder: Versions Plugin publish seems to be unable to upload symlinks? This issue does not exist if I install the plugin directly from the git source: 'cordova plugin add https://github.com/opentok/cordova-plugin-opentok' ML thread: http://markmail.org/thread/2mbqwaviwvuitngh -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Issue Comment Deleted] (CB-6092) Deploying plugins for iOS frameworks breaks symlinks
[ https://issues.apache.org/jira/browse/CB-6092?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Colin Bau updated CB-6092: -- Comment: was deleted (was: hi Miquel I just want to build success in PGB (build.phonegap.com) with Android and iOS for now I use your code in my PGB's config.xml but still build fail in iOS...) Deploying plugins for iOS frameworks breaks symlinks Key: CB-6092 URL: https://issues.apache.org/jira/browse/CB-6092 Project: Apache Cordova Issue Type: Bug Components: Plugman, Registry Web Affects Versions: 3.3.0 Environment: OSX 10.9.1 Reporter: Song Zheng Priority: Critical Fix For: Master my Plugin has an included ios framework, which resides in Opentok.framework directory. Most iOS frameworks have symlinks within the directory. For example, in the current framework I use, these are the folders listed and their corresponding symlinks: Headers - Versions/Current/Headers Opentok - Versions/Current/Opentok Resources - Versions/Current/Resources Versions After publishing my plugin, symlinks seems to be missing. When I install the plugin into my app, typing 'ls' in my framework directory only produces one folder: Versions Plugin publish seems to be unable to upload symlinks? This issue does not exist if I install the plugin directly from the git source: 'cordova plugin add https://github.com/opentok/cordova-plugin-opentok' ML thread: http://markmail.org/thread/2mbqwaviwvuitngh -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-6289) Keyboard for Android
[ https://issues.apache.org/jira/browse/CB-6289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386739#comment-14386739 ] ASF GitHub Bot commented on CB-6289: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-plugins/pull/15#discussion_r27393052 --- Diff: keyboard/src/android/Keyboard.java --- @@ -0,0 +1,124 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + License); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ +package org.apache.cordova.labs.keyboard; + +import org.apache.cordova.CallbackContext; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.CordovaWebView; +import org.apache.cordova.LOG; +import org.json.JSONArray; +import org.json.JSONException; + +import android.app.Activity; +import android.content.Context; +import android.graphics.Rect; +import android.util.DisplayMetrics; +import android.view.View; +import android.view.ViewTreeObserver.OnGlobalLayoutListener; +import android.view.inputmethod.InputMethodManager; + +public class Keyboard extends CordovaPlugin { +/** +* Delta height of the visible area, to be treated as keyboard opening. +*/ +private final static int MinHeghtDelta = 100; +private static final String TAG = Keyboard; + +public void initialize(CordovaInterface cordova, CordovaWebView webView) { +super.initialize(cordova, webView); + +Activity activity = cordova.getActivity(); +DisplayMetrics metrics = new DisplayMetrics(); + activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); +final float density = metrics.density; + +final CordovaWebView appView = webView; + +final View rootView = activity.getWindow().getDecorView().findViewById(android.R.id.content).getRootView(); +OnGlobalLayoutListener list = new OnGlobalLayoutListener() { +int previousHeightDifference = 0; + +@Override +public void onGlobalLayout() { +LOG.d(TAG, Entering global layout notification); + + Rect visibleRect = new Rect(); +//r will be populated with the coordinates of your view that area still visible. +rootView.getWindowVisibleDisplayFrame(visibleRect); + +int visibleHeight = visibleRect.bottom - visibleRect.top; +int viewHeight = rootView.getRootView().getHeight(); +int heightDifference = (int)((viewHeight - visibleHeight) / density); +if (heightDifference MinHeghtDelta + heightDifference != previousHeightDifference) { +// If the height of the view is bigger then +// visible area by delta, then assume that keyboard +// is shown on the screen. +appView.sendJavascript(Keyboard.isVisible = true; if (Keyboard.onshow) Keyboard.onshow();); --- End diff -- sendJavascript is deprecated. You should use PluginResults here with `setKeepCallback(true)` (allows you to send native-JS at any time after the initial call from JS) Keyboard for Android Key: CB-6289 URL: https://issues.apache.org/jira/browse/CB-6289 Project: Apache Cordova Issue Type: Improvement Components: Plugins Environment: Android Reporter: Andrey Kurdyumov Assignee: Andrey Kurdyumov Priority: Minor Labels: keyboard-plugin Please extend the Keyboard plugin to support Android platform. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To
[jira] [Commented] (CB-8589) Cordova no success callback on WP81
[ https://issues.apache.org/jira/browse/CB-8589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386579#comment-14386579 ] ASF GitHub Bot commented on CB-8589: GitHub user vladimir-kotikov opened a pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/75 CB-8589 Fixes upload failure when server's response doesn't contain any data You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-plugin-file-transfer CB-8589 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-file-transfer/pull/75.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #75 commit c084bf7b33f60723e238752e787584ae8efe75e6 Author: Vladimir Kotikov v-vlk...@microsoft.com Date: 2015-03-30T10:56:51Z CB-8589 Fixes upload failure when server's response doesn't contain any data Cordova no success callback on WP81 Key: CB-8589 URL: https://issues.apache.org/jira/browse/CB-8589 Project: Apache Cordova Issue Type: Bug Components: Plugin File Transfer Environment: Windows Phone 8.1 Reporter: Bodo Probst Assignee: Vladimir Kotikov The success callback in fileTransfer.upload() is not call, when the server does not respond with data, but only with a httpResonseStatus. The call to (FileTransferProxy.js::167) reader.loadAsync(result.progress.bytesReceived).then(function(size) fails with exception, when bytesReceived == 0 On Android, the callback is called correctly. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Closed] (CB-8682) Regression? - CDVWebViewDelegate fails to update the webview state properly in iOS
[ https://issues.apache.org/jira/browse/CB-8682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Eric Whitmore closed CB-8682. - Resolution: Invalid Regression? - CDVWebViewDelegate fails to update the webview state properly in iOS -- Key: CB-8682 URL: https://issues.apache.org/jira/browse/CB-8682 Project: Apache Cordova Issue Type: Bug Components: iOS Reporter: Eric Whitmore Reference: https://issues.apache.org/jira/browse/CB-7813 I am still getting this issue in Cordova 3.8.0 while running the bug project: https://github.com/greatvines/cordova-webview-state-bug-www See log below: $ cat platforms/ios/cordova/console.log 2015-03-15 16:25:11.452 HelloCordova[11167:72148] Apache Cordova native platform version 3.8.0 is starting. 2015-03-15 16:25:11.453 HelloCordova[11167:72148] Multi-tasking - Device: YES, App: YES 2015-03-15 16:25:11.455 HelloCordova[11167:72148] Unlimited access to network resources 2015-03-15 16:25:11.458 HelloCordova[11167:72148] 2015-03-15 16:25:12.443 HelloCordova[11167:72148] Resetting plugins due to page load. 2015-03-15 16:25:12.482 HelloCordova[11167:72148] Finished load of: file:///Users/ewhitmore/Library/Developer/CoreSimulator/Devices/3DD52F35-A9CA-4A4A-A671-FBC481C0AC00/data/Containers/Bundle/Application/9E072E4F-7021-4BFB-8AD5-E2C7002F890D/HelloCordova.app/www/index.html 2015-03-15 16:25:12.487 HelloCordova[11167:72148] Failed to load webpage with error: The operation couldn’t be completed. (NSURLErrorDomain error -999.) 2015-03-15 16:25:12.487 HelloCordova[11167:72148] Resetting plugins due to page load. 2015-03-15 16:25:12.518 HelloCordova[11167:72148] Finished load of: file:///Users/ewhitmore/Library/Developer/CoreSimulator/Devices/3DD52F35-A9CA-4A4A-A671-FBC481C0AC00/data/Containers/Bundle/Application/9E072E4F-7021-4BFB-8AD5-E2C7002F890D/HelloCordova.app/www/redirect.html -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Updated] (CB-8771) Add maven repositories and gradle dependencies to an cordova library
[ https://issues.apache.org/jira/browse/CB-8771?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hugo Gresse updated CB-8771: Description: I'm writing an plugin for Cordova which will use our own android library. The android library is hosted in our maven (via bintray) and the library is already in use in some Android Application. The step we followed to add the library to an android app via gradle is : {code:title=build.gradle|borderStyle=solid} repositories{ maven { url http://dl.bintray.com/teads/TeadsSDK-android; } } dependencies { compile 'tv.teads.sdk:androidsdk:1.0.0' } {code} During all the test we have done to include the dependencies in the Cordova plugin, we have not achieving the same effect. When Android Studio find the library, Cordova didn't (via command line build tools). We have followed the step here https://crosswalk-project.org/jira/browse/XWALK-3467 (second solution) which is : 1. Edit rootProjet.build.gradle and add repository, 2. Same with CordovaLib/build.gradle 3. Add dependencies to CordovaLib/build.gradle Is there a way use an aar in an Cordova Library? was: I'm writing an plugin for Cordova which will use our own android library. The android library is hosted in our maven (via bintray) and the library is already in use in some Android Application. The step we followed to add the library to an android app via gradle is : `repositories{ maven { url http://dl.bintray.com/teads/TeadsSDK-android; } } dependencies { compile 'tv.teads.sdk:androidsdk:1.0.0' }` During all the test we have done to include the dependencies in the Cordova plugin, we have not achieving the same effect. When Android Studio find the library, Cordova didn't (via command line build tools). We have followed the step here https://crosswalk-project.org/jira/browse/XWALK-3467 (second solution) which is : 1. Edit rootProjet.build.gradle and add repository, 2. Same with CordovaLib/build.gradle 3. Add dependencies to CordovaLib/build.gradle Is there a way use an aar in an Cordova Library? Add maven repositories and gradle dependencies to an cordova library Key: CB-8771 URL: https://issues.apache.org/jira/browse/CB-8771 Project: Apache Cordova Issue Type: Bug Components: Android Reporter: Hugo Gresse I'm writing an plugin for Cordova which will use our own android library. The android library is hosted in our maven (via bintray) and the library is already in use in some Android Application. The step we followed to add the library to an android app via gradle is : {code:title=build.gradle|borderStyle=solid} repositories{ maven { url http://dl.bintray.com/teads/TeadsSDK-android; } } dependencies { compile 'tv.teads.sdk:androidsdk:1.0.0' } {code} During all the test we have done to include the dependencies in the Cordova plugin, we have not achieving the same effect. When Android Studio find the library, Cordova didn't (via command line build tools). We have followed the step here https://crosswalk-project.org/jira/browse/XWALK-3467 (second solution) which is : 1. Edit rootProjet.build.gradle and add repository, 2. Same with CordovaLib/build.gradle 3. Add dependencies to CordovaLib/build.gradle Is there a way use an aar in an Cordova Library? -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Created] (CB-8771) Add maven repositories and gradle dependencies to an cordova library
Hugo Gresse created CB-8771: --- Summary: Add maven repositories and gradle dependencies to an cordova library Key: CB-8771 URL: https://issues.apache.org/jira/browse/CB-8771 Project: Apache Cordova Issue Type: Bug Components: Android Reporter: Hugo Gresse I'm writing an plugin for Cordova which will use our own android library. The android library is hosted in our maven (via bintray) and the library is already in use in some Android Application. The step we followed to add the library to an android app via gradle is : `repositories{ maven { url http://dl.bintray.com/teads/TeadsSDK-android; } } dependencies { compile 'tv.teads.sdk:androidsdk:1.0.0' }` During all the test we have done to include the dependencies in the Cordova plugin, we have not achieving the same effect. When Android Studio find the library, Cordova didn't (via command line build tools). We have followed the step here https://crosswalk-project.org/jira/browse/XWALK-3467 (second solution) which is : 1. Edit rootProjet.build.gradle and add repository, 2. Same with CordovaLib/build.gradle 3. Add dependencies to CordovaLib/build.gradle Is there a way use an aar in an Cordova Library? -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8337) Keyboard plugin resizes incorrectly with external keyboard attached
[ https://issues.apache.org/jira/browse/CB-8337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386800#comment-14386800 ] ASF GitHub Bot commented on CB-8337: Github user cjpearson commented on the pull request: https://github.com/apache/cordova-plugins/pull/18#issuecomment-87709992 Thanks for the merge @agrieve. Unfortunately, I've just found another issue. If I recall correctly, one of the major factors was because iOS 7 shrank webviews automatically, but they reversed this in 7.1. I'll definitely bring it up again, thanks! Keyboard plugin resizes incorrectly with external keyboard attached --- Key: CB-8337 URL: https://issues.apache.org/jira/browse/CB-8337 Project: Apache Cordova Issue Type: Bug Components: Plugin Keyboard Environment: iOS Reporter: Connor Pearson When using an external keyboard, the keyboard plugin should only shrink the webview enough to accommodate the accessory bar. It instead shrinks an area the size of the full keyboard, leaving an empty space. See http://i.imgur.com/pKh53JR.png -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8759) windows bin scripts are nonexecutable on OSX
[ https://issues.apache.org/jira/browse/CB-8759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14386807#comment-14386807 ] Edna Morales commented on CB-8759: -- Update: The same error is also seen on Linux windows bin scripts are nonexecutable on OSX Key: CB-8759 URL: https://issues.apache.org/jira/browse/CB-8759 Project: Apache Cordova Issue Type: Bug Components: Windows Reporter: Edna Morales Labels: cli, osx, windows Although the CLI has the ability to add any platform to a project regardless of what OS you are working on, adding the Windows platform on OSX errors out because the Windows scripts don't have the permissions to execute when downloaded from npm -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8683) Update package.id to package.name for all core plugins
[ https://issues.apache.org/jira/browse/CB-8683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387043#comment-14387043 ] Andrew Grieve commented on CB-8683: --- SGTM. Should update docs as well though I think (just do a replace-all) Update package.id to package.name for all core plugins -- Key: CB-8683 URL: https://issues.apache.org/jira/browse/CB-8683 Project: Apache Cordova Issue Type: Sub-task Components: Plugins Reporter: Steve Gill Assignee: Steve Gill We are changing the plugin ids to match plugin name -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387049#comment-14387049 ] ASF GitHub Bot commented on CB-8753: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27413145 --- Diff: src/android/SplashScreen.java --- @@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) { } return null; } + +@Override +public void onConfigurationChanged(Configuration newConfig) { +super.onConfigurationChanged(newConfig); + +// Reload splash drawable when orientation changes if so configured. +if (newConfig.orientation != orientation) { +orientation = newConfig.orientation; +reloadDrawable(); +} +} -private void removeSplashScreen() { +private void reloadDrawable() { +if (isReloadOnOrientationChange() splashImageView != null) { +final int drawableId = preferences.getInteger(SplashDrawableId, 0); +if (drawableId != 0) { +cordova.getActivity().runOnUiThread(new Runnable() { --- End diff -- Does this not always run on the UI thread? Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387052#comment-14387052 ] ASF GitHub Bot commented on CB-8753: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27413236 --- Diff: src/android/SplashScreen.java --- @@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) { } return null; } + +@Override +public void onConfigurationChanged(Configuration newConfig) { +super.onConfigurationChanged(newConfig); + +// Reload splash drawable when orientation changes if so configured. +if (newConfig.orientation != orientation) { +orientation = newConfig.orientation; +reloadDrawable(); +} +} -private void removeSplashScreen() { +private void reloadDrawable() { +if (isReloadOnOrientationChange() splashImageView != null) { --- End diff -- Not sure if you answered in the other PR, but why not just always reload on configuration changes? It'll just no-op if there's no new image. Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387058#comment-14387058 ] ASF GitHub Bot commented on CB-8753: Github user agrieve commented on the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#issuecomment-87767088 Good stuff! A few minor comments then we're good to go I think! Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Resolved] (CB-5059) The android implementation of file transfer plugin should not depend on the concrete class android.webkit.CookieManager
[ https://issues.apache.org/jira/browse/CB-5059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Grieve resolved CB-5059. --- Resolution: Fixed Fixed in cordova-plugin-file-transfer@0.5.0 The android implementation of file transfer plugin should not depend on the concrete class android.webkit.CookieManager --- Key: CB-5059 URL: https://issues.apache.org/jira/browse/CB-5059 Project: Apache Cordova Issue Type: Improvement Components: Plugin File Transfer Affects Versions: Master Environment: cordova-android, git branch 3.0.x Reporter: Junmin Fix For: Master The android implementation of file transfer plugin leverages the class android.webkit.CookieManager, which depends on the concrete web infrastructure android.webkit.WebView. This dependence ruins the portability of the plugin. For example, it could not run on a substantial implementation of CordovaWebView which based on a android third party component(such as chromium for android). Following is the crash log when initializing the CookieManager without android.webkit.WebView: I/dalvikvm(5006): java.lang.IllegalStateException: Call CookieSyncManager::createInstance() or create a webview before using this class I/dalvikvm(5006): at android.webkit.JniUtil.checkInitialized(JniUtil.java:44) I/dalvikvm(5006): at android.webkit.JniUtil.getDatabaseDirectory(JniUtil.java:65) I/dalvikvm(5006): at android.webkit.CookieManagerClassic.nativeGetCookie(Native Method) I/dalvikvm(5006): at android.webkit.CookieManagerClassic.getCookie(CookieManagerClassic.java:109) I/dalvikvm(5006): at android.webkit.CookieManagerClassic.getCookie(CookieManagerClassic.java:96) I/dalvikvm(5006): at org.apache.cordova.filetransfer.FileTransfer$4.run(FileTransfer.java:747) -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387054#comment-14387054 ] ASF GitHub Bot commented on CB-8753: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27413370 --- Diff: src/android/SplashScreen.java --- @@ -194,9 +263,25 @@ public void run() { // TODO: Use the background color of the webView's parent instead of using the // preference. root.setBackgroundColor(preferences.getInteger(backgroundColor, Color.BLACK)); + root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 0.0F)); -root.setBackgroundResource(drawableId); + +// Use an ImageView to render the image because of its flexible scaling options. +splashImageView = new ImageView(context); +splashImageView.setImageResource(drawableId); --- End diff -- If you call setBackgroundColor on the ImageView, can you omit having a parent LinearLayout? Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387045#comment-14387045 ] ASF GitHub Bot commented on CB-8753: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27412851 --- Diff: src/android/SplashScreen.java --- @@ -37,6 +39,19 @@ Licensed to the Apache Software Foundation (ASF) under one import org.json.JSONArray; import org.json.JSONException; +/** + * Splash Screen plugin. Uses the following preferences: + * ul + * liSplashScreen: Splash screen resource name./li + * liSplashScreenDelay: How long splash screen should be shown in milliseconds./li + * liSplashMaintainAspectRatio: Maintain aspect ratio of the drawable, like CSS --- End diff -- Please add to the README.md as well. Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387121#comment-14387121 ] ASF GitHub Bot commented on CB-8753: Github user AlexTalis commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27416639 --- Diff: src/android/SplashScreen.java --- @@ -37,6 +39,19 @@ Licensed to the Apache Software Foundation (ASF) under one import org.json.JSONArray; import org.json.JSONException; +/** + * Splash Screen plugin. Uses the following preferences: + * ul + * liSplashScreen: Splash screen resource name./li + * liSplashScreenDelay: How long splash screen should be shown in milliseconds./li + * liSplashMaintainAspectRatio: Maintain aspect ratio of the drawable, like CSS --- End diff -- Will do after we finalize the changes. Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387270#comment-14387270 ] ASF GitHub Bot commented on CB-8753: Github user AlexTalis commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27423375 --- Diff: src/android/SplashScreen.java --- @@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) { } return null; } + +@Override +public void onConfigurationChanged(Configuration newConfig) { +super.onConfigurationChanged(newConfig); + +// Reload splash drawable when orientation changes if so configured. +if (newConfig.orientation != orientation) { +orientation = newConfig.orientation; +reloadDrawable(); +} +} -private void removeSplashScreen() { +private void reloadDrawable() { +if (isReloadOnOrientationChange() splashImageView != null) { --- End diff -- ImageView.setImageDrawable documentation does not say anything about how smart it is about reloading and repainting the drawable, so I assumed the worst and added an explicit preference. I originally tried using ImageView.setImageResource, but that does nothing if resource ID did not change. To fix that I used ImageView.setImageDrawable and it reloaded the drawable, but I can only assume that it reloads it every time. Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387289#comment-14387289 ] ASF GitHub Bot commented on CB-8753: Github user AlexTalis commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27424716 --- Diff: src/android/SplashScreen.java --- @@ -194,9 +263,25 @@ public void run() { // TODO: Use the background color of the webView's parent instead of using the // preference. root.setBackgroundColor(preferences.getInteger(backgroundColor, Color.BLACK)); + root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 0.0F)); -root.setBackgroundResource(drawableId); + +// Use an ImageView to render the image because of its flexible scaling options. +splashImageView = new ImageView(context); +splashImageView.setImageResource(drawableId); --- End diff -- I am trying to test this, but I don't ever see the background color. On both my Samsung Galaxy S3 and on a Genymotion 4.1.1 emulator the image resizes too quickly to see BG. Do you have a way of testing background color? Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387149#comment-14387149 ] ASF GitHub Bot commented on CB-8484: Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27418136 --- Diff: bin/templates/cordova/lib/build.js --- @@ -409,7 +442,29 @@ function parseOpts(options, resolvedTarget) { console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).'); } } +if (packageArgs.keystore packageArgs.alias) { +var keystore = path.relative(ROOT, path.resolve(packageArgs.keystore)); +ret.packageInfo = new PackageInfo(keystore, packageArgs.alias, packageArgs.keystorePassword, +packageArgs.password, packageArgs.keystoreType); +} else if (fs.existsSync(path.join(CORDOVAROOT, BUILD_CONFIG_FILE))) { --- End diff -- I did not realize that this was the design all along - of not looking into parent directories. I like your idea of passing the path to the JSON file as a single argument. I'm less inclined to do others: 1. 'codova prepare' creating -singing.properties file: There will require a lot of platform specific logic being in cordova-lib and less than ideal. 2. Pass multiple command line parameters: Escaping complex arguments correctly on command line might be tricky and messy. From what I can understand, this results in two changes: 1. cordova-lib to pass path to build.json. Perhaps find a way to version this change - so that older versions of the platforms do not see this unexpected arg. 2. Android build script consuming this build.json and reading the `android` section of it. Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387408#comment-14387408 ] ASF GitHub Bot commented on CB-8484: Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27431999 --- Diff: bin/templates/cordova/lib/build.js --- @@ -422,11 +477,15 @@ function parseOpts(options, resolvedTarget) { module.exports.runClean = function(options) { var opts = parseOpts(options); var builder = builders[opts.buildMethod]; -return builder.prepEnv() +return builder.prepEnv(opts) .then(function() { -return builder.clean(opts.extraArgs); +return builder.clean(opts); }).then(function() { shell.rm('-rf', path.join(ROOT, 'out')); +}).then(function() { +['debug', 'release'].forEach(function(config) { +removeIfExists(path.join(ROOT, config + SIGNING_PROPERTIES)); --- End diff -- I was really hoping to get the scenario of CLI + IDE (Android studio) interop working. If they both consume the same .properties file they can interoperate. The user could create a build.json file with the correct values and would be able to achieve this. I'm getting inclined to delete the file _only_ when it is autogenerated. Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387620#comment-14387620 ] ASF GitHub Bot commented on CB-8753: Github user AlexTalis commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27442565 --- Diff: src/android/SplashScreen.java --- @@ -194,9 +263,25 @@ public void run() { // TODO: Use the background color of the webView's parent instead of using the // preference. root.setBackgroundColor(preferences.getInteger(backgroundColor, Color.BLACK)); + root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 0.0F)); -root.setBackgroundResource(drawableId); + +// Use an ImageView to render the image because of its flexible scaling options. +splashImageView = new ImageView(context); +splashImageView.setImageResource(drawableId); --- End diff -- I added a loop in JS to slow down the app. It calls console.log a bunch of times. I hard-coded BG color to RED and tested the app with and without the linear layout. I never see RED in either view hierarchy. When the app is slow, I just see black background when layout/painting is lagging. ![image](https://cloud.githubusercontent.com/assets/1012600/6909507/ad513bf8-d6fb-11e4-9146-e3f46a151912.png) Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387511#comment-14387511 ] ASF GitHub Bot commented on CB-8484: Github user nikhilkh commented on the pull request: https://github.com/apache/cordova-android/pull/164#issuecomment-87853461 @agrieve I have finished addressing your code review feedback. Can you please take another look? Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387743#comment-14387743 ] ASF GitHub Bot commented on CB-8484: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27446054 --- Diff: bin/templates/cordova/lib/build.js --- @@ -409,7 +457,31 @@ function parseOpts(options, resolvedTarget) { console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).'); } } +if (packageArgs.keystore packageArgs.alias) { +var keystore = path.relative(ROOT, path.resolve(packageArgs.keystore)); +ret.packageInfo = new PackageInfo(keystore, packageArgs.alias, packageArgs.keystorePassword, +packageArgs.password, packageArgs.keystoreType); +} else if (fs.existsSync(buildConfig)) { +console.log('Reading build config file: '+ buildConfig); +var config = JSON.parse(fs.readFileSync(buildConfig, 'utf8')); +if (config.android config.android[ret.buildType]) { +var androidInfo = config.android[ret.buildType]; +if (androidInfo.keystore androidInfo.alias) { +var configDir = path.dirname(buildConfig); +var keystorePath = path.relative(ROOT, path.join(configDir, androidInfo.keystore)); +ret.packageInfo = new PackageInfo(keystorePath, androidInfo.alias, +androidInfo.keystorePassword, androidInfo.password, androidInfo.storeType); --- End diff -- A bit inconsistent to have keystorePassword and storeType (should be storePassword, or keystoreType). I think the [gradle terms](http://stackoverflow.com/questions/18328730/how-to-create-a-release-signed-apk-file-using-gradle) for these make sense, so might as well use them? Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387759#comment-14387759 ] ASF GitHub Bot commented on CB-8753: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27446516 --- Diff: src/android/SplashScreen.java --- @@ -194,9 +263,25 @@ public void run() { // TODO: Use the background color of the webView's parent instead of using the // preference. root.setBackgroundColor(preferences.getInteger(backgroundColor, Color.BLACK)); + root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 0.0F)); -root.setBackgroundResource(drawableId); + +// Use an ImageView to render the image because of its flexible scaling options. +splashImageView = new ImageView(context); +splashImageView.setImageResource(drawableId); --- End diff -- Ahh, okay, that's what I thought your preference was adding, but of course, having it always cover the entire screen makes more sense! Great stuff! Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8351) Remove un-prefixed class extensions from public cordova-ios interface
[ https://issues.apache.org/jira/browse/CB-8351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387661#comment-14387661 ] ASF subversion and git services commented on CB-8351: - Commit 04ed502d9210c02d1ae3b5d0eadd6cfa8c41d7a9 in cordova-plugin-camera's branch refs/heads/master from [~gmconnolly] [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-camera.git;h=04ed502 ] CB-8351 Fix custom implementation of integerValueForKey (close #79) https://github.com/apache/cordova-plugin-camera/commit/2ead6335c92deb117cc3ef84d0a15db296de8dc5#diff-3cfd0e1f93894bd4e501e8e0e4634850 Remove un-prefixed class extensions from public cordova-ios interface - Key: CB-8351 URL: https://issues.apache.org/jira/browse/CB-8351 Project: Apache Cordova Issue Type: Bug Components: iOS Reporter: Andrew Grieve Assignee: Andrew Grieve Priority: Minor Related to CB-8270, there are other non-prefixed class extensions that exists within CordovaLib. Most of them are really even useful anymore, but are used by some of our plugins. We should update the plugins to not need them, and then deprecated the symbols. Removing them in 4.0.0 might be too aggressive though? -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387676#comment-14387676 ] ASF GitHub Bot commented on CB-8753: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27444238 --- Diff: src/android/SplashScreen.java --- @@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) { } return null; } + +@Override +public void onConfigurationChanged(Configuration newConfig) { +super.onConfigurationChanged(newConfig); + +// Reload splash drawable when orientation changes if so configured. +if (newConfig.orientation != orientation) { +orientation = newConfig.orientation; +reloadDrawable(); +} +} -private void removeSplashScreen() { +private void reloadDrawable() { +if (isReloadOnOrientationChange() splashImageView != null) { --- End diff -- I think a performance hit would be acceptable here given the ease of configuration. How often are you going to rotate your device while the splash screen is up? Probably close to never, or at most once. Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387714#comment-14387714 ] ASF GitHub Bot commented on CB-8753: Github user AlexTalis commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27445114 --- Diff: src/android/SplashScreen.java --- @@ -194,9 +263,25 @@ public void run() { // TODO: Use the background color of the webView's parent instead of using the // preference. root.setBackgroundColor(preferences.getInteger(backgroundColor, Color.BLACK)); + root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 0.0F)); -root.setBackgroundResource(drawableId); + +// Use an ImageView to render the image because of its flexible scaling options. +splashImageView = new ImageView(context); +splashImageView.setImageResource(drawableId); --- End diff -- Setting ImageView background color does work. It just does not show with any of the current scaling options. Without maintain aspect ratio the image is stretched to fit screen, so you never see the background. With maintain aspect ratio the image covers the screen fully, so again you don't see the background. If I hard-code a scaling option like FIT_CENTER, then ImageView background color does fill areas that are not covered by the drawable. So if the purpose of BG color is to simply fill areas not covered by the drawable, then we can take out LinearLayout. I thought that the purpose was to somehow cover up the WebView in background if the device is rotated, which probably wouldn't work anyway. Here's the test app without LinearLayout, with scale mode temporarily set to FIT_CENTER and BG color set to RED: ![image](https://cloud.githubusercontent.com/assets/1012600/6910105/4eb48854-d703-11e4-8d08-f5ecce5bea91.png) Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387779#comment-14387779 ] ASF GitHub Bot commented on CB-8484: Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27446835 --- Diff: bin/templates/cordova/lib/build.js --- @@ -372,6 +409,7 @@ function parseOpts(options, resolvedTarget) { if (multiValueArgs[flagName] !flagValue) { flagValue = options[i + 1]; ++i; +console.warn('A value is expected for the flag: ' + flagName); --- End diff -- I see - I get it now. Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-6289) Keyboard for Android
[ https://issues.apache.org/jira/browse/CB-6289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387684#comment-14387684 ] ASF GitHub Bot commented on CB-6289: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-plugins/pull/15#discussion_r2735 --- Diff: keyboard/src/android/Keyboard.java --- @@ -0,0 +1,124 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + License); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ +package org.apache.cordova.labs.keyboard; + +import org.apache.cordova.CallbackContext; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.CordovaWebView; +import org.apache.cordova.LOG; +import org.json.JSONArray; +import org.json.JSONException; + +import android.app.Activity; +import android.content.Context; +import android.graphics.Rect; +import android.util.DisplayMetrics; +import android.view.View; +import android.view.ViewTreeObserver.OnGlobalLayoutListener; +import android.view.inputmethod.InputMethodManager; + +public class Keyboard extends CordovaPlugin { +/** +* Delta height of the visible area, to be treated as keyboard opening. +*/ +private final static int MinHeghtDelta = 100; +private static final String TAG = Keyboard; + +public void initialize(CordovaInterface cordova, CordovaWebView webView) { +super.initialize(cordova, webView); + +Activity activity = cordova.getActivity(); +DisplayMetrics metrics = new DisplayMetrics(); + activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); +final float density = metrics.density; + +final CordovaWebView appView = webView; + +final View rootView = activity.getWindow().getDecorView().findViewById(android.R.id.content).getRootView(); +OnGlobalLayoutListener list = new OnGlobalLayoutListener() { +int previousHeightDifference = 0; + +@Override +public void onGlobalLayout() { +LOG.d(TAG, Entering global layout notification); + + Rect visibleRect = new Rect(); +//r will be populated with the coordinates of your view that area still visible. +rootView.getWindowVisibleDisplayFrame(visibleRect); + +int visibleHeight = visibleRect.bottom - visibleRect.top; +int viewHeight = rootView.getRootView().getHeight(); +int heightDifference = (int)((viewHeight - visibleHeight) / density); +if (heightDifference MinHeghtDelta + heightDifference != previousHeightDifference) { +// If the height of the view is bigger then +// visible area by delta, then assume that keyboard +// is shown on the screen. +appView.sendJavascript(Keyboard.isVisible = true; if (Keyboard.onshow) Keyboard.onshow();); +} +else if (heightDifference != previousHeightDifference + (previousHeightDifference - heightDifference) MinHeghtDelta){ +// If the difference between visible and view area dropped by the delta +// then assume that this means that keyboard is hidden. +appView.sendJavascript(Keyboard.isVisible = false; if (Keyboard.onhide) Keyboard.onhide();); --- End diff -- ugh, yeah, should be fixed up on iOS as well too I suppose. There's no reason to use a single callback rather than an event. Events are much more flexible / normal. Keyboard for Android Key: CB-6289 URL:
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387740#comment-14387740 ] ASF GitHub Bot commented on CB-8484: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27446020 --- Diff: bin/templates/cordova/lib/build.js --- @@ -530,8 +609,54 @@ module.exports.findBestApkForArchitecture = function(buildResults, arch) { throw new Error('Could not find apk architecture: ' + arch + ' build-type: ' + buildResults.buildType); }; +function PackageInfo(keystore, alias, keystorePassword, password, storeType) { +keystore = keystore.replace(/\\/g, ''); +this.keystore = { +'name': 'key.store', +'value': keystore +}; +this.alias = { +'name': 'key.alias', +'value': alias +}; +if (keystorePassword) { +this.keystorePassword = { +'name': 'key.store.password', +'value': keystorePassword +}; +} +if (password) { +this.password = { +'name': 'key.alias.password', +'value': password +}; +} +if (storeType) { +this.storeType = { +'name': 'key.store.type', +'value': storeType +}; +} +} + +PackageInfo.prototype = { +toProperties: function() { +var self = this; +var result = ''; +Object.keys(self).forEach(function(key) { +if (self[key]) { --- End diff -- Probably should not require the value to be non-empty. Perfectly valid to have `key.alias.password=` in the file (although not recommended :P) Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387744#comment-14387744 ] ASF GitHub Bot commented on CB-8484: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27446058 --- Diff: bin/templates/cordova/lib/build.js --- @@ -409,7 +457,31 @@ function parseOpts(options, resolvedTarget) { console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).'); } } +if (packageArgs.keystore packageArgs.alias) { +var keystore = path.relative(ROOT, path.resolve(packageArgs.keystore)); +ret.packageInfo = new PackageInfo(keystore, packageArgs.alias, packageArgs.keystorePassword, +packageArgs.password, packageArgs.keystoreType); +} else if (fs.existsSync(buildConfig)) { --- End diff -- Should just check: `if (buildConfig)`, and show an error if it's set and the file doesn't exist. Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387741#comment-14387741 ] ASF GitHub Bot commented on CB-8484: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27446047 --- Diff: bin/templates/cordova/lib/build.js --- @@ -530,8 +609,54 @@ module.exports.findBestApkForArchitecture = function(buildResults, arch) { throw new Error('Could not find apk architecture: ' + arch + ' build-type: ' + buildResults.buildType); }; +function PackageInfo(keystore, alias, keystorePassword, password, storeType) { +keystore = keystore.replace(/\\/g, ''); --- End diff -- This escaping will need to be done for all of the values I think. Would be more appropriate to do it within the toProperties function Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387768#comment-14387768 ] ASF GitHub Bot commented on CB-8484: Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27446661 --- Diff: bin/templates/cordova/lib/build.js --- @@ -409,7 +457,31 @@ function parseOpts(options, resolvedTarget) { console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).'); } } +if (packageArgs.keystore packageArgs.alias) { +var keystore = path.relative(ROOT, path.resolve(packageArgs.keystore)); +ret.packageInfo = new PackageInfo(keystore, packageArgs.alias, packageArgs.keystorePassword, +packageArgs.password, packageArgs.keystoreType); +} else if (fs.existsSync(buildConfig)) { --- End diff -- Good point. Resolved in next iteration. Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387771#comment-14387771 ] ASF GitHub Bot commented on CB-8484: Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27446698 --- Diff: bin/templates/cordova/lib/build.js --- @@ -530,8 +609,54 @@ module.exports.findBestApkForArchitecture = function(buildResults, arch) { throw new Error('Could not find apk architecture: ' + arch + ' build-type: ' + buildResults.buildType); }; +function PackageInfo(keystore, alias, keystorePassword, password, storeType) { +keystore = keystore.replace(/\\/g, ''); --- End diff -- Yup. That's a better place for it. Moved it next iteration. Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387753#comment-14387753 ] ASF GitHub Bot commented on CB-8484: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27446338 --- Diff: bin/templates/cordova/lib/build.js --- @@ -409,7 +457,31 @@ function parseOpts(options, resolvedTarget) { console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).'); } } +if (packageArgs.keystore packageArgs.alias) { --- End diff -- Wonding if this should actually not be exclusive with the else if clause. E.g. allow specifying buildConfig, and then also allow setting the password via --password Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387751#comment-14387751 ] ASF GitHub Bot commented on CB-8484: Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27446318 --- Diff: bin/templates/cordova/lib/build.js --- @@ -297,6 +320,14 @@ var builders = { var distributionUrl = 'distributionUrl=http\\://services.gradle.org/distributions/gradle-2.2.1-all.zip'; var gradleWrapperPropertiesPath = path.join(projectPath, 'gradle', 'wrapper', 'gradle-wrapper.properties'); shell.sed('-i', distributionUrlRegex, distributionUrl, gradleWrapperPropertiesPath); +}).then(function() { --- End diff -- Fair enough - removed all superfluous promises in next iteration. Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8345) Splash screen does not display on Android.
[ https://issues.apache.org/jira/browse/CB-8345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387803#comment-14387803 ] Tomo Masakura commented on CB-8345: --- Thanks! I confirmed that it work correctly. {quote} $ cordova create cordova1 $ cd cordova1 $ cordova platform add https://github.com/apache/cordova-android.git $ cordova emulate {quite} Splash screen does not appear at this point. {quote} $ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git $ cordova emulate {quote} Now splash screen is appeared. Splash screen does not display on Android. -- Key: CB-8345 URL: https://issues.apache.org/jira/browse/CB-8345 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaLib Environment: OS: Ubuntu 14.04 LTS/x64 Node.js: 0.10.35 Cordova: 4.2.0 Reporter: Tomo Masakura Assignee: Andrew Grieve Splash screen does not display on Android. On iOS it is displayed. {quote} $ cordova --version 4.2.0 $ cordova create project1 $ cd project1 $ cordova platform add android ios $ cordova emulate {quote} The iOS simulator splash screen is displayed. However, the Android Emulator it is not displayed. It seems to be resolved by adding the following sentence to the config.xml, but wanting to be displayed in the default state. {quote} preference name=SplashScreen value=screen / {quote} It seems to be solved by modifying the CordovaActivity.java. {quote} $ diff -Nur CordovaActivity.java.orig CordovaActivity.java --- CordovaActivity.java.orig 2015-01-22 16:39:42.0 +0900 +++ CordovaActivity.java2015-01-22 16:39:56.0 +0900 @@ -359,7 +359,7 @@ init(); } this.splashscreenTime = preferences.getInteger(SplashScreenDelay, this.splashscreenTime); -String splash = preferences.getString(SplashScreen, null); +String splash = preferences.getString(SplashScreen, screen); if(this.splashscreenTime 0 splash != null) { this.splashscreen = getResources().getIdentifier(splash, drawable, getClass().getPackage().getName());; {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Comment Edited] (CB-8345) Splash screen does not display on Android.
[ https://issues.apache.org/jira/browse/CB-8345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387803#comment-14387803 ] Tomo Masakura edited comment on CB-8345 at 3/31/15 1:45 AM: Thanks! I confirmed that it work correctly. {quote} $ cordova create cordova1 $ cd cordova1 $ cordova platform add https://github.com/apache/cordova-android.git $ cordova emulate {quote} Splash screen does not appear at this point. {quote} $ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git $ cordova emulate {quote} Now splash screen is appeared. was (Author: tomo_masakura): Thanks! I confirmed that it work correctly. {quote} $ cordova create cordova1 $ cd cordova1 $ cordova platform add https://github.com/apache/cordova-android.git $ cordova emulate {quite} Splash screen does not appear at this point. {quote} $ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git $ cordova emulate {quote} Now splash screen is appeared. Splash screen does not display on Android. -- Key: CB-8345 URL: https://issues.apache.org/jira/browse/CB-8345 Project: Apache Cordova Issue Type: Bug Components: Android, CordovaLib Environment: OS: Ubuntu 14.04 LTS/x64 Node.js: 0.10.35 Cordova: 4.2.0 Reporter: Tomo Masakura Assignee: Andrew Grieve Splash screen does not display on Android. On iOS it is displayed. {quote} $ cordova --version 4.2.0 $ cordova create project1 $ cd project1 $ cordova platform add android ios $ cordova emulate {quote} The iOS simulator splash screen is displayed. However, the Android Emulator it is not displayed. It seems to be resolved by adding the following sentence to the config.xml, but wanting to be displayed in the default state. {quote} preference name=SplashScreen value=screen / {quote} It seems to be solved by modifying the CordovaActivity.java. {quote} $ diff -Nur CordovaActivity.java.orig CordovaActivity.java --- CordovaActivity.java.orig 2015-01-22 16:39:42.0 +0900 +++ CordovaActivity.java2015-01-22 16:39:56.0 +0900 @@ -359,7 +359,7 @@ init(); } this.splashscreenTime = preferences.getInteger(SplashScreenDelay, this.splashscreenTime); -String splash = preferences.getString(SplashScreen, null); +String splash = preferences.getString(SplashScreen, screen); if(this.splashscreenTime 0 splash != null) { this.splashscreen = getResources().getIdentifier(splash, drawable, getClass().getPackage().getName());; {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387693#comment-14387693 ] ASF GitHub Bot commented on CB-8753: Github user AlexTalis commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27444623 --- Diff: src/android/SplashScreen.java --- @@ -151,13 +193,40 @@ public Object onMessage(String id, Object data) { } return null; } + +@Override +public void onConfigurationChanged(Configuration newConfig) { +super.onConfigurationChanged(newConfig); + +// Reload splash drawable when orientation changes if so configured. +if (newConfig.orientation != orientation) { +orientation = newConfig.orientation; +reloadDrawable(); +} +} -private void removeSplashScreen() { +private void reloadDrawable() { +if (isReloadOnOrientationChange() splashImageView != null) { --- End diff -- Agreed. I'll make take out the preference. Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-6289) Keyboard for Android
[ https://issues.apache.org/jira/browse/CB-6289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387692#comment-14387692 ] ASF GitHub Bot commented on CB-6289: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-plugins/pull/15#discussion_r27444603 --- Diff: keyboard/src/android/Keyboard.java --- @@ -0,0 +1,124 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + License); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ +package org.apache.cordova.labs.keyboard; + +import org.apache.cordova.CallbackContext; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.CordovaWebView; +import org.apache.cordova.LOG; +import org.json.JSONArray; +import org.json.JSONException; + +import android.app.Activity; +import android.content.Context; +import android.graphics.Rect; +import android.util.DisplayMetrics; +import android.view.View; +import android.view.ViewTreeObserver.OnGlobalLayoutListener; +import android.view.inputmethod.InputMethodManager; + +public class Keyboard extends CordovaPlugin { +/** +* Delta height of the visible area, to be treated as keyboard opening. +*/ +private final static int MinHeghtDelta = 100; +private static final String TAG = Keyboard; + +public void initialize(CordovaInterface cordova, CordovaWebView webView) { +super.initialize(cordova, webView); + +Activity activity = cordova.getActivity(); +DisplayMetrics metrics = new DisplayMetrics(); + activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); +final float density = metrics.density; + +final CordovaWebView appView = webView; + +final View rootView = activity.getWindow().getDecorView().findViewById(android.R.id.content).getRootView(); +OnGlobalLayoutListener list = new OnGlobalLayoutListener() { +int previousHeightDifference = 0; + +@Override +public void onGlobalLayout() { +LOG.d(TAG, Entering global layout notification); + + Rect visibleRect = new Rect(); +//r will be populated with the coordinates of your view that area still visible. +rootView.getWindowVisibleDisplayFrame(visibleRect); + +int visibleHeight = visibleRect.bottom - visibleRect.top; +int viewHeight = rootView.getRootView().getHeight(); +int heightDifference = (int)((viewHeight - visibleHeight) / density); +if (heightDifference MinHeghtDelta + heightDifference != previousHeightDifference) { +// If the height of the view is bigger then +// visible area by delta, then assume that keyboard +// is shown on the screen. +appView.sendJavascript(Keyboard.isVisible = true; if (Keyboard.onshow) Keyboard.onshow();); --- End diff -- The main technical reason to not use sendJavascript is because on Android it's implemented using `eval()`, and depending on the user's Content-Security-Policy, `eval` may not work. `setKeepCallback(false)` is the default, which means you can call the `exec`'s success or failure callback only once. `setKeepCallback(true)` allows you to call success/failure multiple times (so long as each time you also call `setKeepCallback(true)`). To go even further: - By waiting for an initial `exec()` to come in, you won't ever send a message to JS before it's ready to receive one. - You don't need to export an extra symbol just to be called by the native code - On Android, PluginResults are more efficient than sendJavascript Keyboard for Android
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387719#comment-14387719 ] ASF GitHub Bot commented on CB-8484: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27445404 --- Diff: bin/templates/cordova/lib/build.js --- @@ -402,6 +440,16 @@ function parseOpts(options, resolvedTarget) { case 'gradleArg': ret.extraArgs.push(flagValue); break; +case 'keystore': +case 'alias': +case 'keytorePassword': +case 'password': +case 'keystoreType': +packageArgs[flagName] = flagValue; +break; +case 'buildConfig': +buildConfig = flagValue.replace(//g, ''); --- End diff -- Shouldn't need the `.replace()` here... Did you find it necessary for some reason? Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387717#comment-14387717 ] ASF GitHub Bot commented on CB-8484: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27445351 --- Diff: bin/templates/cordova/lib/build.js --- @@ -372,6 +409,7 @@ function parseOpts(options, resolvedTarget) { if (multiValueArgs[flagName] !flagValue) { flagValue = options[i + 1]; ++i; +console.warn('A value is expected for the flag: ' + flagName); --- End diff -- I think this warning will show when not using an = for the flag value (generally for flags with values, you're allowed to do: --foo=bar *or* --foo bar Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387766#comment-14387766 ] ASF GitHub Bot commented on CB-8753: Github user AlexTalis commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27446641 --- Diff: src/android/SplashScreen.java --- @@ -194,9 +263,25 @@ public void run() { // TODO: Use the background color of the webView's parent instead of using the // preference. root.setBackgroundColor(preferences.getInteger(backgroundColor, Color.BLACK)); + root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 0.0F)); -root.setBackgroundResource(drawableId); + +// Use an ImageView to render the image because of its flexible scaling options. +splashImageView = new ImageView(context); +splashImageView.setImageResource(drawableId); --- End diff -- Do you know of any other reason for setting this background color? If not, then I think we can take out Linear Layout. Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387767#comment-14387767 ] ASF GitHub Bot commented on CB-8484: Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27446655 --- Diff: bin/templates/cordova/lib/build.js --- @@ -409,7 +457,31 @@ function parseOpts(options, resolvedTarget) { console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).'); } } +if (packageArgs.keystore packageArgs.alias) { +var keystore = path.relative(ROOT, path.resolve(packageArgs.keystore)); +ret.packageInfo = new PackageInfo(keystore, packageArgs.alias, packageArgs.keystorePassword, +packageArgs.password, packageArgs.keystoreType); +} else if (fs.existsSync(buildConfig)) { +console.log('Reading build config file: '+ buildConfig); +var config = JSON.parse(fs.readFileSync(buildConfig, 'utf8')); +if (config.android config.android[ret.buildType]) { +var androidInfo = config.android[ret.buildType]; +if (androidInfo.keystore androidInfo.alias) { +var configDir = path.dirname(buildConfig); +var keystorePath = path.relative(ROOT, path.join(configDir, androidInfo.keystore)); +ret.packageInfo = new PackageInfo(keystorePath, androidInfo.alias, +androidInfo.keystorePassword, androidInfo.password, androidInfo.storeType); --- End diff -- Good point! Resolved in next iteration. Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8753) Maintain splash screen aspect ratio
[ https://issues.apache.org/jira/browse/CB-8753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387670#comment-14387670 ] ASF GitHub Bot commented on CB-8753: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/43#discussion_r27444149 --- Diff: src/android/SplashScreen.java --- @@ -194,9 +263,25 @@ public void run() { // TODO: Use the background color of the webView's parent instead of using the // preference. root.setBackgroundColor(preferences.getInteger(backgroundColor, Color.BLACK)); + root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 0.0F)); -root.setBackgroundResource(drawableId); + +// Use an ImageView to render the image because of its flexible scaling options. +splashImageView = new ImageView(context); +splashImageView.setImageResource(drawableId); --- End diff -- Hmm, I figured the background would show for a square image when SplashMaintainAspectRatio is set. I think you've done due diligence to it though, so if it's not required, then don't even bother setting it. Maintain splash screen aspect ratio --- Key: CB-8753 URL: https://issues.apache.org/jira/browse/CB-8753 Project: Apache Cordova Issue Type: Improvement Components: Android Affects Versions: 3.7.1 Environment: Android Reporter: Alex Talis Fix For: 3.8.0, 4.0.0, 3.7.1 Attachments: cur-land.png, cur-port.png, new-land.png, new-port.png I will be submitting a pull request for this enhancement shortly. Current splash screen scales images non-uniformly to fit into splash dialog. This approach does not work well for many typical splash screen images that contain scenery or text and look bad when aspect ratio is not preserved. 9-patch images may work, but they have to be carefully designed so that the inside can be stretched without distorting important information. The purpose of this enhancement is to allow use of non-9-patch images without stretching, similar to CSS background-size:cover capability. For this to work, splash images have to have large safe area all around that can be safely cropped off. With this type of splash screen, it is usually necessary to use different images for portrait and landscape orientations, so a second part of this enhancement is to add an option to reload the drawable when orientation changes. Examples of the two preferences are shown below. Both are optional and default to False to maintain current splash screen behavior. preference name=SplashMaintainAspectRatio value=true/ preference name=SplashReloadOnOrientationChange value=true/ -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-5921) Cordova on iOS should use an XCWorkspace, or at least support using one.
[ https://issues.apache.org/jira/browse/CB-5921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387720#comment-14387720 ] Shazron Abdullah commented on CB-5921: -- Proof of concept of plugins as frameworks: https://github.com/shazron/cordova-workspace-tests/tree/plugin-as-framework (includes CordovaLib target of Cordova as a framework) Still needs work, I need to repro the steps to make sure I document it properly. I will bring this to the mailing list for comment once I get a workable demo. Cordova on iOS should use an XCWorkspace, or at least support using one. Key: CB-5921 URL: https://issues.apache.org/jira/browse/CB-5921 Project: Apache Cordova Issue Type: Improvement Components: iOS Reporter: Graham Mueller Priority: Minor Labels: core Fix For: 4.0.0 Attachments: build Hi Guys, Not sure what to log this as. It's not so much a bug as an incompatibility with other frameworks. Anyway, this is specifically an issue with the build process on iOS. Do with it what you will. If you're familiar with the CocoaPods framework, you'll know that on initial install, it creates an XCWorkspace file, and instructs you to exclusively use that afterwards. This is because the CocoaPods library adds itself as a linked project that must be built, similar to Cordova/Phonegap. The difference is that Cordova adds itself as a sub project, instead of a sibling project (which is effectively the workspace goal, from my understanding, though I'm having a hard time finding a good link to explain it better). So, I would suggest that Cordova moves to this setup as well -- it should create the workspace that has both the Cordova project and your app project. Alternatively, if you don't want to go through and change that creation code, it would be great if the CLI offered someway to specify what you want it to build. I found the actual build script that's calling xcodebuild with a -project flag in it (this is where -workspace would go). There is currently no way to override this, so there is currently no way at all to support workspaces (and consequently no way to use CocoaPods). Any thoughts or reasons not to do so? Thanks, Graham -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387736#comment-14387736 ] ASF GitHub Bot commented on CB-8484: Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27445900 --- Diff: bin/templates/cordova/lib/build.js --- @@ -402,6 +440,16 @@ function parseOpts(options, resolvedTarget) { case 'gradleArg': ret.extraArgs.push(flagValue); break; +case 'keystore': +case 'alias': +case 'keytorePassword': +case 'password': +case 'keystoreType': +packageArgs[flagName] = flagValue; +break; +case 'buildConfig': +buildConfig = flagValue.replace(//g, ''); --- End diff -- If the path has a space (Windows) - the flag value will need to have quotes. Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-8484) Cordova package support for Android
[ https://issues.apache.org/jira/browse/CB-8484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387754#comment-14387754 ] ASF GitHub Bot commented on CB-8484: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/164#discussion_r27446385 --- Diff: bin/templates/cordova/lib/build.js --- @@ -422,11 +477,15 @@ function parseOpts(options, resolvedTarget) { module.exports.runClean = function(options) { var opts = parseOpts(options); var builder = builders[opts.buildMethod]; -return builder.prepEnv() +return builder.prepEnv(opts) .then(function() { -return builder.clean(opts.extraArgs); +return builder.clean(opts); }).then(function() { shell.rm('-rf', path.join(ROOT, 'out')); +}).then(function() { +['debug', 'release'].forEach(function(config) { +removeIfExists(path.join(ROOT, config + SIGNING_PROPERTIES)); --- End diff -- I like it! Cordova package support for Android --- Key: CB-8484 URL: https://issues.apache.org/jira/browse/CB-8484 Project: Apache Cordova Issue Type: Sub-task Components: Android Affects Versions: 4.0.0 Reporter: Nikhil Khandelwal Assignee: Nikhil Khandelwal Details of the design here: https://docs.google.com/document/d/1tJQ9OoGrrMhZcLI3mg46rGzAfbiQu9PuNBL1auAMGFM/edit# -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-200) FileTransfer should support uploading multiple files in one HTTP request
[ https://issues.apache.org/jira/browse/CB-200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14387912#comment-14387912 ] Michael Rhema commented on CB-200: -- it actually works. i had issues with my server side code...thnx. [~cfjedimaster]. u helped out too on twitter. I dont think xhr2 has a native file .slice() support. FileTransfer should support uploading multiple files in one HTTP request Key: CB-200 URL: https://issues.apache.org/jira/browse/CB-200 Project: Apache Cordova Issue Type: Improvement Components: Plugin File Transfer Affects Versions: 1.3.0 Environment: Windows XP, Android, Lenovo ThinkPad Reporter: Matt Accola Assignee: Andrew Grieve Priority: Trivial FileTransfer only allows one file to be uploaded at a time. Should allow multiple files to be uploaded at once. This might be necessary if the server-side service requires all files to be submitted at once to ensure any operations on the files are atomic. This question has been asked on the phonegap Google Group, http://groups.google.com/group/phonegap/browse_thread/thread/bdc40098c2954870. (Update: Since this requires a UI change for parity, I've added more components and moved it out of 1.7. This should be added to the Roadmap, so I'm leaving it assigned to myself so I'm reminded to do this - Joe) -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org