Skip to content
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

Merged
merged 6 commits into from Jul 27, 2015
Merged

Conversation

MajeurAndroid
Copy link
Contributor

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.

@passy
Copy link
Owner

passy commented Jul 6, 2015

Thanks for the PR. The change looks reasonable, but could you please add a test for the new functionality?

@MajeurAndroid
Copy link
Contributor Author

Thanks, I am not shure about what you mean by "add a test".

@passy
Copy link
Owner

passy commented Jul 7, 2015

I'd like to see a unit test in line with the existing ones that tests the new functionality. :)

@passy
Copy link
Owner

passy commented Jul 14, 2015

@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.

@passy
Copy link
Owner

passy commented Jul 16, 2015

Oh, and could you leave a comment after you push the update? Unfortunately GitHub doesn't send you a notification otherwise.

@MajeurAndroid
Copy link
Contributor Author

Both tests added !

@passy
Copy link
Owner

passy commented Jul 26, 2015

@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);
Copy link
Owner

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.

@passy
Copy link
Owner

passy commented Jul 26, 2015

Rest is looking good. Thanks for the update. :)

@MajeurAndroid
Copy link
Contributor Author

All done, ready to merge !

*/
private void openNewFolderDialog() {
new AlertDialog.Builder(getActivity())
View dialogView = getActivity().getLayoutInflater().inflate(R.layout.dialog_new_folder, null);
Copy link
Owner

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?

Copy link
Owner

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. :)

Copy link
Contributor Author

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.

Copy link
Owner

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
.

@passy passy merged commit edd4d5f into passy:master Jul 27, 2015
passy added a commit that referenced this pull request Jul 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants