diff --git a/.project b/.project index 6a563a5..26c44aa 100644 --- a/.project +++ b/.project @@ -5,25 +5,8 @@ - - com.appcelerator.titanium.core.builder - - - - - com.aptana.ide.core.unifiedBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - org.eclipse.jdt.core.javanature com.appcelerator.titanium.mobile.module.nature - com.aptana.projects.webnature diff --git a/build.properties b/build.properties index f2eb62b..efc06ee 100644 --- a/build.properties +++ b/build.properties @@ -1,4 +1,4 @@ -titanium.platform=/Users/gbaldera/Library/Application Support/Titanium/mobilesdk/osx/3.1.0.GA/android -android.platform=/Applications/android-sdk-macosx/platforms/android-17 -android.ndk=/Applications/android-ndk-r8 -google.apis=/Applications/android-sdk-macosx/add-ons/addon-google_apis-google_inc_-8 \ No newline at end of file +titanium.platform=/Users/fuerst/Library/Application Support/Titanium/mobilesdk/osx/3.5.1.GA/android +android.platform=/Users/fuerst/Library/android-sdk/platforms/android-21 +android.ndk=/Users/fuerst/Library/android-ndk/ +google.apis=/Users/fuerst/Library/android-sdk/add-ons/addon-google_apis-google_22 \ No newline at end of file diff --git a/dist/com.gbaldera.titouchgallery-android-1.2.zip b/dist/com.gbaldera.titouchgallery-android-1.2.zip new file mode 100644 index 0000000..cee3d8f Binary files /dev/null and b/dist/com.gbaldera.titouchgallery-android-1.2.zip differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/LICENSE b/dist/modules/android/com.gbaldera.titouchgallery/1.2/LICENSE new file mode 100644 index 0000000..6ae867d --- /dev/null +++ b/dist/modules/android/com.gbaldera.titouchgallery/1.2/LICENSE @@ -0,0 +1 @@ +TODO: place your license here and we'll include it in the module distribution diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/documentation/index.html b/dist/modules/android/com.gbaldera.titouchgallery/1.2/documentation/index.html new file mode 100644 index 0000000..4bffab0 --- /dev/null +++ b/dist/modules/android/com.gbaldera.titouchgallery/1.2/documentation/index.html @@ -0,0 +1,155 @@ +

TiTouchGallery Module

+

Description

+

TiTouchGallery is a native Android module, which allows you to create a gallery view, with zoom (pinch / double tap) and pan support, in your Titanium Android app.

+

Copyright

+

This module is a fork of the android gallery widget from Dreddik with some changes. +
Thanks Dreddik for share this.

+

Accessing the TiTouchGallery Module

+

To access this module from JavaScript, you would do the following:

+
var titouchgallery = require("com.gbaldera.titouchgallery");
+
+

The titouchgallery variable is a reference to the Module object.
+

+

Properties

+

images : String[]

+

Array of images to display in the gallery (Only Remote images are supported for now)

+

currentPage : Number

+

ndex of the active page

+

Methods

+

List of methods supported in this module:

+

Gallery creation

+
var proxy = titouchgallery.createTouchGallery({
+    images: [
+        "http://cs407831.userapi.com/v407831207/18f6/jBaVZFDhXRA.jpg",
+        "http://cs407831.userapi.com/v4078f31207/18fe/4Tz8av5Hlvo.jpg",
+        "http://cs407831.userapi.com/v407831207/1906/oxoP6URjFtA.jpg",
+        "http://cs407831.userapi.com/v407831207/190e/2Sz9A774hUc.jpg",
+        "http://cs407831.userapi.com/v407831207/1916/Ua52RjnKqjk.jpg",
+        "http://cs407831.userapi.com/v407831207/191e/QEQE83Ok0lQ.jpg"
+    ],
+    currentPage:2
+});
+
+

getImages : String[]

+

Get the array with the images displayed in the gallery.

+
Arguments
+

None

+

setImages

+

Set the array with the images to be displayed in the gallery.

+
Arguments
+ +

addImage

+

Adds a new image to the gallery

+
Arguments
+ +

removeImage

+

Removes the specified image from the gallery

+
Arguments
+ +

getCount : Number

+

