EditText-like custom view creation from the scratch (standard view)

こ雲淡風輕ζ 提交于 2019-12-10 22:36:16

问题


I want to create my customized own controls apart from standard Android views/widgets including View, ScrollBar, TextView, EditText, ... And already completed others but not TextView/EditText yet.

The two controls interact with soft-keyboard on focus or not. Plus, you can type/edit the text of the control by the keyboard. More challenging part is about controlling the caret. These problems happen because the control inherits View, not TextView/EditText.

You may ask why I chose such difficult way, not using standard ones and customize only some part of them? That's because of one fatal problem that standard TextView/EditText cannot support large files(a few MB files) and are lagging with them. Additionally, some of the important member functions are private, not protected or public. So we cannot customize fully them as we want.

That's why I created one customized text viewer/editor that supports large files (even over 100 MB). Viewer feature already has been implemented and works well.

Now the editor feature is remaining and it's the reason why I'm here to request your help. Please let me know what's the best solution and I'd appreciate if you can provide with some sample codes.

Thanks

P.S. This is what I've done so far.

screenshot

apk

来源:https://stackoverflow.com/questions/44536580/edittext-like-custom-view-creation-from-the-scratch-standard-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!