If you think the Android project DiceInDark listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/* Dice in the dark. D & D app for the blind and seeing impaired,
* Copyright (C) <2013r> <Lovisa Irpa Helgadottir>
*//fromwww.java2s.com
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/package com.example.framework.impl;
import java.util.List;
import android.content.Context;
import android.os.Build.VERSION;
import android.view.View;
import com.example.framework.Input;
publicclass AndroidInput implements Input {
AccelerometerHandler accelHandler;
TouchHandler touchHandler;
public AndroidInput(Context context, View view, float scaleX, float scaleY) {
accelHandler = new AccelerometerHandler(context);
touchHandler = new GestureHandler(context, view);
}
publicboolean isKeyPressed(int keyCode) {
return false;
}
publicboolean isTouchDown(int pointer) {
return touchHandler.isTouchDown(pointer);
}
publicint getTouchX(int pointer) {
return touchHandler.getTouchX(pointer);
}
publicint getTouchY(int pointer) {
return touchHandler.getTouchY(pointer);
}
publicfloat getAccelX() {
return accelHandler.getAccelX();
}
publicfloat getAccelY() {
return accelHandler.getAccelY();
}
publicfloat getAccelZ() {
return accelHandler.getAccelZ();
}
public List<TouchEvent> getTouchEvents() {
return touchHandler.getTouchEvents();
}
public List<KeyEvent> getKeyEvents() {
return null;
}
public List<GestureEvent> getGestureEvents() {
// TODO Auto-generated method stub
return touchHandler.getGestureEvents();
}
}