Get the total number of images in the gallery.

+
Arguments
+

None

+

moveNext

+

Sets the current page to the next consecutive page in images.

+
Arguments
+

None

+

movePrevious

+

Sets the current page to the previous consecutive page in images.

+
Arguments
+

None

+

getCurrentPage : Number

+

Gets the value of the currentPage property.

+
Arguments
+

None

+

setCurrentPage

+

Sets the value of the currentPage property.

+
Arguments
+ +

Events

+

singletap

+

Fired when the device detects a single tap against the view.

+

Properties

+ +

longpress

+

Fired when the device detects a long press against this view.

+

Properties

+ +

scroll

+

Fired when the gallery changed the page

+

Properties

+ +

Usage

+

```

+

var win = Ti.UI.createWindow({ + backgroundColor:'#000' +});

+

var titouchgallery = require('com.gbaldera.titouchgallery');

+

if (Ti.Platform.name == "android") { + var proxy = titouchgallery.createTouchGallery({ + images: [ + "http://cs407831.userapi.com/v407831207/18f6/jBaVZFDhXRA.jpg", + "http://cs407831.userapi.com/v4078f31207/18fe/4Tz8av5Hlvo.jpg", + "http://cs407831.userapi.com/v407831207/1906/oxoP6URjFtA.jpg", + "http://cs407831.userapi.com/v407831207/190e/2Sz9A774hUc.jpg", + "http://cs407831.userapi.com/v407831207/1916/Ua52RjnKqjk.jpg", + "http://cs407831.userapi.com/v407831207/191e/QEQE83Ok0lQ.jpg" + ] + }); + proxy.addEventListener("scroll", function(e){ + Ti.API.debug("Scroll event fired: " + JSON.stringify(e)); + }); + proxy.addEventListener("singletap", function(e){ + alert("Page: " + e.currentPage); + Ti.API.debug("SingleTap event fired: " + JSON.stringify(e)); + }); + proxy.addEventListener("longpress", function(e){ + alert("Page: " + e.currentPage); + Ti.API.debug("LongPress event fired: " + JSON.stringify(e)); + });

+
win.add(proxy);
+
+

}

+

win.open();

+

```

+

TODO

+ +

Changelog

+ +

Author

+

Gustavo Rodriguez Baldera

+

www.gbaldera.com

+

License

+

It's open source and it's under DBAD License

