Home | History | Annotate | Download | only in launcher3
      1 package com.android.launcher3;
      2 
      3 import android.view.MotionEvent;
      4 import android.view.View;
      5 
      6 import com.android.launcher3.StylusEventHelper.StylusButtonListener;
      7 
      8 /**
      9  * Simple listener that performs a long click on the view after a stylus button press.
     10  */
     11 public class SimpleOnStylusPressListener implements StylusButtonListener {
     12     private View mView;
     13 
     14     public SimpleOnStylusPressListener(View view) {
     15         mView = view;
     16     }
     17 
     18     public boolean onPressed(MotionEvent event) {
     19         return mView.isLongClickable() && mView.performLongClick();
     20     }
     21 
     22     public boolean onReleased(MotionEvent event) {
     23         return false;
     24     }
     25 }