All Projects β†’ Muddz β†’ Regret

Muddz / Regret

Licence: Apache-2.0 license
[Moved to MavenCentral] An undo-redo Android library which works with any objects and with an easy implementation. Perfect for drawing, text and photo editing apps.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Regret

UndoRedo.js
A powerful and simple JavaScript library provides a history for undo/redo functionality. Just like a time machine! πŸ•
Stars: ✭ 19 (-70.77%)
Mutual labels:  undo-redo, redo, undo
actions
Software without side-effects. Redo and Undo.
Stars: ✭ 23 (-64.62%)
Mutual labels:  undo-redo, redo, undo
js-undo-manager
Simple JavaScript undo/redo command manager supporting transactions with no dependencies
Stars: ✭ 23 (-64.62%)
Mutual labels:  undo-redo, redo, undo
Redux Undo
♻️ higher order reducer to add undo/redo functionality to redux state containers
Stars: ✭ 2,744 (+4121.54%)
Mutual labels:  redo, undo
zundo
🍜 undo/redo middleware for zustand
Stars: ✭ 170 (+161.54%)
Mutual labels:  redo, undo
undo
A undo-redo library.
Stars: ✭ 38 (-41.54%)
Mutual labels:  redo, undo
undox
⎌ Redux Implementation of Undo/Redo based on storing actions instead of states.
Stars: ✭ 25 (-61.54%)
Mutual labels:  redo, undo
rundo
Rundo is a undo redo library for rust which can auto generate undo op
Stars: ✭ 32 (-50.77%)
Mutual labels:  redo, undo
undoredo-cpp
Some concepts of Undo/Redo attempted in C++03
Stars: ✭ 20 (-69.23%)
Mutual labels:  undo-redo
undo
GelΓΆschte Artikel, Slices und Kategorien wiederherstellen
Stars: ✭ 31 (-52.31%)
Mutual labels:  undo
Sublundo
A Sublime Text 3 package implementing Vim-like branching undo/redo.
Stars: ✭ 16 (-75.38%)
Mutual labels:  undo-redo
old-fashioned-donut
a programming language for time leapers
Stars: ✭ 17 (-73.85%)
Mutual labels:  undo-redo
undo-canvas
Add undo/redo functions to CanvasRenderingContext2D
Stars: ✭ 33 (-49.23%)
Mutual labels:  undo-redo
Flexibleadapter
Fast and versatile Adapter for RecyclerView which regroups several features into one library to considerably improve the user experience :-)
Stars: ✭ 3,482 (+5256.92%)
Mutual labels:  undo
MagicWE2
[MagicWE2] Lag free asynchronous world editor for PMMP with plenty of options
Stars: ✭ 109 (+67.69%)
Mutual labels:  undo
deque
JavaScript implementation of a double-ended queue
Stars: ✭ 17 (-73.85%)
Mutual labels:  double-linked-list
Libft
42 library of basic C functions - queues, lists, memory operations and more πŸ˜„
Stars: ✭ 21 (-67.69%)
Mutual labels:  double-linked-list

Regret

APK

Regret is an Android library for apps that wants to implement an undo/redo feature. The library is simple to use and works with all primitive types and objects and is especially suitable for drawing, text and photo editing apps.

Regret is based on the UndoRedoList

Usage

  1. Instantiate Regret and add key-value data to it
   Regret regret = new Regret(context, this);
   regret.add(KEY_TEXT, editText.getText().toString());
   regret.add(KEY_TEXT_COLOR, Color.BLACK);
  1. Call regret.undo() or regret.redo(). The key-value data will be returned via the listener
  @Override
    public void onDo(String key, Object value) {
        switch (key) {
            case KEY_TEXT:
                editText.setText((CharSequence) value);
                break;
            case KEY_TEXT_COLOR:
                editText.setTextColor((Integer) value);
                break;
        }
    }
  1. Update UI related buttons such as Undo/Redo buttons with the following listener
    @Override
    public void onCanDo(boolean canUndo, boolean canRedo) {
        btnUndo.setAlpha(canUndo ? 1 : 0.4f);
        btnRedo.setAlpha(canRedo ? 1 : 0.4f);
        btnUndo.setEnabled(canUndo);
        btnRedo.setEnabled(canRedo);
    }

Installation

Add the dependency in your build.gradle

dependencies {
    implementation 'io.github.muddz:regret:1.4.0'  
}

License

Copyright 2018 Muddi Walid

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].