notify the user when renaming to the same name#4347
notify the user when renaming to the same name#4347yashwanthgajji wants to merge 3 commits intoTeamAmaze:release/4.0from
Conversation
VishnuSanal
left a comment
There was a problem hiding this comment.
thanks for your interest in contributing to Amaze. but, I don't think this will be a better UX than the way it is currently. if renaming is not possible, we should let the user know the "why?".
|
What about we toast a message saying "Your new name is same as old name. Rename isn't done". Or the best thing we can do is, we can disable save button if old and new names are same. Please let me know what you have in mind. |
|
I added a message to notify that no changes are made as new name matches the old name. Please let me know if you are thinking the same. |
EmmanuelMess
left a comment
There was a problem hiding this comment.
As to not leave this stuck, I am approving. @VishnuSanal please only merge if you tested the code and works.
| newFile = new HybridFile(mode, newPath, newName, isDirectory); | ||
| } | ||
| if (oldFile.getSimpleName().equals(newFile.getSimpleName())) { | ||
| Toast.makeText( |
There was a problem hiding this comment.
Toast should not be used anymore, in favor of Snackbar
There was a problem hiding this comment.
Okay, I am rescinding the approval. When "CREATE" is selected for a new folder, the popup closes. The way this should work is that CREATE should not be able to be selected and a text in red should appear under the text line saying "Cannot rename to already existing file name" or something similar.
See how naming a file works for reference:

Description
Added a condition to check if old name and new name of the file are same. Started renaming code only if the names are different.
Issue tracker
Fixes #4340
Automatic tests
Manual tests
Build tasks success
Successfully running following tasks on local:
./gradlew assembledebug./gradlew spotlessCheck