-
-
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
Fixes #3886 #3898
Fixes #3886 #3898
Conversation
app/src/main/java/com/amaze/filemanager/adapters/RecyclerAdapter.java
Outdated
Show resolved
Hide resolved
do { | ||
newName = | ||
oldName.substring(0, oldName.lastIndexOf(".")) | ||
+ "(" |
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.
@TranceLove @VishnuSanal your inputs here. Do we have a library or a utility class that we can utilise for this?
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.
Related #2078 sorry but still need some time to work on it.
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.
You may want to see if #3913 can help.
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.
@yatiksihag01 hi, great work! here are some things I noticed:
- currently, the renaming works only for files. if I try to copy a directory & paste it, it renames every file inside of that folder - which is not the expected behavior; the directory simply should be renamed instead.
@VishnuSanal thanks for your feedback and for pointing out the issue. Sorry for the oversight, I'll try to make the necessary changes asap. |
Hi @VishnuSanal in this commit I've made following changes:
Note: When I use |
@yatiksihag01 awesome! i will review the PR in a while. |
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.
@yatiksihag01 awesome work! operation with files works great as expected! I noticed some glitches on working with directories:
- moving/copying a file from a path to another path simply falls back to the previous implementation (i.e, skip, overwrite, cancel). the dialog appears for every file within, if a directory is moved/copied.
- can you think of a solution to fix the creation of empty directories within?
Hi @VishnuSanal,
|
Actually the duplicate subdirectory issue was caused by the wrong |
I tested here & there were some unexpected behaviors; I'll post a detailed review comment in a while. (edit: or should I? since this is still in WIP? 🤔) |
@VishnuSanal, I still have some work to do, but please tell about the unexpected behavior you encountered. |
i see. I basically wasn't able to rename. copying & moving from a different directory prompted me a dialog, clicking on 'rename' resulted in a Toast message saying 'no file overwritten' (both files & directories). copying from the same directory resulted in the same too. moving to the same directory resulted in the new operation not permitted Toast message. |
…ava, renaming will be done using FilenameHelper
@VishnuSanal I fixed the issues you mentioned. There are still these bugs to be resolved by @TranceLove. And when user try to move the files in same directory they should see this toast message as it doesn't makes any sense to move file in same directory. |
@VishnuSanal please review here as you get time |
@yatiksihag01 please see and resolve the static code analysis errors in the build |
@VishalNehra One error in static code analysis is about |
Yes please |
@VishnuSanal please review here |
You're not using filenamehelper from #3913 ? |
@VishalNehra Yes, I'm using #3913 for renaming. |
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.
great job! works as expected. operations I tested:
- moving to the same directory
- "same destination & source Toast" (both for directories & files)
- copying to the same directory
- works as expected (both for directories & files)
- copying/moving from another directory
- directory: works as expected
- file: works as expected most of the times; but when I rename the source folder & try copy/cut & paste again, renaming fails. if cut option is selected, the source files are getting deleted.
approving this for merge for now, since failure is happening only on an edge case (which most users wouldn't even notice, IMO) - @yatiksihag01 you can fix this in this PR if you can figure out why this happens from the top of your head, else, we can have a new issue & you can fix it later as you wish.
awesome work, once again!
(PS: sorry for the delayed review 😔)
Write to us on telegram for a bounty on this issue thanks again for contributing 🙂 |
Hi @VishnuSanal, appreciate your feedback and approval. Could you provide more details on the issue and steps to reproduce it? Kindly open an issue and assign it to me. I'll work on a fix soon. |
Hi @VishalNehra, thank you for your kind offer of a bounty for my contribution but I did not expect any monetary rewards for this PR. I'm grateful for the opportunity to have contributed to the project:) |
Description
Disabled file modification while the copy/paste snackbar is visible. This behavior is expected, and it is implemented in almost all popular file manager apps. When users choose to paste a file into the same folder from which they copied it, they will be presented with the option to Rename & Save. This option will automatically append (1), (2), etc., at the end of the file name and save it.
Issue tracker
Fixes #3886
Automatic tests
Manual tests
Build tasks success
Successfully running following tasks on local:
./gradlew assembledebug
./gradlew spotlessCheck