Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,8 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.appcelerator.titanium.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.aptana.ide.core.unifiedBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>com.appcelerator.titanium.mobile.module.nature</nature>
<nature>com.aptana.projects.webnature</nature>
</natures>
</projectDescription>
8 changes: 4 additions & 4 deletions build.properties
Original file line number Diff line number Diff line change
@@ -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
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
Binary file added dist/com.gbaldera.titouchgallery-android-1.2.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO: place your license here and we'll include it in the module distribution
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<h1>TiTouchGallery Module</h1>
<h2>Description</h2>
<p>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.</p>
<h2>Copyright</h2>
<p>This module is a fork of the android gallery widget from <a href="https://github.com/Dreddik/AndroidTouchGallery">Dreddik</a> with some changes.
<br>Thanks Dreddik for share this.</p>
<h2>Accessing the TiTouchGallery Module</h2>
<p>To access this module from JavaScript, you would do the following:</p>
<pre><code>var titouchgallery = require("com.gbaldera.titouchgallery");
</code></pre>
<p>The titouchgallery variable is a reference to the Module object. <br />
</p>
<h2>Properties</h2>
<h4>images : String[]</h4>
<p>Array of images to display in the gallery (Only Remote images are supported for now)</p>
<h4>currentPage : Number</h4>
<p>ndex of the active page</p>
<h2>Methods</h2>
<p>List of methods supported in this module:</p>
<h4>Gallery creation</h4>
<pre><code>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
});
</code></pre>
<h4>getImages : String[]</h4>
<p>Get the array with the images displayed in the gallery.</p>
<h5>Arguments</h5>
<p>None</p>
<h4>setImages</h4>
<p>Set the array with the images to be displayed in the gallery.</p>
<h5>Arguments</h5>
<ul>
<li>Images [array]: Images to be displayed in the gallery</li>
</ul>
<h4>addImage</h4>
<p>Adds a new image to the gallery</p>
<h5>Arguments</h5>
<ul>
<li>Image [string]: Image URL to be added to the gallery</li>
</ul>
<h4>removeImage</h4>
<p>Removes the specified image from the gallery</p>
<h5>Arguments</h5>
<ul>
<li>Image [string]: Image URL to be removed from the gallery</li>
</ul>
<h4>getCount : Number</h4>
<p>Get the total number of images in the gallery.</p>
<h5>Arguments</h5>
<p>None</p>
<h4>moveNext</h4>
<p>Sets the current page to the next consecutive page in images.</p>
<h5>Arguments</h5>
<p>None</p>
<h4>movePrevious</h4>
<p>Sets the current page to the previous consecutive page in images.</p>
<h5>Arguments</h5>
<p>None</p>
<h4>getCurrentPage : Number</h4>
<p>Gets the value of the currentPage property.</p>
<h5>Arguments</h5>
<p>None</p>
<h4>setCurrentPage</h4>
<p>Sets the value of the currentPage property.</p>
<h5>Arguments</h5>
<ul>
<li>currentPage [number]: New value for the currentPage property</li>
</ul>
<h2>Events</h2>
<h3>singletap</h3>
<p>Fired when the device detects a single tap against the view.</p>
<h4>Properties</h4>
<ul>
<li>currentPage : Index of the image.</li>
<li>url : URL of the image.</li>
<li>source : Source object that fired the event.</li>
<li>type : String Name of the event fired.</li>
<li>x : NumberX coordinate of the event from the source view's coordinate system.</li>
<li>y : NumberY coordinate of the event from the source view's coordinate system.</li>
</ul>
<h3>longpress</h3>
<p>Fired when the device detects a long press against this view.</p>
<h4>Properties</h4>
<ul>
<li>currentPage : Index of the image.</li>
<li>url : URL of the image.</li>
<li>source : Source object that fired the event.</li>
<li>type : String Name of the event fired.</li>
<li>x : NumberX coordinate of the event from the source view's coordinate system.</li>
<li>y : NumberY coordinate of the event from the source view's coordinate system.</li>
</ul>
<h3>scroll</h3>
<p>Fired when the gallery changed the page</p>
<h4>Properties</h4>
<ul>
<li>currentPage : Index of the image.</li>
<li>url : URL of the image.</li>
</ul>
<h2>Usage</h2>
<p>```</p>
<p>var win = Ti.UI.createWindow({
backgroundColor:'#000'
});</p>
<p>var titouchgallery = require('com.gbaldera.titouchgallery');</p>
<p>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));
});</p>
<pre><code>win.add(proxy);
</code></pre>
<p>}</p>
<p>win.open();</p>
<p>```</p>
<h2>TODO</h2>
<ul>
<li>Add support for local images.</li>
<li>Cache remote images.</li>
</ul>
<h2>Changelog</h2>
<ul>
<li>1.1:</li>
<li>Fixed single tap and added long press events</li>
<li>1.0: Initial version</li>
</ul>
<h2>Author</h2>
<p>Gustavo Rodriguez Baldera</p>
<p><a href="www.gbaldera.com">www.gbaldera.com</a> </p>
<h2>License</h2>
<p>It's open source and it's under <a href="http://www.dbad-license.org/">DBAD License</a></p>
Original file line number Diff line number Diff line change
@@ -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();

Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 18 additions & 0 deletions dist/modules/android/com.gbaldera.titouchgallery/1.2/manifest
Original file line number Diff line number Diff line change
@@ -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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello World, ACTIVITY_ENTRY_NAME"
/>
</LinearLayout>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">ACTIVITY_ENTRY_NAME</string>
</resources>
13 changes: 13 additions & 0 deletions dist/modules/android/com.gbaldera.titouchgallery/1.2/timodule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ti:module xmlns:ti="http://ti.appcelerator.org" xmlns:android="http://schemas.android.com/apk/res/android">
<!--
Similar to tiapp.xml, but contains module/platform specific
configuration in <iphone>, <android>, and <mobileweb> sections
-->
<iphone>
</iphone>
<android xmlns:android="http://schemas.android.com/apk/res/android">
</android>
<mobileweb>
</mobileweb>
</ti:module>
Binary file not shown.
Binary file modified dist/titouchgallery.jar
Binary file not shown.
Binary file added lib/armeabi-v7a/libcom.gbaldera.titouchgallery.so
Binary file not shown.
Binary file added lib/armeabi/libcom.gbaldera.titouchgallery.so
Binary file not shown.
Binary file added lib/x86/libcom.gbaldera.titouchgallery.so
Binary file not shown.
Binary file modified libs/armeabi-v7a/libcom.gbaldera.titouchgallery.so
Binary file not shown.
Binary file modified libs/armeabi/libcom.gbaldera.titouchgallery.so
Binary file not shown.
Binary file modified libs/x86/libcom.gbaldera.titouchgallery.so
Binary file not shown.
4 changes: 2 additions & 2 deletions manifest
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/com/gbaldera/titouchgallery/TouchGalleryView.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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())
{
Expand Down
1 change: 1 addition & 0 deletions src/ru/truba/touchgallery/TouchView/UrlTouchImageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down