summaryrefslogtreecommitdiffstats
path: root/WallpaperPicker
diff options
context:
space:
mode:
authorMady Mellor <madym@google.com>2015-06-03 16:26:34 (GMT)
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-03 16:26:35 (GMT)
commit19b1bad23904a899bd9dc56bf9e2e827619164b1 (patch)
treecccba9465809bafa64bb019177f86b5c7ae2fb20 /WallpaperPicker
parentca51aaad671f1999dff135b1253fecf0869a3763 (diff)
parentef044dd380ac3abf354027750efdc16d5d48ac70 (diff)
downloadandroid_packages_apps_Trebuchet-19b1bad23904a899bd9dc56bf9e2e827619164b1.zip
android_packages_apps_Trebuchet-19b1bad23904a899bd9dc56bf9e2e827619164b1.tar.gz
android_packages_apps_Trebuchet-19b1bad23904a899bd9dc56bf9e2e827619164b1.tar.bz2
Merge "Stylus support: creating and setting listeners for stylus button press" into ub-launcher3-burnaby
Diffstat (limited to 'WallpaperPicker')
-rw-r--r--WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
index 659c306..9415941 100644
--- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
+++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
@@ -49,6 +49,7 @@ import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
+import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLayoutChangeListener;
@@ -891,6 +892,15 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
private void addLongPressHandler(View v) {
v.setOnLongClickListener(mLongClickListener);
+
+ // Enable stylus button to also trigger long click.
+ final StylusEventHelper stylusEventHelper = new StylusEventHelper(v);
+ v.setOnTouchListener(new View.OnTouchListener() {
+ @Override
+ public boolean onTouch(View view, MotionEvent event) {
+ return stylusEventHelper.checkAndPerformStylusEvent(event);
+ }
+ });
}
private ArrayList<WallpaperTileInfo> findBundledWallpapers() {