Project

General

Profile

« Previous | Next » 

Revision e3023b62

Added by Leszek Koltunski about 1 year ago

Move the interaction with touchscreen to the OSInterface (part3)

View differences:

src/main/java/org/distorted/os/OSInterface.java
20 20

  
21 21
public class OSInterface implements OperatingSystemInterface
22 22
{
23

  
23 24
  private final WeakReference<Activity> mAct;
24 25
  private MotionEvent mEvent;
25 26
  private int mPointer1, mPointer2;
......
51 52

  
52 53
  public int getAction()
53 54
    {
54
    return mEvent.getActionMasked();
55
    switch( mEvent.getActionMasked() )
56
      {
57
      case( MotionEvent.ACTION_DOWN        ): return ACTION_DOWN_1;
58
      case( MotionEvent.ACTION_UP          ): return ACTION_UP_1;
59
      case( MotionEvent.ACTION_POINTER_DOWN): return ACTION_DOWN_2;
60
      case( MotionEvent.ACTION_POINTER_UP  ): return ACTION_UP_2;
61
      case( MotionEvent.ACTION_MOVE        ): return ACTION_MOVE;
62
      }
63

  
64
    return 0;
55 65
    }
56 66

  
57 67
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff