Android Open Source - AndroidFramework Android Input






From Project

Back to project page AndroidFramework.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project AndroidFramework 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

package com.mdobbins.implementation.framework;
/*from  ww w.  ja  v  a  2 s .c  o m*/
import java.util.List;

import android.content.Context;
import android.os.Build.VERSION;
import android.view.View;

import com.mdobbins.framework.Input;

public class AndroidInput implements Input {    
    TouchHandler touchHandler;

    public AndroidInput(Context context, View view, float scaleX, float scaleY) {
        if(Integer.parseInt(VERSION.SDK) < 5)
            touchHandler = new SingleTouchHandler(view, scaleX, scaleY);
        else
            touchHandler = new MultiTouchHandler(view, scaleX, scaleY);        
    }


    @Override
    public boolean isTouchDown(int pointer) {
        return touchHandler.isTouchDown(pointer);
    }

    @Override
    public int getTouchX(int pointer) {
        return touchHandler.getTouchX(pointer);
    }

    @Override
    public int getTouchY(int pointer) {
        return touchHandler.getTouchY(pointer);
    }



    @Override
    public List<TouchEvent> getTouchEvents() {
        return touchHandler.getTouchEvents();
    }
   
}




Java Source Code List

com.mdobbins.framework.Audio.java
com.mdobbins.framework.Audio.java
com.mdobbins.framework.FileIO.java
com.mdobbins.framework.FileIO.java
com.mdobbins.framework.Game.java
com.mdobbins.framework.Game.java
com.mdobbins.framework.Graphics.java
com.mdobbins.framework.Graphics.java
com.mdobbins.framework.Image.java
com.mdobbins.framework.Image.java
com.mdobbins.framework.Input.java
com.mdobbins.framework.Input.java
com.mdobbins.framework.Music.java
com.mdobbins.framework.Music.java
com.mdobbins.framework.Pool.java
com.mdobbins.framework.Pool.java
com.mdobbins.framework.Screen.java
com.mdobbins.framework.Screen.java
com.mdobbins.framework.Sound.java
com.mdobbins.framework.Sound.java
com.mdobbins.implementation.framework.AndroidAudio.java
com.mdobbins.implementation.framework.AndroidFastRenderView.java
com.mdobbins.implementation.framework.AndroidFileIO.java
com.mdobbins.implementation.framework.AndroidGame.java
com.mdobbins.implementation.framework.AndroidGraphics.java
com.mdobbins.implementation.framework.AndroidImage.java
com.mdobbins.implementation.framework.AndroidInput.java
com.mdobbins.implementation.framework.AndroidMusic.java
com.mdobbins.implementation.framework.AndroidSound.java
com.mdobbins.implementation.framework.MultiTouchHandler.java
com.mdobbins.implementation.framework.SingleTouchHandler.java
com.mdobbins.implementation.framework.TouchHandler.java
com.mdobbins.sample.Assets.java
com.mdobbins.sample.GameScreen.java
com.mdobbins.sample.LoadingScreen.java
com.mdobbins.sample.MainMenuScreen.java
com.mdobbins.sample.SampleGame.java