ShaderEdittor Needs An Undo, And A Redo Button
See original GitHub issueComponents
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.
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.
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:
- Created 4 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
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!
No, a drop down would mean two taps. That’s too much. Undo/Redo should always be available with just a tap.