- Notifications
You must be signed in to change notification settings - Fork70
Android EditText的撤销和恢复(反撤销)
License
NotificationsYou must be signed in to change notification settings
qinci/AndroidEdit
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
提取我正在做Markdown编辑器的一个功能
####EditText的撤销和恢复撤销操作#####使用
- 引入库
- compile 'ren.qinc.edit:lib:0.0.5'
- 初始化
mEditText = ((EditText)findViewById(R.id.editText));//创建PerformEdit,一定要传入不为空的EditTextmPerformEdit =newPerformEdit(mEditText);mPerformEdit.setDefaultText("这是初始值,不做撤销记录");
- 撤销和恢复
//撤销mPerformEdit.undo();//重做mPerformEdit.redo();//清除历史mPerformEdit.clearHistory();