Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Andorid IME:Custom KeyBoard #61

Open
yunshuipiao opened this issue Jun 20, 2019 · 0 comments
Open

Andorid IME:Custom KeyBoard #61

yunshuipiao opened this issue Jun 20, 2019 · 0 comments
Labels

Comments

@yunshuipiao
Copy link
Owner

Andorid IME:Custom KeyBoard

在 Android 实现自定义键盘,以及输入法用到两个系统类。

Keyboard 和 KeyboardView

这两个系统类用于实现自定义的键盘。

根据官方文档,在 API 29 之后弃用。开发者可以重新实现,或者从 AOSP 中直接拷贝源码即可。

Keyboard

该类内部有个 Key,用于记录每个键的信息,code,height,width等。持有所有的 Key,并对外提供接口。

KeyboardView

负责绘制所有 Key,包括背景和动画。并监听 Touch 事件,根据 Touch 处的坐标,计算出点击的 Key,通过 OnKeyboardActilonListener 通知调用处,产生响应的结果。

后续

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant