huangcm
2025-08-14 5d6606c55520a76d5bb8297d83fd9bbf967e5244
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;
    }
}