From 1a95ab399441cdf3e67d357df43f1ae1c3616ddd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 3 May 2014 22:47:09 -0400 Subject: initial commit --- .classpath | 9 ++++ .gitignore | 2 + .project | 33 ++++++++++++++ AndroidManifest.xml | 37 ++++++++++++++++ libs/android-support-v4.jar | Bin 0 -> 627582 bytes proguard-project.txt | 20 +++++++++ project.properties | 14 ++++++ res/drawable-hdpi/ic_launcher.png | Bin 0 -> 9397 bytes res/drawable-mdpi/ic_launcher.png | Bin 0 -> 5237 bytes res/drawable-xhdpi/ic_launcher.png | Bin 0 -> 14383 bytes res/layout/ime.xml | 20 +++++++++ res/raw/gestures | Bin 0 -> 93080 bytes res/values-v11/styles.xml | 11 +++++ res/values-v14/styles.xml | 12 ++++++ res/values/strings.xml | 7 +++ res/values/styles.xml | 20 +++++++++ res/xml/method.xml | 2 + src/us/minak/DrawingSpaceView.java | 60 ++++++++++++++++++++++++++ src/us/minak/IMEService.java | 33 ++++++++++++++ src/us/minak/IMEView.java | 11 +++++ src/us/minak/OnGestureRecognizedListener.java | 26 +++++++++++ 21 files changed, 317 insertions(+) create mode 100644 .classpath create mode 100644 .gitignore create mode 100644 .project create mode 100644 AndroidManifest.xml create mode 100644 libs/android-support-v4.jar create mode 100644 proguard-project.txt create mode 100644 project.properties create mode 100644 res/drawable-hdpi/ic_launcher.png create mode 100644 res/drawable-mdpi/ic_launcher.png create mode 100644 res/drawable-xhdpi/ic_launcher.png create mode 100644 res/layout/ime.xml create mode 100644 res/raw/gestures create mode 100644 res/values-v11/styles.xml create mode 100644 res/values-v14/styles.xml create mode 100644 res/values/strings.xml create mode 100644 res/values/styles.xml create mode 100644 res/xml/method.xml create mode 100644 src/us/minak/DrawingSpaceView.java create mode 100644 src/us/minak/IMEService.java create mode 100644 src/us/minak/IMEView.java create mode 100644 src/us/minak/OnGestureRecognizedListener.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..7bc01d9 --- /dev/null +++ b/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a22392a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/bin +/gen diff --git a/.project b/.project new file mode 100644 index 0000000..ef25403 --- /dev/null +++ b/.project @@ -0,0 +1,33 @@ + + + Minak + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/AndroidManifest.xml b/AndroidManifest.xml new file mode 100644 index 0000000..b061ef0 --- /dev/null +++ b/AndroidManifest.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + diff --git a/libs/android-support-v4.jar b/libs/android-support-v4.jar new file mode 100644 index 0000000..a7e9919 Binary files /dev/null and b/libs/android-support-v4.jar differ diff --git a/proguard-project.txt b/proguard-project.txt new file mode 100644 index 0000000..f2fe155 --- /dev/null +++ b/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/project.properties b/project.properties new file mode 100644 index 0000000..4ab1256 --- /dev/null +++ b/project.properties @@ -0,0 +1,14 @@ +# 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 edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-19 diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..96a442e Binary files /dev/null and b/res/drawable-hdpi/ic_launcher.png differ diff --git a/res/drawable-mdpi/ic_launcher.png b/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..359047d Binary files /dev/null and b/res/drawable-mdpi/ic_launcher.png differ diff --git a/res/drawable-xhdpi/ic_launcher.png b/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..71c6d76 Binary files /dev/null and b/res/drawable-xhdpi/ic_launcher.png differ diff --git a/res/layout/ime.xml b/res/layout/ime.xml new file mode 100644 index 0000000..510d40a --- /dev/null +++ b/res/layout/ime.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/res/raw/gestures b/res/raw/gestures new file mode 100644 index 0000000..3cc9d7c Binary files /dev/null and b/res/raw/gestures differ diff --git a/res/values-v11/styles.xml b/res/values-v11/styles.xml new file mode 100644 index 0000000..3c02242 --- /dev/null +++ b/res/values-v11/styles.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/res/values-v14/styles.xml b/res/values-v14/styles.xml new file mode 100644 index 0000000..a91fd03 --- /dev/null +++ b/res/values-v14/styles.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml new file mode 100644 index 0000000..2485e35 --- /dev/null +++ b/res/values/strings.xml @@ -0,0 +1,7 @@ + + + Minak + Minak IME Label + Minak Settings Label + + diff --git a/res/values/styles.xml b/res/values/styles.xml new file mode 100644 index 0000000..6ce89c7 --- /dev/null +++ b/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/res/xml/method.xml b/res/xml/method.xml new file mode 100644 index 0000000..b8d98ff --- /dev/null +++ b/res/xml/method.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/us/minak/DrawingSpaceView.java b/src/us/minak/DrawingSpaceView.java new file mode 100644 index 0000000..7f9c3fa --- /dev/null +++ b/src/us/minak/DrawingSpaceView.java @@ -0,0 +1,60 @@ +/* + ******************************************************************************** + * Copyright (c) 2012 Samsung Electronics, Inc. + * All rights reserved. + * + * This software is a confidential and proprietary information of Samsung + * Electronics, Inc. ("Confidential Information"). You shall not disclose such + * Confidential Information and shall use it only in accordance with the terms + * of the license agreement you entered into with Samsung Electronics. + ******************************************************************************** + */ + +package us.minak; + +import java.util.List; + +import android.content.Context; +import android.gesture.Gesture; +import android.gesture.GestureLibraries; +import android.gesture.GestureLibrary; +import android.gesture.GestureOverlayView; +import android.gesture.GestureOverlayView.OnGesturePerformedListener; +import android.gesture.Prediction; +import android.util.AttributeSet; + +/** + * Represent a space where drawing gestures are performed. + */ +public class DrawingSpaceView extends GestureOverlayView implements OnGesturePerformedListener { + private static final double SCORE_TRESHOLD = 3.0; + private final GestureLibrary mGestureLibrary; + private OnGestureRecognizedListener mOnGestureRecognizedListener; + + public DrawingSpaceView(Context context, AttributeSet attrs) { + super(context, attrs); + mGestureLibrary = GestureLibraries.fromRawResource(context, R.raw.gestures); + mGestureLibrary.load(); + addOnGesturePerformedListener(this); + } + + public void setOnGestureRecognizedListener(OnGestureRecognizedListener onGestureRecognizedListener) { + mOnGestureRecognizedListener = onGestureRecognizedListener; + } + + @Override + public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) { + final List predictions = mGestureLibrary.recognize(gesture); + Prediction bestPrediction = null; + if (!predictions.isEmpty()) { + bestPrediction = predictions.get(0); + } + if (mOnGestureRecognizedListener != null && bestPrediction != null) { + if (bestPrediction.score > SCORE_TRESHOLD) { + mOnGestureRecognizedListener.gestureRecognized(bestPrediction.name); + } else { + clear(false); + } + } + } +} diff --git a/src/us/minak/IMEService.java b/src/us/minak/IMEService.java new file mode 100644 index 0000000..ba09656 --- /dev/null +++ b/src/us/minak/IMEService.java @@ -0,0 +1,33 @@ +package us.minak; + +import android.inputmethodservice.InputMethodService; +import android.view.View; +import android.view.inputmethod.EditorInfo; + +public class IMEService extends InputMethodService { + private IMEView imeView; + /** + * Loads the configuration. + */ + @Override + public void onInitializeInterface() { + // TODO + } + + @Override + public View onCreateInputView() { + final IMEView view = (IMEView) getLayoutInflater().inflate(R.layout.ime, null); + + // TODO: there probably needs to be more stuff here + + this.imeView = view; + return view; + } + + /** + * Called to inform the input method that text input has started in an editor. + */ + public void onStartInput(EditorInfo info, boolean restarting) { + // TODO: get characters from this.imeView, and pass them to getCurrentInputConnection().commitText(..., 1); + } +} diff --git a/src/us/minak/IMEView.java b/src/us/minak/IMEView.java new file mode 100644 index 0000000..89d6d0a --- /dev/null +++ b/src/us/minak/IMEView.java @@ -0,0 +1,11 @@ +package us.minak; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.RelativeLayout; + +public class IMEView extends RelativeLayout{ + public IMEView(Context context, AttributeSet attrs) { + super(context, attrs); + } +} diff --git a/src/us/minak/OnGestureRecognizedListener.java b/src/us/minak/OnGestureRecognizedListener.java new file mode 100644 index 0000000..a30e8b8 --- /dev/null +++ b/src/us/minak/OnGestureRecognizedListener.java @@ -0,0 +1,26 @@ +/* + ******************************************************************************** + * Copyright (c) 2012 Samsung Electronics, Inc. + * All rights reserved. + * + * This software is a confidential and proprietary information of Samsung + * Electronics, Inc. ("Confidential Information"). You shall not disclose such + * Confidential Information and shall use it only in accordance with the terms + * of the license agreement you entered into with Samsung Electronics. + ******************************************************************************** + */ + +package us.minak; + +/** + * A simple interface for handling recognizing a gesture. + */ +public interface OnGestureRecognizedListener { + /** + * Invoked when a gesture is recognized. + * + * @param character + * The character represented by the gesture. + */ + void gestureRecognized(String character); +} -- cgit v1.2.3 From ccce48b856ee30d517dc661d97bd16cec3d518f2 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Sun, 4 May 2014 18:38:33 -0400 Subject: Added the gestures file. It works for the alphabet right now. Thats it. Nothing else. --- .classpath | 4 ++-- gestures | Bin 0 -> 59420 bytes 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100755 gestures diff --git a/.classpath b/.classpath index 7bc01d9..5176974 100644 --- a/.classpath +++ b/.classpath @@ -1,9 +1,9 @@ - - + + diff --git a/gestures b/gestures new file mode 100755 index 0000000..f21fd64 Binary files /dev/null and b/gestures differ -- cgit v1.2.3 From df348c47b3bacb6c941e609091bbde01ae60f210 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Sun, 4 May 2014 19:23:04 -0400 Subject: Yo luke, added them numbers bruh --- gestures | Bin 59420 -> 77922 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/gestures b/gestures index f21fd64..097ba09 100755 Binary files a/gestures and b/gestures differ -- cgit v1.2.3 From 3d5295df48ee84d406aa8efd60847cb136634a37 Mon Sep 17 00:00:00 2001 From: nfoy Date: Sun, 4 May 2014 19:24:45 -0400 Subject: Uploaded our Icon --- res/drawable-hdpi/ic_launcher.png | Bin 9397 -> 4615 bytes res/drawable-mdpi/ic_launcher.png | Bin 5237 -> 1994 bytes res/drawable-xhdpi/ic_launcher.png | Bin 14383 -> 3538 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png index 96a442e..2494b61 100644 Binary files a/res/drawable-hdpi/ic_launcher.png and b/res/drawable-hdpi/ic_launcher.png differ diff --git a/res/drawable-mdpi/ic_launcher.png b/res/drawable-mdpi/ic_launcher.png index 359047d..deb71bc 100644 Binary files a/res/drawable-mdpi/ic_launcher.png and b/res/drawable-mdpi/ic_launcher.png differ diff --git a/res/drawable-xhdpi/ic_launcher.png b/res/drawable-xhdpi/ic_launcher.png index 71c6d76..50e38d7 100644 Binary files a/res/drawable-xhdpi/ic_launcher.png and b/res/drawable-xhdpi/ic_launcher.png differ -- cgit v1.2.3 From 665330a5eda56339a078944dbfde2efbf84d2a03 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 4 May 2014 19:31:11 -0400 Subject: Add gesture editor (taken mostly from the SDK gesture editor) --- AndroidManifest.xml | 17 +- res/layout/create_gesture.xml | 88 +++++++ res/layout/dialog_rename.xml | 41 +++ res/layout/gestures_item.xml | 31 +++ res/layout/gestures_list.xml | 75 ++++++ res/values/colors.xml | 4 + res/values/dimens.xml | 5 + res/values/strings.xml | 44 ++++ res/xml/method.xml | 3 +- src/us/minak/CreateGestureActivity.java | 128 ++++++++++ src/us/minak/SettingsActivity.java | 436 ++++++++++++++++++++++++++++++++ 11 files changed, 864 insertions(+), 8 deletions(-) create mode 100644 res/layout/create_gesture.xml create mode 100644 res/layout/dialog_rename.xml create mode 100644 res/layout/gestures_item.xml create mode 100644 res/layout/gestures_list.xml create mode 100644 res/values/colors.xml create mode 100644 res/values/dimens.xml create mode 100644 src/us/minak/CreateGestureActivity.java create mode 100644 src/us/minak/SettingsActivity.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index b061ef0..07457fd 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -12,9 +12,9 @@ android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > - + - @@ -22,16 +22,19 @@ - + - + + + + diff --git a/res/layout/create_gesture.xml b/res/layout/create_gesture.xml new file mode 100644 index 0000000..89e64c6 --- /dev/null +++ b/res/layout/create_gesture.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + +