Need help with AndroidEdit?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

qinci
448 Stars 72 Forks Apache License 2.0 22 Commits 1 Opened issues

Description

Android EditText的撤销和恢复(反撤销)

Services available

!
?

Need anything else?

Contributors list

AndroidEdit

提取我正在做Markdown编辑器的一个功能

EditText的撤销和恢复撤销操作

使用
  • 引入库
    • compile 'ren.qinc.edit:lib:0.0.5'
  • 初始化
    mEditText = ((EditText) findViewById(R.id.editText));
    //创建PerformEdit,一定要传入不为空的EditText
    mPerformEdit = new PerformEdit(mEditText);
    mPerformEdit.setDefaultText("这是初始值,不做撤销记录");
  • 撤销和恢复
    //撤销
    mPerformEdit.undo();
    //重做
    mPerformEdit.redo();
    //清除历史
    mPerformEdit.clearHistory();
  • 演示图

    Image

  • 最后欢迎您star、fork

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.