//数字键1
//数字键2
//数字键3
//删除键
//数字键4
//数字键5
//数字键6
//确定键,设置较大
//数字键7
//数字键8
//数字键9
//清零键
//0键
//.键
然后是逻辑编写:
KeyboardUtils.java
package com.example.mytally.utils;
import android.inputmethodservice.Keyboard;
import android.inputmethodservice.KeyboardView;
import android.text.Editable;
import android.text.InputType;
import android.view.View;
import android.widget.EditText;
import com.example.mytally.R;
public class KeyBoardUtils {
private final Keyboard k1; //自定义键盘
private KeyboardView keyboardView;
private EditText editText; //设置一个变量EditText使得输入处随软键盘输入变化
//生成两者的构造方法
public interface OnEnsureListener{
public void onEnsure();
}
OnEnsureListener onEnsureListener;
public void setOnEnsureLi