List of usage examples for android.view MotionEvent toString
@Override
public String toString()
From source file:ru.zapolnov.MainActivity.java
@Override public final void onLongPress(MotionEvent event) { Log.d("Java", "onLongPress: " + event.toString()); }
From source file:ru.zapolnov.MainActivity.java
@Override public final void onShowPress(MotionEvent event) { Log.d("Java", "onShowPress: " + event.toString()); }
From source file:ru.zapolnov.MainActivity.java
@Override public final boolean onDoubleTap(MotionEvent event) { Log.d("Java", "onDoubleTap: " + event.toString()); return true;/*from w w w . ja v a 2s. c o m*/ }
From source file:ru.zapolnov.MainActivity.java
@Override public final boolean onSingleTapUp(MotionEvent event) { Log.d("Java", "onSingleTapUp: " + event.toString()); return true;/* w ww . ja v a 2 s.c o m*/ }
From source file:ru.zapolnov.MainActivity.java
@Override public final boolean onDoubleTapEvent(MotionEvent event) { Log.d("Java", "onDoubleTapEvent: " + event.toString()); return true;/*w ww . j a va 2 s.c o m*/ }
From source file:ru.zapolnov.MainActivity.java
@Override public final boolean onSingleTapConfirmed(MotionEvent event) { Log.d("Java", "onSingleTapConfirmed: " + event.toString()); return true;// w ww . java 2s. c o m }
From source file:ru.zapolnov.MainActivity.java
@Override public final boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { Log.d("Java", "onScroll: " + e1.toString() + e2.toString()); return true;//ww w .ja va 2 s .com }
From source file:ru.zapolnov.MainActivity.java
@Override public final boolean onFling(MotionEvent event1, MotionEvent event2, float velocityX, float velocityY) { Log.d("Java", "onFling: " + event1.toString() + event2.toString()); return true;//from w w w .jav a 2 s . co m }
From source file:com.example.pdftranslator.ScreenSlidePageFragment.java
private void determineWordSelected(View v, MotionEvent event) { Layout layout = ((TextView) v).getLayout(); int x = (int) event.getX(); int y = (int) event.getY(); Log.i("NAME", Thread.currentThread().getId() + " in touch event fragment" + " " + event.toString()); if (layout != null) { // Log.i( "NAME", ActivityTextDisplayer.letter_index.values().toString()); int line = layout.getLineForVertical(y); int offset = layout.getOffsetForHorizontal(line, x); int copy_offset = offset; String word = ActivityTextDisplayer.letter_index.get(offset); // Log.i("NAME", ""+offset + " ---" + word + "--- " ); while (true) { copy_offset--;//from ww w .ja v a 2 s . c o m if (ActivityTextDisplayer.letter_index.get(copy_offset).equals(" ") || ActivityTextDisplayer.letter_index.get(copy_offset).equals("\n") || ActivityTextDisplayer.letter_index.get(copy_offset).equals(".")) break; word = ActivityTextDisplayer.letter_index.get(copy_offset) + word; } copy_offset = offset; while (true) { copy_offset++; if (ActivityTextDisplayer.letter_index.get(copy_offset).equals(" ") || ActivityTextDisplayer.letter_index.get(copy_offset).equals("\n") || ActivityTextDisplayer.letter_index.get(copy_offset).equals(".")) break; word = word + ActivityTextDisplayer.letter_index.get(copy_offset); } String params[] = { word, Language.ENGLISH.toString(), Language.ROMANIAN.toString() }; new InternetConnection(getActivity()).execute(params); Log.i("NAME", "" + offset + " " + line + " ------" + ActivityTextDisplayer.letter_index.get(offset) + "----- -----" + word + "------"); } }
From source file:com.example.android.animationsdemo.CameraActivity.java
private void initCamera() { if (CameraHelper.checkCameraHardware(context)) { long startTime = System.currentTimeMillis(); // Create an instance of Camera mCamera = CameraHelper.getDefaultCameraInstance(); // Create our Preview view and set it as the content of our activity. mPreview = new CameraPreview(this, mCamera); FrameLayout preview = (FrameLayout) findViewById(R.id.camera_preview); mPreview.setOnTouchListener(new View.OnTouchListener() { @Override/*from w ww. j av a 2 s. c o m*/ public boolean onTouch(View v, MotionEvent event) { DKLog.d(TAG, Trace.getCurrentMethod() + event.toString()); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: int x = (int) event.getX(); int y = (int) event.getY(); DKLog.d(TAG, Trace.getCurrentMethod() + String.format("( %d , %d )", x, y)); startFocusAniamtion(x, y); startFocus(x, y); return true; } return false; } }); preview.addView(mPreview); DKLog.d(TAG, Trace.getCurrentMethod() + "take: " + (System.currentTimeMillis() - startTime) + " ms"); } }