From f83898c58e6789c48dae9de6cfbe5b68d5ee08d6 Mon Sep 17 00:00:00 2001 From: m1ga Date: Sat, 17 Sep 2022 21:26:47 +0200 Subject: [PATCH] feat(android): compression level --- README.md | 6 +----- example/app.js | 19 +++++++++---------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 988d148..50b8f66 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ See example for more details. ## zip Parameter Android: -* filename:String, files:Array, options: Object [compression: Compression.BEST_SPEED| Compression.DEFAULT_COMPRESSION | Compression.NO_COMPRESSION] +* filename:String, files:Array, options: Object [compression: Compression.BEST_SPEED | Compression.DEFAULT_COMPRESSION | Compression.NO_COMPRESSION] iOS: * filename:String, files:Array @@ -85,10 +85,6 @@ dd if=/dev/urandom of=file1 bs=5M count=1 Clint Tredway -## Feedback and Support - -Please direct all questions, feedback, and concerns to [info@appcelerator.com](mailto:info@appcelerator.com?subject=iOS%20Compression%20Module). - ## License Copyright(c) 2010-present by Axway Appcelerator. All Rights Reserved. Please see the LICENSE file included in the distribution for further details. diff --git a/example/app.js b/example/app.js index 1c8fa13..4b2d147 100644 --- a/example/app.js +++ b/example/app.js @@ -36,10 +36,10 @@ var zipFiles2 = Ti.UI.createButton({ zipFiles.addEventListener('click', function() { var startTime = new Date(); var writeToZip = outputDirectory + '/zipFiles.zip'; - var file = Ti.Filesystem.getFile(writeToZip); - if (file.exists()) { - file.deleteFile(); - } + var file = Ti.Filesystem.getFile(writeToZip); + if (file.exists()) { + file.deleteFile(); + } var result = Compression.zip(writeToZip, [ inputDirectory + 'a.txt', inputDirectory + 'b.txt', @@ -69,10 +69,10 @@ zipFiles.addEventListener('click', function() { zipFiles2.addEventListener('click', function() { var writeToZip = outputDirectory + '/zipFiles.zip'; - var file = Ti.Filesystem.getFile(writeToZip); - if (file.exists()) { - file.deleteFile(); - } + var file = Ti.Filesystem.getFile(writeToZip); + if (file.exists()) { + file.deleteFile(); + } var startTime = new Date(); var result = Compression.zip(writeToZip, [ inputDirectory + 'a.txt', @@ -88,8 +88,7 @@ zipFiles2.addEventListener('click', function() { inputDirectory + 'icon2.png', inputDirectory + 'icon3.png' ], { - compression: Compression.BEST_SPEED, - optimizeStorage: true + compression: Compression.BEST_SPEED }); Ti.API.info(status.text = 'Zip Files: ' + result + ', to: ' + writeToZip);