\ No newline at end of file diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/example/app.js b/dist/modules/android/com.gbaldera.titouchgallery/1.2/example/app.js new file mode 100644 index 0000000..f8efd31 --- /dev/null +++ b/dist/modules/android/com.gbaldera.titouchgallery/1.2/example/app.js @@ -0,0 +1,42 @@ +// This is a test harness for your module +// You should do something interesting in this harness +// to test out the module and to provide instructions +// to users on how to use it by example. + + +// open a single window +var win = Ti.UI.createWindow({ + backgroundColor:'#000' +}); + +var titouchgallery = require('com.gbaldera.titouchgallery'); +Ti.API.info("module is => " + JSON.stringify(titouchgallery)); + +if (Ti.Platform.name == "android") { + var proxy = titouchgallery.createTouchGallery({ + images: [ + "http://cs407831.userapi.com/v407831207/18f6/jBaVZFDhXRA.jpg", + "http://cs407831.userapi.com/v4078f31207/18fe/4Tz8av5Hlvo.jpg", + "http://cs407831.userapi.com/v407831207/1906/oxoP6URjFtA.jpg", + "http://cs407831.userapi.com/v407831207/190e/2Sz9A774hUc.jpg", + "http://cs407831.userapi.com/v407831207/1916/Ua52RjnKqjk.jpg", + "http://cs407831.userapi.com/v407831207/191e/QEQE83Ok0lQ.jpg" + ] + }); + proxy.addEventListener("scroll", function(e){ + Ti.API.debug("Scroll event fired: " + JSON.stringify(e)); + }); + proxy.addEventListener("singletap", function(e){ + alert("Page: " + e.currentPage); + Ti.API.debug("SingleTap event fired: " + JSON.stringify(e)); + }); + proxy.addEventListener("longpress", function(e){ + alert("Page: " + e.currentPage); + Ti.API.debug("LongPress event fired: " + JSON.stringify(e)); + }); + + win.add(proxy); +} + +win.open(); + diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/libs/armeabi-v7a/libcom.gbaldera.titouchgallery.so b/dist/modules/android/com.gbaldera.titouchgallery/1.2/libs/armeabi-v7a/libcom.gbaldera.titouchgallery.so new file mode 100644 index 0000000..980fe27 Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/libs/armeabi-v7a/libcom.gbaldera.titouchgallery.so differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/libs/armeabi/libcom.gbaldera.titouchgallery.so b/dist/modules/android/com.gbaldera.titouchgallery/1.2/libs/armeabi/libcom.gbaldera.titouchgallery.so new file mode 100644 index 0000000..bc8f910 Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/libs/armeabi/libcom.gbaldera.titouchgallery.so differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/libs/x86/libcom.gbaldera.titouchgallery.so b/dist/modules/android/com.gbaldera.titouchgallery/1.2/libs/x86/libcom.gbaldera.titouchgallery.so new file mode 100644 index 0000000..5237376 Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/libs/x86/libcom.gbaldera.titouchgallery.so differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/manifest b/dist/modules/android/com.gbaldera.titouchgallery/1.2/manifest new file mode 100644 index 0000000..23f86c5 --- /dev/null +++ b/dist/modules/android/com.gbaldera.titouchgallery/1.2/manifest @@ -0,0 +1,18 @@ +# +# this is your module manifest and used by Titanium +# during compilation, packaging, distribution, etc. +# +version: 1.2 +apiversion: 2 +description: My module +author: Gustavo Rodriguez Baldera +license: Specify your license +copyright: Copyright (c) 2013 by Your Company +architectures: armeabi;armeabi-v7a;x86 + +# these should not be edited +name: titouchgallery +moduleid: com.gbaldera.titouchgallery +guid: 7b4dfc31-49a6-416f-88a0-1c50d1464cf3 +platform: android +minsdk: 3.1.0.GA diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-hdpi/ic_launcher.png b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..96a442e Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-hdpi/ic_launcher.png differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-hdpi/no_photo.png b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-hdpi/no_photo.png new file mode 100644 index 0000000..52fb348 Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-hdpi/no_photo.png differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-ldpi/ic_launcher.png b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 0000000..9923872 Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-ldpi/ic_launcher.png differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-ldpi/no_photo.png b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-ldpi/no_photo.png new file mode 100644 index 0000000..5d408ee Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-ldpi/no_photo.png differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-mdpi/ic_launcher.png b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..359047d Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-mdpi/ic_launcher.png differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-mdpi/no_photo.png b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-mdpi/no_photo.png new file mode 100644 index 0000000..1bfc3fc Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-mdpi/no_photo.png differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-xhdpi/ic_launcher.png b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..71c6d76 Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-xhdpi/ic_launcher.png differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-xhdpi/no_photo.png b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-xhdpi/no_photo.png new file mode 100644 index 0000000..b891ddc Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/drawable-xhdpi/no_photo.png differ diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/layout/main.xml b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/layout/main.xml new file mode 100644 index 0000000..7d62fbb --- /dev/null +++ b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/layout/main.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/values/strings.xml b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/values/strings.xml new file mode 100644 index 0000000..ee5af40 --- /dev/null +++ b/dist/modules/android/com.gbaldera.titouchgallery/1.2/platform/android/res/values/strings.xml @@ -0,0 +1,4 @@ + + + ACTIVITY_ENTRY_NAME + diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/timodule.xml b/dist/modules/android/com.gbaldera.titouchgallery/1.2/timodule.xml new file mode 100644 index 0000000..6affb2f --- /dev/null +++ b/dist/modules/android/com.gbaldera.titouchgallery/1.2/timodule.xml @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/dist/modules/android/com.gbaldera.titouchgallery/1.2/titouchgallery.jar b/dist/modules/android/com.gbaldera.titouchgallery/1.2/titouchgallery.jar new file mode 100644 index 0000000..3720ad2 Binary files /dev/null and b/dist/modules/android/com.gbaldera.titouchgallery/1.2/titouchgallery.jar differ diff --git a/dist/titouchgallery.jar b/dist/titouchgallery.jar index 7d6ee3d..3720ad2 100644 Binary files a/dist/titouchgallery.jar and b/dist/titouchgallery.jar differ diff --git a/lib/armeabi-v7a/libcom.gbaldera.titouchgallery.so b/lib/armeabi-v7a/libcom.gbaldera.titouchgallery.so new file mode 100644 index 0000000..0c46426 Binary files /dev/null and b/lib/armeabi-v7a/libcom.gbaldera.titouchgallery.so differ diff --git a/lib/armeabi/libcom.gbaldera.titouchgallery.so b/lib/armeabi/libcom.gbaldera.titouchgallery.so new file mode 100644 index 0000000..6ae96d2 Binary files /dev/null and b/lib/armeabi/libcom.gbaldera.titouchgallery.so differ diff --git a/lib/x86/libcom.gbaldera.titouchgallery.so b/lib/x86/libcom.gbaldera.titouchgallery.so new file mode 100644 index 0000000..95b205a Binary files /dev/null and b/lib/x86/libcom.gbaldera.titouchgallery.so differ diff --git a/libs/armeabi-v7a/libcom.gbaldera.titouchgallery.so b/libs/armeabi-v7a/libcom.gbaldera.titouchgallery.so index 0c46426..980fe27 100644 Binary files a/libs/armeabi-v7a/libcom.gbaldera.titouchgallery.so and b/libs/armeabi-v7a/libcom.gbaldera.titouchgallery.so differ diff --git a/libs/armeabi/libcom.gbaldera.titouchgallery.so b/libs/armeabi/libcom.gbaldera.titouchgallery.so index 6ae96d2..bc8f910 100644 Binary files a/libs/armeabi/libcom.gbaldera.titouchgallery.so and b/libs/armeabi/libcom.gbaldera.titouchgallery.so differ diff --git a/libs/x86/libcom.gbaldera.titouchgallery.so b/libs/x86/libcom.gbaldera.titouchgallery.so index 95b205a..5237376 100644 Binary files a/libs/x86/libcom.gbaldera.titouchgallery.so and b/libs/x86/libcom.gbaldera.titouchgallery.so differ diff --git a/manifest b/manifest index 6435c54..23f86c5 100644 --- a/manifest +++ b/manifest @@ -2,13 +2,13 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 1.1 +version: 1.2 apiversion: 2 description: My module author: Gustavo Rodriguez Baldera license: Specify your license copyright: Copyright (c) 2013 by Your Company - +architectures: armeabi;armeabi-v7a;x86 # these should not be edited name: titouchgallery diff --git a/src/com/gbaldera/titouchgallery/TouchGalleryView.java b/src/com/gbaldera/titouchgallery/TouchGalleryView.java index 651de65..e9ac5e0 100644 --- a/src/com/gbaldera/titouchgallery/TouchGalleryView.java +++ b/src/com/gbaldera/titouchgallery/TouchGalleryView.java @@ -28,7 +28,6 @@ public class TouchGalleryView extends TiUIView { private static final String TAG = "TouchGallery"; - private TouchGalleryProxy mProxy; private final LinearLayout mContainer; private final GestureDetector mGestureDetector; @@ -41,7 +40,6 @@ public class TouchGalleryView extends TiUIView { public TouchGalleryView(TiViewProxy proxy) { super(proxy); mProxy = (TouchGalleryProxy) proxy; - mGestureDetector = new GestureDetector(proxy.getActivity(), new GestureListener()); mContainer = (new LinearLayout(proxy.getActivity()) { diff --git a/src/ru/truba/touchgallery/TouchView/UrlTouchImageView.java b/src/ru/truba/touchgallery/TouchView/UrlTouchImageView.java index 12ed140..e581ba6 100755 --- a/src/ru/truba/touchgallery/TouchView/UrlTouchImageView.java +++ b/src/ru/truba/touchgallery/TouchView/UrlTouchImageView.java @@ -88,6 +88,7 @@ protected Bitmap doInBackground(String... strings) { try { URL aURL = new URL(url); URLConnection conn = aURL.openConnection(); + conn.setUseCaches(false); conn.connect(); InputStream is = conn.getInputStream(); int totalLen = conn.getContentLength();