我想在我的自定义键盘上禁用长按键实现自定义键盘我扩展视图class.like下面,但没有方法来处理长按键
public class CustomKeyboard extends View {
@Override
public void onPress(int arg0) {
Log.d("Gajanand", "onPress:GK ");
}
@Override
public void onRelease(int primaryCode) {
Log.d("Gajanand", "onRelease: GK");
}
@Override
public void onText(CharSequence text) {
}
@Override
public void swipeDown() {
}
@Override
public void swipeLeft() {
}
@Override
public void swipeRight() {
}
@Override
public void swipeUp() {
}
}帮我处理长时间的压力机。我想完全禁用长按。
发布于 2017-12-19 14:19:52
您可以使用PopupWindow类并使用自定义布局填充它。
PopupWindow popup = new PopupWindow(context);
popup.setContentView(custom);在弹出窗口中单击,您可以将其关闭。
@Override
public void onRelease(int primaryCode) {
Log.d("Gajanand", "onRelease: GK");
popup.dismiss();
}编码快乐!!
https://stackoverflow.com/questions/47880781
复制相似问题