[Tynstep-svn] r234 - in trunk: . android android/step_viewer android/step_viewer/.settings android/step_viewer/bin android/step_viewer/bin/classes android/step_viewer/bin/classes/com android/step_viewer/bin/classes/com/tyndalehouse android/step_viewer/bin/classes/com/tyndalehouse/step android/step_viewer/bin/res android/step_viewer/bin/res/drawable android/step_viewer/bin/res/drawable-hdpi android/step_viewer/bin/res/drawable-ldpi android/step_viewer/bin/res/drawable-mdpi android/step_viewer/gen android/step_viewer/gen/com android/step_viewer/gen/com/tyndalehouse android/step_viewer/gen/com/tyndalehouse/step android/step_viewer/res android/step_viewer/res/drawable android/step_viewer/res/drawable-hdpi android/step_viewer/res/drawable-ldpi android/step_viewer/res/drawable-mdpi android/step_viewer/res/layout android/step_viewer/res/values android/step_viewer/src android/step_viewer/src/com android/step_viewer/src/com/tyndalehouse android/step_viewer/src/com/tyndalehouse/step

tst25 at crosswire.org tst25 at crosswire.org
Wed Feb 29 15:35:52 MST 2012


Author: tst25
Date: 2012-02-29 15:35:51 -0700 (Wed, 29 Feb 2012)
New Revision: 234

Added:
   trunk/android/
   trunk/android/step_viewer/
   trunk/android/step_viewer/.classpath
   trunk/android/step_viewer/.project
   trunk/android/step_viewer/.settings/
   trunk/android/step_viewer/.settings/org.eclipse.jdt.core.prefs
   trunk/android/step_viewer/AndroidManifest.xml
   trunk/android/step_viewer/assets/
   trunk/android/step_viewer/bin/
   trunk/android/step_viewer/bin/classes.dex
   trunk/android/step_viewer/bin/classes/
   trunk/android/step_viewer/bin/classes/com/
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/FullGallery.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$attr.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$drawable.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$id.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$layout.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$string.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$styleable.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen$1.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$1.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$ImageAdapter.class
   trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer.class
   trunk/android/step_viewer/bin/res/
   trunk/android/step_viewer/bin/res/drawable-hdpi/
   trunk/android/step_viewer/bin/res/drawable-hdpi/ic_launcher.png
   trunk/android/step_viewer/bin/res/drawable-ldpi/
   trunk/android/step_viewer/bin/res/drawable-ldpi/ic_launcher.png
   trunk/android/step_viewer/bin/res/drawable-mdpi/
   trunk/android/step_viewer/bin/res/drawable-mdpi/ic_launcher.png
   trunk/android/step_viewer/bin/res/drawable/
   trunk/android/step_viewer/bin/res/drawable/thouse.png
   trunk/android/step_viewer/bin/resources.ap_
   trunk/android/step_viewer/bin/step_viewer.apk
   trunk/android/step_viewer/gen/
   trunk/android/step_viewer/gen/com/
   trunk/android/step_viewer/gen/com/tyndalehouse/
   trunk/android/step_viewer/gen/com/tyndalehouse/step/
   trunk/android/step_viewer/gen/com/tyndalehouse/step/R.java
   trunk/android/step_viewer/proguard.cfg
   trunk/android/step_viewer/project.properties
   trunk/android/step_viewer/res/
   trunk/android/step_viewer/res/drawable-hdpi/
   trunk/android/step_viewer/res/drawable-hdpi/ic_launcher.png
   trunk/android/step_viewer/res/drawable-ldpi/
   trunk/android/step_viewer/res/drawable-ldpi/ic_launcher.png
   trunk/android/step_viewer/res/drawable-mdpi/
   trunk/android/step_viewer/res/drawable-mdpi/ic_launcher.png
   trunk/android/step_viewer/res/drawable/
   trunk/android/step_viewer/res/drawable/step.jpg
   trunk/android/step_viewer/res/drawable/step_2.jpg
   trunk/android/step_viewer/res/drawable/thouse.png
   trunk/android/step_viewer/res/drawable/wilson1.gif
   trunk/android/step_viewer/res/drawable/wilson2.gif
   trunk/android/step_viewer/res/layout/
   trunk/android/step_viewer/res/layout/main.xml
   trunk/android/step_viewer/res/layout/splash.xml
   trunk/android/step_viewer/res/layout/viewer.xml
   trunk/android/step_viewer/res/values/
   trunk/android/step_viewer/res/values/attrs.xml
   trunk/android/step_viewer/res/values/strings.xml
   trunk/android/step_viewer/src/
   trunk/android/step_viewer/src/com/
   trunk/android/step_viewer/src/com/tyndalehouse/
   trunk/android/step_viewer/src/com/tyndalehouse/step/
   trunk/android/step_viewer/src/com/tyndalehouse/step/FullGallery.java
   trunk/android/step_viewer/src/com/tyndalehouse/step/SplashScreen.java
   trunk/android/step_viewer/src/com/tyndalehouse/step/Viewer.java
Log:
Added basic android app to view book page images. Still a lot of bugs to fix surrounding the pinch zoom functionality.

Added: trunk/android/step_viewer/.classpath
===================================================================
--- trunk/android/step_viewer/.classpath	                        (rev 0)
+++ trunk/android/step_viewer/.classpath	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+	<classpathentry kind="output" path="bin/classes"/>
+</classpath>

Added: trunk/android/step_viewer/.project
===================================================================
--- trunk/android/step_viewer/.project	                        (rev 0)
+++ trunk/android/step_viewer/.project	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>step_viewer</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: trunk/android/step_viewer/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/android/step_viewer/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ trunk/android/step_viewer/.settings/org.eclipse.jdt.core.prefs	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,12 @@
+#Wed Feb 29 17:22:45 GMT 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5

Added: trunk/android/step_viewer/AndroidManifest.xml
===================================================================
--- trunk/android/step_viewer/AndroidManifest.xml	                        (rev 0)
+++ trunk/android/step_viewer/AndroidManifest.xml	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest
+	xmlns:android="http://schemas.android.com/apk/res/android"
+	package="com.tyndalehouse.step"
+	android:versionCode="1"
+	android:versionName="1.0">
+	<application
+		android:icon="@drawable/thouse"
+		android:label="@string/app_name"
+		android:debuggable="true">
+        
+        <activity 
+            android:name=".SplashScreen"
+            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+            android:label="@string/app_name"
+            android:launchMode="standard"	
+            android:screenOrientation="portrait">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.LAUNCHER"/>
+            </intent-filter>
+        </activity>
+        
+		<activity
+			android:name=".Viewer"
+			android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+			android:label="@string/app_name"
+            android:launchMode="standard" >
+			<intent-filter>
+				<action android:name="com.tyndalehouse.step.Viewer" />
+				<category android:name="android.intent.category.DEFAULT" />
+			</intent-filter>
+		</activity>
+	</application>
+</manifest>
\ No newline at end of file

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/FullGallery.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/FullGallery.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$attr.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$attr.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$drawable.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$drawable.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$id.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$id.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$layout.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$layout.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$string.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$string.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$styleable.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R$styleable.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/R.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen$1.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen$1.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/SplashScreen.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$1.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$1.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$ImageAdapter.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer$ImageAdapter.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer.class
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes/com/tyndalehouse/step/Viewer.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/classes.dex
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/classes.dex
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/res/drawable/thouse.png
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/res/drawable/thouse.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/res/drawable-hdpi/ic_launcher.png
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/res/drawable-hdpi/ic_launcher.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/res/drawable-ldpi/ic_launcher.png
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/res/drawable-ldpi/ic_launcher.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/res/drawable-mdpi/ic_launcher.png
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/res/drawable-mdpi/ic_launcher.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/resources.ap_
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/resources.ap_
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/bin/step_viewer.apk
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/bin/step_viewer.apk
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/gen/com/tyndalehouse/step/R.java
===================================================================
--- trunk/android/step_viewer/gen/com/tyndalehouse/step/R.java	                        (rev 0)
+++ trunk/android/step_viewer/gen/com/tyndalehouse/step/R.java	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,57 @@
+/* AUTO-GENERATED FILE.  DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found.  It
+ * should not be modified by hand.
+ */
+
+package com.tyndalehouse.step;
+
+public final class R {
+    public static final class attr {
+    }
+    public static final class drawable {
+        public static final int ic_launcher=0x7f020000;
+        public static final int step=0x7f020001;
+        public static final int step_2=0x7f020002;
+        public static final int thouse=0x7f020003;
+        public static final int wilson1=0x7f020004;
+        public static final int wilson2=0x7f020005;
+    }
+    public static final class id {
+        public static final int gallery=0x7f050000;
+    }
+    public static final class layout {
+        public static final int main=0x7f030000;
+        public static final int splash=0x7f030001;
+        public static final int viewer=0x7f030002;
+    }
+    public static final class string {
+        public static final int app_name=0x7f040001;
+        public static final int gallery_2_text=0x7f040004;
+        public static final int hello=0x7f040000;
+        public static final int select_book=0x7f040003;
+        public static final int title=0x7f040002;
+    }
+    public static final class styleable {
+        /** Attributes that can be used with a Viewer.
+           <p>Includes the following attributes:</p>
+           <table>
+           <colgroup align="left" />
+           <colgroup align="left" />
+           <tr><th>Attribute</th><th>Description</th></tr>
+           <tr><td><code>{@link #Viewer_android_galleryItemBackground com.tyndalehouse.step:android_galleryItemBackground}</code></td><td></td></tr>
+           </table>
+           @see #Viewer_android_galleryItemBackground
+         */
+        public static final int[] Viewer = {
+            0x0101004c
+        };
+        /**
+          <p>This symbol is the offset where the {@link com.tyndalehouse.step.R.attr#android_galleryItemBackground}
+          attribute's value can be found in the {@link #Viewer} array.
+          @attr name android:android_galleryItemBackground
+        */
+        public static final int Viewer_android_galleryItemBackground = 0;
+    };
+}

