-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notify the user when renaming to the same name #4347
base: release/4.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As to not leave this stuck, I am approving. @VishnuSanal please only merge if you tested the code and works.
HybridFile oldFile = new HybridFile(mode, oldPath); | ||
HybridFile newFile; | ||
if (Utils.isNullOrEmpty(newName)) { | ||
newFile = new HybridFile(mode, newPath); | ||
} else { | ||
newFile = new HybridFile(mode, newPath, newName, isDirectory); | ||
} | ||
if (oldFile.getSimpleName().equals(newFile.getSimpleName())) { | ||
Toast.makeText( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Toast should not be used anymore, in favor of Snackbar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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