daily pastebin goal
86%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for (int i = 0; i < event.values.length; i++) {
  2.          // ...
  3.          if(i==2 && (event.values[i] >= 20 && event.values[i] <= 40))
  4.          {
  5.              //tilted left
  6.              Log.i("left","true");
  7.              iv.setImageResource(R.drawable.left);
  8.          }
  9.          else if(i==2 && (event.values[i] <= -20 && event.values[i] >= -40))
  10.          {
  11.              //tilted right
  12.              Log.i("right","true");
  13.              iv.setImageResource(R.drawable.right);
  14.          }
  15.          else if(i==2 && ((event.values[i] >= -5) && (event.values[i] <= 5)))
  16.          {
  17.              iv.setImageResource(R.drawable.center);
  18.          }
  19.          else if(i==2 && (event.values[i] >= 41))
  20.          {
  21.              iv.setImageResource(R.drawable.leftlay);
  22.          }
  23.          else if(i==2 && event.values[i] <= -41)
  24.          {
  25.              iv.setImageResource(R.drawable.rightlay);
  26.          }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top