Added: trunk/android/step_viewer/proguard.cfg
===================================================================
--- trunk/android/step_viewer/proguard.cfg	                        (rev 0)
+++ trunk/android/step_viewer/proguard.cfg	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,40 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+    native <methods>;
+}
+
+-keepclasseswithmembers class * {
+    public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+    public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.app.Activity {
+   public void *(android.view.View);
+}
+
+-keepclassmembers enum * {
+    public static **[] values();
+    public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+  public static final android.os.Parcelable$Creator *;
+}

Added: trunk/android/step_viewer/project.properties
===================================================================
--- trunk/android/step_viewer/project.properties	                        (rev 0)
+++ trunk/android/step_viewer/project.properties	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-8

Added: trunk/android/step_viewer/res/drawable/step.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/res/drawable/step.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/res/drawable/step_2.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/res/drawable/step_2.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/res/drawable/thouse.png
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/res/drawable/thouse.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/res/drawable/wilson1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/res/drawable/wilson1.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/res/drawable/wilson2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/res/drawable/wilson2.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/res/drawable-hdpi/ic_launcher.png
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/res/drawable-hdpi/ic_launcher.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/res/drawable-ldpi/ic_launcher.png
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/res/drawable-ldpi/ic_launcher.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/res/drawable-mdpi/ic_launcher.png
===================================================================
(Binary files differ)


Property changes on: trunk/android/step_viewer/res/drawable-mdpi/ic_launcher.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/android/step_viewer/res/layout/main.xml
===================================================================
--- trunk/android/step_viewer/res/layout/main.xml	                        (rev 0)
+++ trunk/android/step_viewer/res/layout/main.xml	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:orientation="vertical" >
+
+    <TextView
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/hello" />
+
+</LinearLayout>
\ No newline at end of file

Added: trunk/android/step_viewer/res/layout/splash.xml
===================================================================
--- trunk/android/step_viewer/res/layout/splash.xml	                        (rev 0)
+++ trunk/android/step_viewer/res/layout/splash.xml	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    >
+<ImageView
+ 	android:layout_width="match_parent"
+  	android:layout_height="match_parent"
+   	android:src="@drawable/step"
+  	/>
+</LinearLayout>
\ No newline at end of file

Added: trunk/android/step_viewer/res/layout/viewer.xml
===================================================================
--- trunk/android/step_viewer/res/layout/viewer.xml	                        (rev 0)
+++ trunk/android/step_viewer/res/layout/viewer.xml	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,17 @@
+<?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" 
+    />
+<com.tyndalehouse.step.FullGallery 
+    android:id="@+id/gallery"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:gravity="center" 
+    />
+</LinearLayout>
\ No newline at end of file

Added: trunk/android/step_viewer/res/values/attrs.xml
===================================================================
--- trunk/android/step_viewer/res/values/attrs.xml	                        (rev 0)
+++ trunk/android/step_viewer/res/values/attrs.xml	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <declare-styleable name="Viewer">
+        <attr name="android:galleryItemBackground" />
+    </declare-styleable>
+</resources>
\ No newline at end of file

Added: trunk/android/step_viewer/res/values/strings.xml
===================================================================
--- trunk/android/step_viewer/res/values/strings.xml	                        (rev 0)
+++ trunk/android/step_viewer/res/values/strings.xml	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="hello">Hello World!</string>
+    <string name="app_name">STEP Viewer</string>
+    <string name="title">Tyndale House STEP Viewer</string>
+    <string name="select_book">Please select a book</string>
+    <string name="gallery_2_text">LONG PRESS DOES SOMETHING</string>
+</resources>

Added: trunk/android/step_viewer/src/com/tyndalehouse/step/FullGallery.java
===================================================================
--- trunk/android/step_viewer/src/com/tyndalehouse/step/FullGallery.java	                        (rev 0)
+++ trunk/android/step_viewer/src/com/tyndalehouse/step/FullGallery.java	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,183 @@
+package com.tyndalehouse.step;
+
+import android.content.Context;
+import android.graphics.Matrix;
+import android.graphics.PointF;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.GestureDetector;
+import android.view.GestureDetector.OnGestureListener;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.ScaleGestureDetector;
+import android.view.ScaleGestureDetector.OnScaleGestureListener;
+import android.widget.Gallery;
+import android.widget.ImageView;
+
+public class FullGallery extends Gallery implements OnGestureListener, OnScaleGestureListener {
+
+	private static final String TAG = "Gallery";
+	static final int NONE = 0;
+	static final int DRAG = 1;  
+	int mode = NONE;
+		
+	private Context c;
+		
+	private ScaleGestureDetector mScaleDetector;
+	private GestureDetector mDetector;
+	private float mScaleFactor = 1.f;
+	
+	float new_distance_touch, old_distance_touch, init_x, init_y;
+	
+	Matrix matrix = new Matrix();
+	Matrix savedMatrix = new Matrix();
+	
+	PointF mid = new PointF();
+	PointF start = new PointF();
+	
+	ImageView imgPicture;
+	
+	public FullGallery(Context context, AttributeSet attrSet) {
+	    super(context, attrSet);
+	    
+	    c = context;
+	    mDetector = new GestureDetector(c,this);
+	    mScaleDetector = new ScaleGestureDetector(c, this);
+	}
+
+	
+	@Override
+	public boolean onTouchEvent(MotionEvent event) { //gesture detector for the movements
+	    imgPicture = (ImageView) super.getSelectedView();
+	
+	    if (mDetector.onTouchEvent(event)) {
+	        Log.d("onTouchEvent", "--[ MOVEMENT ]--");
+	        switch (event.getAction() & MotionEvent.ACTION_MASK) {
+	        case MotionEvent.ACTION_DOWN:
+	            init_x = event.getX();
+	            init_y = event.getY();
+	            midPoint(mid, event);
+	            savedMatrix.set(matrix);
+	            start.set(event.getX(), event.getY());
+	            Log.d(TAG, "mode=DRAG" );
+	            mode = DRAG;
+	            break;
+	            
+	        case MotionEvent.ACTION_MOVE:
+	            if (mode == DRAG) {
+	                matrix.set(savedMatrix);
+	                matrix.postTranslate(event.getX() - start.x, event.getY() - start.y);
+	            }
+	            break;
+	        }
+	
+	        imgPicture = (ImageView) super.getSelectedView();
+	        imgPicture.setImageMatrix(matrix);
+	
+	        return true;
+	    }
+	    else if(mScaleDetector.onTouchEvent(event)) { // scale detector for zoom
+	        Log.d("onTouchEvent", "--[ SCALE ]--");
+	        return true;
+	    }
+	    else 
+	        return false;
+	}
+	
+		
+	
+	public boolean onScale(ScaleGestureDetector detector) {
+	
+	    mScaleFactor *= detector.getScaleFactor();
+	    mScaleFactor = Math.max(0.1f, Math.min(mScaleFactor, 5.0f));
+	
+	    if (new_distance_touch > 10f) {
+	        matrix.set(savedMatrix);
+	        matrix.postScale(mScaleFactor, mScaleFactor, mid.x, mid.y);
+	        Log.d("ZOOMMING",matrix.toShortString());
+	    }
+	    else {
+	        matrix.set(savedMatrix);
+	        matrix.postTranslate(init_x - start.x, init_y - start.y);
+	        Log.d("PANNING",matrix.toShortString());
+	    }
+	
+	    imgPicture.setImageMatrix(matrix);
+	
+	    imgPicture.invalidate();
+	
+	    Log.d("MATRIX", matrix.toString());
+	    return true;
+	}
+	
+	//@Override
+	public boolean onScaleBegin(ScaleGestureDetector detector) {
+	    Log.d(TAG, "-- onScaleBegin --");
+	    matrix = imgPicture.getImageMatrix();
+	    savedMatrix.set(matrix);
+	    start.set(init_x, init_y);
+	    return true;
+	}
+	
+	//@Override
+	public void onScaleEnd(ScaleGestureDetector detector) {
+	    Log.d(TAG, "-- onScaleEnd --");
+	    old_distance_touch = detector.getPreviousSpan();
+	    new_distance_touch = detector.getCurrentSpan();
+	
+	}
+	
+	@Override
+	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
+	    Log.d(TAG, "-- onFling --");
+	
+	    float velMax = 2500f;
+	    float velMin = 1000f;
+	    float velX = Math.abs(velocityX);
+	    if (velX > velMax) {
+	      velX = velMax;
+	    } 
+	    else if (velX < velMin) {
+	      velX = velMin;
+	    }
+	    velX -= 600;
+	    int k = 500000;
+	    int speed = (int) Math.floor(1f / velX * k);
+	    setAnimationDuration(speed);
+	
+	    int kEvent;
+	    if (isScrollingLeft(e1, e2)) {
+	      kEvent = KeyEvent.KEYCODE_DPAD_LEFT;
+	    } else {
+	      kEvent = KeyEvent.KEYCODE_DPAD_RIGHT;
+	    }
+	    onKeyDown(kEvent, null);
+	
+	    return true;
+	}
+
+	private boolean isScrollingLeft(MotionEvent e1, MotionEvent e2){
+	    return e2.getX() > e1.getX();
+	}
+	
+	@Override
+	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
+	    Log.d(TAG, "-- onScroll --");
+	    return super.onScroll(e1, e2, distanceX, distanceY);
+	}
+	
+//	private float spacing(MotionEvent event) {
+//		float x = event.getX(0) - event.getX(1);
+//		float y = event.getY(0) - event.getY(1);
+//		return FloatMath.sqrt(x * x + y * y);
+//		}
+//	
+	
+	
+	private void midPoint(PointF point, MotionEvent event) {
+	    float x = event.getX(0) + event.getX(1);
+	    float y = event.getY(0) + event.getY(1);
+	    point.set(x / 2, y / 2);
+	}
+	
+}
\ No newline at end of file

Added: trunk/android/step_viewer/src/com/tyndalehouse/step/SplashScreen.java
===================================================================
--- trunk/android/step_viewer/src/com/tyndalehouse/step/SplashScreen.java	                        (rev 0)
+++ trunk/android/step_viewer/src/com/tyndalehouse/step/SplashScreen.java	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,50 @@
+package com.tyndalehouse.step;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.MotionEvent;
+
+public class SplashScreen extends Activity {
+    protected boolean active = true;
+    protected int splashTime = 5000;
+    protected int timeIncrement = 100;
+    protected int sleepTime = 100;
+    
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate( Bundle savedInstanceState ) {
+        super.onCreate( savedInstanceState );
+        setContentView( R.layout.splash );
+        
+        // thread for displaying the SplashScreen
+        Thread splashThread = new Thread() {
+            @Override
+            public void run() {
+                try {
+                    int elapsedTime = 0;
+                    while( active && ( elapsedTime < splashTime ) ) {
+                        sleep( sleepTime );
+                        if( active ) elapsedTime = elapsedTime + timeIncrement;
+                    }
+                } 
+                catch( InterruptedException e ) {
+                    // do nothing
+                } 
+                finally {
+                    finish();
+                    startActivity( new Intent( "com.tyndalehouse.step.Viewer" ) );
+                }
+            }
+        };
+        splashThread.start();
+    }
+    
+    @Override
+    public boolean onTouchEvent( MotionEvent event ) {
+        if ( event.getAction() == MotionEvent.ACTION_DOWN ) {
+            active = false;
+        }
+        return true;
+    }
+}
\ No newline at end of file

Added: trunk/android/step_viewer/src/com/tyndalehouse/step/Viewer.java
===================================================================
--- trunk/android/step_viewer/src/com/tyndalehouse/step/Viewer.java	                        (rev 0)
+++ trunk/android/step_viewer/src/com/tyndalehouse/step/Viewer.java	2012-02-29 22:35:51 UTC (rev 234)
@@ -0,0 +1,145 @@
+package com.tyndalehouse.step;
+
+import com.tyndalehouse.step.R;
+import android.app.Activity;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.os.Bundle;
+import android.view.ContextMenu;
+import android.view.ContextMenu.ContextMenuInfo;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.AdapterView.AdapterContextMenuInfo;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.BaseAdapter;
+import android.widget.Gallery.LayoutParams;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+public class Viewer extends Activity  
+{
+
+	private FullGallery g;
+//	private Cursor c;
+//	private int columnIndex;
+	
+
+	@Override
+	protected void onCreate( Bundle savedInstanceState ) {
+		super.onCreate( savedInstanceState );
+		
+		
+		setContentView( R.layout.viewer );
+		
+//		/** 
+//		 * Query image database to get images 
+//		 */
+//		String[] projection = { MediaStore.Images.Media._ID, MediaStore.Images.Media.ORIENTATION };
+//
+//		c = managedQuery( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, 
+//						projection, 
+//						MediaStore.Images.Media.DATA + " like ? ", 
+//						new String[] { "%STEP/Wilson%" }, 
+//						null );
+//		columnIndex = c.getColumnIndexOrThrow( MediaStore.Images.Media._ID );
+		
+	    /** 
+	     * Set Gallery 
+	     */ 
+
+	    g = ( FullGallery ) findViewById( R.id.gallery );
+	    g.setAdapter( new ImageAdapter( this ) );
+	    g.setFadingEdgeLength(0);
+	    g.setSpacing(2);
+	    
+	    g.setAdapter( new ImageAdapter( this ) );
+	    
+
+	    /** 
+	     * Set up click listener on Gallery 
+	     */
+	    g.setOnItemClickListener( new OnItemClickListener() {
+	        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
+	            
+	        	if ( v != null ) {
+	        		Toast.makeText(Viewer.this, "Page " + (position + 1), Toast.LENGTH_SHORT).show();
+	        	}
+	        }
+	    });
+	    
+	    // We also want to show context menu for longpressed items in the gallery
+	    registerForContextMenu(g);
+	}
+
+	@Override
+    public void onCreateContextMenu( ContextMenu menu, View v, ContextMenuInfo menuInfo ) {
+        menu.add(R.string.gallery_2_text);
+    }
+	
+    @Override
+    public boolean onContextItemSelected( MenuItem item ) {
+        AdapterContextMenuInfo info = ( AdapterContextMenuInfo ) item.getMenuInfo();
+        Toast.makeText(this, "Longpress: " + ( info.position + 1 ), Toast.LENGTH_SHORT).show();
+        return true;
+    }
+
+	public class ImageAdapter extends BaseAdapter {
+		int mGalleryItemBackground;
+		private Context mContext;
+
+		private Integer[] mImageIds = {
+	            R.drawable.wilson1,
+	            R.drawable.wilson2
+	    };
+		
+		public ImageAdapter( Context context ) {
+			mContext = context;
+			TypedArray attr = mContext.obtainStyledAttributes( R.styleable.Viewer );
+			mGalleryItemBackground = attr.getResourceId( R.styleable.Viewer_android_galleryItemBackground, 0 );
+			attr.recycle();
+		}
+
+		public int getCount() {
+//			return c.getCount();
+			return mImageIds.length;
+		}
+
+		public Object getItem( int position ) {
+			return position;
+		}
+		
+		public long getItemId( int position ) {
+			return position;
+		}
+		
+
+		public View getView( int position, View convertView, ViewGroup parent ) {
+			
+		   	ImageView imageView = new ImageView(mContext);
+
+//		   	// Move cursor to current position
+//			c.moveToPosition(position);
+//			
+//			// Get the current value for the requested column
+//			int imageID = c.getInt(columnIndex);
+//			
+//			// Obtain the image URI
+//			Uri uri = Uri.withAppendedPath( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, Integer.toString( imageID ) );
+//
+//			// Set the content of the image based on the image URI
+//			imageView.setImageURI( uri );
+			
+			// Set content of the image from resources
+			imageView.setImageResource( mImageIds[position] );
+			
+		   	imageView.setLayoutParams( new LayoutParams( LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT ) );
+			imageView.setScaleType( ImageView.ScaleType.FIT_CENTER );
+
+			return imageView;
+		}
+	}
+	
+}
+




More information about the Tynstep-svn mailing list