Created
September 4, 2012 06:16
-
-
Save yosun/3617503 to your computer and use it in GitHub Desktop.
Trying to build a jar wrapper for some SPen functions...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.testing123.pentest; | |
import com.unity3d.player.UnityPlayerActivity; | |
import java.util.HashMap; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.graphics.Color; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
import android.view.MotionEvent; | |
import android.view.View; | |
//import android.widget.RelativeLayout; | |
//import android.widget.TextView; | |
//import android.widget.Toast; | |
//import com.samsung.samm.common.SObjectStroke; | |
//import com.samsung.spen.settings.SettingStrokeInfo; | |
//import com.samsung.spensdk.SCanvasConstants; | |
//import com.samsung.spensdk.SCanvasView; | |
import com.samsung.spensdk.applistener.SCanvasLongPressListener; | |
import com.samsung.spensdk.applistener.SPenDetachmentListener; | |
import com.samsung.spensdk.applistener.SPenHoverListener; | |
import com.samsung.spensdk.applistener.SPenTouchListener; | |
import com.samsung.spensdk.applistener.SettingStrokeChangeListener; | |
import com.samsung.spen.lib.input.SPenEvent; | |
//import com.samsung.spensdk.example.R; | |
//import com.samsung.spensdk.example.tools.SPenSDKUtils; | |
public class PenTest extends UnityPlayerActivity { | |
private final String TAG = "SPenSDK Sample"; | |
public static SPenTouchListener sPenTouchListener; | |
private static String isPenTouched="null"; | |
public static void startPenListeners(){ | |
sPenTouchListener = new SPenTouchListener(){ | |
@Override | |
public boolean onTouchFinger(View view, MotionEvent event) { | |
//UnityPlayerActivity.UnitySendMessage("Main Camera","FingerTouch","ypi"); | |
return false; | |
} | |
@Override | |
public boolean onTouchPen(View view, MotionEvent event) { | |
//UnityPlayer.UnitySendMessage("Main Camera","PenTouch","ypi"); | |
isPenTouched="true"; | |
return false; | |
} | |
@Override | |
public boolean onTouchPenEraser(View view, MotionEvent event) { | |
//UnityPlayer.UnitySendMessage("Main Camera","PenEraser","ypi"); | |
return false; | |
} | |
@Override | |
public void onTouchButtonDown(View view, MotionEvent event) { | |
//UnityPlayer.UnitySendMessage("Main Camera","TouchButtonDown","ypi"); | |
//return false; | |
} | |
@Override | |
public void onTouchButtonUp(View view, MotionEvent event) { | |
//UnityPlayer.UnitySendMessage("Main Camera","TouchButtonUp","ypi"); | |
//return false; | |
} | |
}; | |
} | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
//-------------------------------------------- | |
// Set S pen Touch Listener | |
//-------------------------------------------- | |
startPenListeners(); | |
} | |
public static String IsPen(){ | |
return isPenTouched; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment