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