Showing posts with label touch. Show all posts
Showing posts with label touch. Show all posts
Monday, June 5, 2017
Detect user touch with GestureDetectorCompat
Detect user touch with GestureDetectorCompat

Android example to Detect user touch with GestureDetectorCompat:
MainActivity.java
package com.blogspot.android_er.androidgesturedetector;
import android.os.Bundle;
import android.support.v4.view.GestureDetectorCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private GestureDetectorCompat gestureDetectorCompat;
TextView textInfo;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textInfo = (TextView)findViewById(R.id.info);
gestureDetectorCompat = new GestureDetectorCompat(
this, new MySimpleOnGestureListener(textInfo));
}
@Override
public boolean onTouchEvent(MotionEvent event) {
gestureDetectorCompat.onTouchEvent(event);
return super.onTouchEvent(event);
}
private class MySimpleOnGestureListener
extends GestureDetector.SimpleOnGestureListener{
TextView textView;
public MySimpleOnGestureListener(TextView v) {
super();
textView = v;
}
@Override
public boolean onSingleTapUp(MotionEvent e) {
textView.append(" - onSingleTapUp -");
return super.onSingleTapUp(e);
}
@Override
public void onLongPress(MotionEvent e) {
textView.append(" - onLongPress -");
super.onLongPress(e);
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
textView.append(" - onScroll -");
return super.onScroll(e1, e2, distanceX, distanceY);
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
textView.append(" - onFling -");
return super.onFling(e1, e2, velocityX, velocityY);
}
@Override
public void onShowPress(MotionEvent e) {
textView.append(" - onShowPress -");
super.onShowPress(e);
}
@Override
public boolean onDown(MotionEvent e) {
textView.append(" - onDown -");
return super.onDown(e);
}
@Override
public boolean onDoubleTap(MotionEvent e) {
textView.append(" - onDoubleTap -");
return super.onDoubleTap(e);
}
@Override
public boolean onDoubleTapEvent(MotionEvent e) {
textView.append(" - onDoubleTapEvent -");
return super.onDoubleTapEvent(e);
}
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
textView.append(" - onSingleTapConfirmed -");
return super.onSingleTapConfirmed(e);
}
@Override
public boolean onContextClick(MotionEvent e) {
textView.append(" - onContextClick -");
return super.onContextClick(e);
}
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android_layout_width="match_parent"
android_layout_height="match_parent"
android_padding="16dp"
android_orientation="vertical"
tools_context="com.blogspot.android_er.androidgesturedetector.MainActivity">
<TextView
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_layout_gravity="center_horizontal"
android_autoLink="web"
android_text="http://android-er.blogspot.com/"
android_textStyle="bold" />
<TextView
android_id="@+id/info"
android_layout_width="match_parent"
android_layout_height="match_parent"
android_gravity="bottom"
android_textStyle="italic" />
</LinearLayout>
Labels:
detect,
gesturedetectorcompat,
touch,
user,
with
Sunday, June 4, 2017
Saturday, April 22, 2017
Device Booster App Boost 3X Your iPhone iPod touch iPad
Device Booster App Boost 3X Your iPhone iPod touch iPad
Do you want to boost your iPhone, or iPad, or iPod Touch. Well then, if youre looking for the app device to boost your iPhone, iPod touch, iPad, you are in the right page now. Because now you can boost your iPhone, iPod touch, iPad even 3X by using Device Booster. This app is free and compatible with iPhone, iPod touch, and iPad. Requires iOS 3.0 or later.

This app is very easy and simple to use. Once you installing this app on your iPhone, iPod touch, iPad it will boost the CPU/memory, hard drive, and battery of your iOS device. This is a must have app for all iPhone, iPod touch, iPad users. And its support with many languages: English, French, German, Italian, Spanish and more.
Download Size: 0.9 MB

This app is very easy and simple to use. Once you installing this app on your iPhone, iPod touch, iPad it will boost the CPU/memory, hard drive, and battery of your iOS device. This is a must have app for all iPhone, iPod touch, iPad users. And its support with many languages: English, French, German, Italian, Spanish and more.
Download Size: 0.9 MB
Download Link
Subscribe to:
Posts (Atom)