//删除按钮被长按了
button_del.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
isLongPress=true;
isContinueDel=true;
post(new Runnable() {
@Override
public void run() {
deleteContent();
if (getFocusInput() != null && getFocusInput().getSelectionStart() > 0&&isContinueDel) {
postDelayed(this, 50);
}
}
});
return true;
}
});
//松手取消监听
button_del.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if(v.getId()==button_del.getId()){
if(event.getAction() == MotionEvent.ACTION_UP){
if(isLongPress){
isContinueDel=false;
isLongPress=false;
}
}
}
return false;
}
});
评论
0/240
- ultimated2021-05-02 00:18 回复
- ultimatetest2021-05-02 00:18 回复
ultimate 回复 @ultimate
g2021-05-02 00:19 回复 1252207051434627072
- ultimatetest2021-05-02 00:17 回复
推荐文章










2024-12-23 10:00 1



2024-12-12 16:48 1













