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
Added new folder name modification feature #55
Conversation
Thanks for the PR. The change looks reasonable, but could you please add a test for the new functionality? |
Thanks, I am not shure about what you mean by "add a test". |
I'd like to see a unit test in line with the existing ones that tests the new functionality. :) |
@MajeurAndroid Thanks for that. That's pretty much what I had in mind, but I'd like to test both permutations. So make sure that the old behavior is still correct if the flag is set to false. |
Oh, and could you leave a comment after you push the update? Unfortunately GitHub doesn't send you a notification otherwise. |
Both tests added ! |
@MajeurAndroid Could you fix the merge conflicts? |
assertEquals(shadowAlertDialog.getMessage(), "Create new folder with name \"mydir\"?"); | ||
assertTrue(shadowAlertDialog.isShowing()) | ||
|
||
Button positiveBtn = shadowAlertDialog.getButton(DialogInterface.BUTTON_POSITIVE); |
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.
final
modifier here and everywhere else where applicable.
Rest is looking good. Thanks for the update. :) |
All done, ready to merge ! |
*/ | ||
private void openNewFolderDialog() { | ||
new AlertDialog.Builder(getActivity()) | ||
View dialogView = getActivity().getLayoutInflater().inflate(R.layout.dialog_new_folder, null); |
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.
Last thing, but the null
there bugs me a little because that means the dialog is not going to inherit the app's style. Any way we can fix 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.
Hm, I've checked the docs and this seems to be the recommended practise. Never mind then. :)
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.
Parent argument is used by the inflater to determine and use appropriate LayoutParams when inflating. Then LayoutInflater is retrieved from the activity so it inherit the app's style.
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.
Yup, totally right. I merged it with a suppress annotation. Thanks again
for your work! :)
On Mon, Jul 27, 2015, 17:29 Majeur notifications@github.com wrote:
In
library/src/main/java/net/rdrei/android/dirchooser/DirectoryChooserFragment.java
#55 (comment)
:*/ private void openNewFolderDialog() {
new AlertDialog.Builder(getActivity())
View dialogView = getActivity().getLayoutInflater().inflate(R.layout.dialog_new_folder, null);
Parent argument is used by the inflater to determine and use appropriate
LayoutParams when inflating. Then LayoutInflater is retrieved from the
activity so it inherit the app's style.—
Reply to this email directly or view it on GitHub
https://github.com/passy/Android-DirectoryChooser/pull/55/files#r35556103
.
I am using your library, and it works good, but i don't really understand why new folder name can not be set when creating the new folder.
So I added the ability to modify new folder name when creating new folder. Library users can avoid this using boolean argument.