question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ShaderEdittor Needs An Undo, And A Redo Button

See original GitHub issue

Components

My suggestion will require two buttons to be added at the top of the Editor’s interface.

Proposal

There are some basic, or necessary features an app needs to have. Although, it doesn’t mean every app out there must have every basic feature, but at least have the basic ones that are related, or needed to give better, or good user experience.

A few days ago, I had a lot of fun using ShaderEdittor. While using the app as an editor for my shaders code, there are some options I found missing, as these options are;

  • Ability to undo
  • Ability to redo the undone.

Effect of not having those features

Currently, while typing in the editor, and the user mistakenly deletes a line of their vital codes, the action can’t be undone because there is no such key to undo the action. It’d be nice to have these two options implemented. The two opinions should act similar to the undo, and redo we see on other apps. Here’s a brief definition;

  • Undo: Erases the last change done to the codes. reverting it to an older state.

  • Redo: The opposite of undo is to redo. The redo command reverses the undo action.

One more request

Currently, the top of Editor’s interface looks occupied as you can see from the image below. Screenshot_20190414-050622.png

So, I was wondering if the available icons can be made smaller? So as to have space for Redo, and Undo option. But, if making the icons smaller isn’t possible, then I suggest the removal of the Tab button.

I understand that the tab button helps the user to modify their codes for easy readability. But, I believe that the space bar on the user’s keypad can also be used to create tabs. So, the Redo an undo option is more Important than the Tab option.

Mockups / Examples

The first image below shows the Tab button, and how occupied the options are. The second screenshot shows the replacement of the tab button with the suggested options.

hey1.png

How can this be done?

I have taken the time to find the sample code. And, I am glad to provide this awesome code by zeleven.


public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button redoBtn = (Button) findViewById(R.id.redo);
        Button undoBtn = (Button) findViewById(R.id.undo);
        EditText editText = (EditText) findViewById(R.id.edittext);
      
        // pass edittext object to TextViewUndoRedo class
        TextViewUndoRedo helper = new TextViewUndoRedo(edittext);
        
        // call the method from TextViewUndoRedo class
        redoBtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            helper.redo(); // perform redo
          }
        });
        undoBtn.setOnClickLisener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            helper.undo(); // perform undo
          }
        });
    }
}


The complete codes can be found Here.

Benefits of Undo & Redo button

I would love to generally state the overview importance of Redo and undo button over the Tab option.

  • If the Tab option isn’t available, users will be able to create tabs will space keypad.
  • If the Redo, and undo option is missing, users who might have mistakenly cleared their codes would have to start typing all over again.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
markusfischcommented, Sep 9, 2019

Well, I tried the idea of an additional bar at the bottom of the screen in a local branch but somehow it didn’t work too well. It reduced the code area too much and really didn’t look very good. At least in that first, very basic try. So I need to put more work into that.

But I have to say that I really like your suggestion to switch buttons according to context! 👍I will definitely try this!

1reaction
markusfischcommented, Apr 17, 2019

No, a drop down would mean two taps. That’s too much. Undo/Redo should always be available with just a tap.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Undo, redo, or repeat an action - Microsoft Support
You can undo, redo, or repeat many actions in Microsoft Word, PowerPoint, and Excel. You can undo changes, even after you have saved,...
Read more >
Undo, redo, and other shortcut key functions - Progress Software
To reverse your last Undo, press CTRL+Y. You can reverse more than one action that has been undone. You can use Redo command...
Read more >
How to add an Undo or Redo button on TD Snap page
How to add an Undo or Redo button on TD Snap page ... Select the edit icon. Top right corner. ... Select the...
Read more >
Undo or redo changes while editing - Biteable - Help Center
Undo or redo a change made to your project by clicking the arrows at the top of the editor, or by using your...
Read more >
Using the Undo/Redo Button
Using the Undo/Redo Button. You can undo and redo your changes when editing an image. To Undo a Change: In Edit mode, do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found