-
Notifications
You must be signed in to change notification settings - Fork 1.3k
#4005 For images in set removed if user selected one image #4022
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
#4005 For images in set removed if user selected one image #4022
Conversation
|
Ping @nicolas-raoul for review. |
nicolas-raoul
left a comment
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.
Looks good, only minor changes to perform.
| private Place place; | ||
| private List<UploadableFile> uploadableFiles = Collections.emptyList(); | ||
| private int currentSelectedPosition = 0; | ||
| private boolean isMultipleItemSelected = false; |
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.
"Item" has a different meaning in our app. Please rename to isMultipleFilesSelected thanks!
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.
done
| .subscribe(filter -> searchForCategory(filter.toString()), Timber::e); | ||
| } | ||
| private void setTvSubTitle() { | ||
| Log.d("gouri", "setTvSubTitle: in uploadfragments"); |
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.
Not needed I guess? 🙂
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.
D'oh! sorry I was debugging something.
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.
done
|
@nicolas-raoul Is there something wrong with PR? |
|
@gouri-panda It looks great but I have been super busy and almost no time for this app reecently :'-( Could anyone test this PR? Thanks a lot! |
|
@nicolas-raoul No rush take your time. |
|
@gouri-panda Very sorry for the delay, I now have time to review your PRs :-) |
|
@nicolas-raoul sure! |
…commons into pull/4022 and resolved conflicts
|
@nicolas-raoul @neslihanturan This PR is ready now. |
|
I tried compiling but could not: |
nicolas-raoul
left a comment
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.
Probably need to fix syntax?
Codecov Report
@@ Coverage Diff @@
## master #4022 +/- ##
============================================
- Coverage 10.41% 10.37% -0.04%
Complexity 474 474
============================================
Files 343 342 -1
Lines 13063 13118 +55
Branches 1051 1067 +16
============================================
+ Hits 1360 1361 +1
- Misses 11635 11688 +53
- Partials 68 69 +1
Continue to review full report at Codecov.
|
nicolas-raoul
left a comment
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.
Tested with both a single picture and multiple pictures, it works as intended.
Thanks a lot!
nicolas-raoul
left a comment
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.
Sorry a few minor things
| private Place place; | ||
| private List<UploadableFile> uploadableFiles = Collections.emptyList(); | ||
| private int currentSelectedPosition = 0; | ||
| private boolean isMultipleFilesSelected = false; |
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.
Ah, I forgot! We need javadoc for each new method/member.
After that I will merge.
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.
@nicolas-raoul Should we add Javadoc here or in getter fields?
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.
Both methods and members, actually. Sorry for the hassle, but documentation is usually written once, read many times, so it is a good investment :-)
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.
Javadoc must use this format for members too:
/**
* Example javadoc
*/
Thanks!
| place = intent.getParcelableExtra(PLACE_OBJECT); | ||
| resetDirectPrefs(); | ||
| } | ||
| public boolean getIsMultipleFilesSelected() { |
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.
javadoc
| .observeOn(AndroidSchedulers.mainThread()) | ||
| .subscribe(filter -> searchForCategory(filter.toString()), Timber::e); | ||
| } | ||
| private void setTvSubTitle() { |
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.
javadoc, and also one empty line before the method, to make it easier to see.
app/src/main/java/fr/free/nrw/commons/upload/depicts/DepictsFragment.java
Show resolved
Hide resolved
app/src/main/java/fr/free/nrw/commons/upload/license/MediaLicenseFragment.java
Show resolved
Hide resolved
| private Place place; | ||
| private List<UploadableFile> uploadableFiles = Collections.emptyList(); | ||
| private int currentSelectedPosition = 0; | ||
| private boolean isMultipleFilesSelected = false; |
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.
Both methods and members, actually. Sorry for the hassle, but documentation is usually written once, read many times, so it is a good investment :-)
|
@nicolas-raoul Sorry for the delay. You can check now ;) |
neslihanturan
left a comment
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.
Some minor fixes on comments :)
| } | ||
|
|
||
| /** | ||
| * Sets the Tv Subtitle |
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 @gouri-panda , since the purpose of the last review was adding javadocs could you please be more specific with javadocs instead of just writing the name of the method. Ie. this one could be something like:
"If multiple file is not selected, makes the visibility of subtitle text view gone."
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, @neslihanturan .From now on I'll keep this in my mind.
| } | ||
|
|
||
| /** | ||
| * Sets the Depicts subtitle |
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.
Same here, could be more definitive. "Sets the Depict subtitle" is not actually what the method does. It decides the visibility of depics text view if multiplefile is not selecred as far as I can understand.
| private Place place; | ||
| private List<UploadableFile> uploadableFiles = Collections.emptyList(); | ||
| private int currentSelectedPosition = 0; | ||
| private boolean isMultipleFilesSelected = false; |
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.
Javadoc must use this format for members too:
/**
* Example javadoc
*/
Thanks!
| private List<UploadableFile> uploadableFiles = Collections.emptyList(); | ||
| private int currentSelectedPosition = 0; | ||
| // Checks for if multiple files selected | ||
| /* |
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.
Needs one more star here and another on the next line :-)
Must look like this:
/**
* Example javadoc
*/
Thanks!
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.
Sorry about that!
2589389 to
97dfe30
Compare
|
Hey, this changes looks okay to me to merge, for some reason tests are failing. Do you have any estimation @gouri-panda ? |
|
@neslihanturan Thanks for reviewing files but I can't find build logs. Perhaps you can try with a new build tests. Thanks :) |
|
I can't see any point in this PR where Travis can fail. I can not see the build either. So merging this one for now to see if the build will fail or not. If so, we can always revert the commit. |
Fixes #4005
What changes did you make and why?
Created a variable for storing if the user selected multiple images or not in UploadActivity then it will access by the fragment
and then it will set the text depends on the variable.