Skip to content

Feature/localised image descriptions #1634

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

Conversation

ashishkumar468
Copy link
Collaborator

@ashishkumar468 ashishkumar468 commented Jun 18, 2018

Specify language when adding image descriptions

Specify language when adding image descriptions #1501

Description :

Converted the descriptions edit text to a recycler veiw with and option to add description in various languages

Tests performed :

Open the app, click on the camera/gallery icon to upload an image, the next screen which would usually show an option to add a single description, would now let you add description in multiple languages (the default (first) one would be the device locale). Submit the request. After upload success, open the image description, I could now see description in my device current locale.

Tested on {27l & name of Moto x, with {build variant, ProdDebug}.

Screenshots showing what changed (optional)

screenshot_20180618-160310

@codecov-io
Copy link

codecov-io commented Jun 18, 2018

Codecov Report

Merging #1634 into master will decrease coverage by 0.06%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1634      +/-   ##
=========================================
- Coverage    3.63%   3.57%   -0.07%     
=========================================
  Files         182     186       +4     
  Lines        9158    9327     +169     
  Branches      796     811      +15     
=========================================
  Hits          333     333              
- Misses       8803    8972     +169     
  Partials       22      22
Impacted Files Coverage Δ
...r/free/nrw/commons/contributions/Contribution.java 0% <ø> (ø) ⬆️
...main/java/fr/free/nrw/commons/upload/Language.java 0% <0%> (ø)
...fr/free/nrw/commons/media/MediaDetailFragment.java 0% <0%> (ø) ⬆️
...n/java/fr/free/nrw/commons/upload/Description.java 0% <0%> (ø)
...ee/nrw/commons/upload/SpinnerLanguagesAdapter.java 0% <0%> (ø)
...java/fr/free/nrw/commons/upload/ShareActivity.java 0% <0%> (ø) ⬆️
...r/free/nrw/commons/upload/DescriptionsAdapter.java 0% <0%> (ø)
.../free/nrw/commons/upload/SingleUploadFragment.java 0% <0%> (ø) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9118733...68efe27. Read the comment docs.

@commons-app commons-app deleted a comment Jun 18, 2018
@maskaravivek
Copy link
Member

The feature works well for me and I was able to upload an image with descriptions in multiple languages. The descriptions show up well on Commons.

https://commons.wikimedia.org/wiki/File:Gandhi_ji_painting_at_Aga_khan_palace.jpg

@ashishkumar468 Can you sort the languages drop-down list alphabetically. Right now it's a bit difficult to browse through so many language options.

@ashishkumar468
Copy link
Collaborator Author

@maskaravivek Thanks for the review, have updated the same

@commons-app commons-app deleted a comment Jun 18, 2018
@commons-app commons-app deleted a comment Jun 23, 2018
@ashishkumar468
Copy link
Collaborator Author

Hi guys, i believe not just my account, my device is blocked from uploading images [I guess because of multiple test images upload]. Does any one know how to get it fixed ?

@commons-app commons-app deleted a comment Jun 24, 2018
@misaochan
Copy link
Member

@ashishkumar468 I'm not sure about the block. but will ping @whym and @nicolas-raoul who might hopefully be able to help.

In the future, for uploading test images please use the betaDebug build variant as far as possible. All uploads to the prodDebug build variant will go to the real Commons, and indeed the community may not be too happy with it.

@nicolas-raoul
Copy link
Member

Sorry about the block!
The only way to remove a block is to follow https://commons.wikimedia.org/wiki/Commons:Blocking_policy#Appealing_a_block

But before doing this, maybe we should use your case to test the block detection code in the app? :-)

@ashishkumar468
Copy link
Collaborator Author

Thanks guys, will do the same

@ashishkumar468
Copy link
Collaborator Author

Just a gentle reminder, the PR is ready for review

@misaochan
Copy link
Member

Sorry for the wait for review, @ashishkumar468 , we are having a bit of a backlog with work at the moment. :/ Will get to it ASAP.

@neslihanturan
Copy link
Collaborator

Works with no problem for me @ashishkumar468 , thanks for this great feature. Just a few points:

  • Instead of just scroll view for languages, can we use scroll view with input field? There are several languages, and hard to find one by scrolling.
  • On Media Details Activity we just see latest description. I think we should be able to see descriptions in all languages. But This can be another issue and PR. As:
    En: some description
    Tur: Bazı açıklamalar
  • Should we let entering description in same language twice? I think we shouldn't. But this also can be a separate issue and PR.

For this PR, first bullet and fixing conflicts is important. Others can wait.

@ashishkumar468
Copy link
Collaborator Author

Hi @neslihanturan, Thanks for the feedback, Could you elaborate the first bullet, As far as i understand, you mean to say that instead of two recycler views which is there currently, you want only one recycler view which would hold both the language field and the description field?

@neslihanturan
Copy link
Collaborator

neslihanturan commented Jul 22, 2018

It is very normal you didn't get what I meant:) I was trying to say, you can use a listview (or recycler) with "search filter". So that when I want to use Turkish language, I can just type Turkish to search bar, instead of scrolling all the languages and trying to find Turkish. When user selects laguages filter could be beneficial.

@ashishkumar468
Copy link
Collaborator Author

ashishkumar468 commented Jul 22, 2018

@neslihanturan Ohh yes got it it now, Thanks for the clarification, will work on the same and update

@maskaravivek
Copy link
Member

Instead of just scroll view for languages, can we use scroll view with input field? There are several languages, and hard to find one by scrolling.
This can probably come as an enhancement in a separate PR. Its nice to have the basic functionality for multiple descriptions. Moreover, this screen could get a complete overhaul quite soon.

@ashishkumar468 Can you please resolve the merge conflicts so that this PR can be merged.

@ashishkumar468
Copy link
Collaborator Author

@maskaravivek @neslihanturan Have resolved the conflicts, (@neslihanturan Will take a while to add the filter you suggested, will update you once done). Also I noticed that startForeground has not been handled properly for Oreo devices.

@commons-app commons-app deleted a comment Aug 1, 2018
@ashishkumar468
Copy link
Collaborator Author

The travis build failed with some exception in SettingsActivityTest, does not seems any way related to my commit, what am i supposed to do ?

@maskaravivek
Copy link
Member

@ashishkumar468 Have you rebased your branch with latest master? The build for master is successful.

@ashishkumar468
Copy link
Collaborator Author

@maskaravivek I have already merged with master, you can see the logs from git

@ashishkumar468 ashishkumar468 force-pushed the feature/localised_image_descriptions branch from 8559aab to d61a21f Compare August 2, 2018 08:36
@commons-app commons-app deleted a comment Aug 2, 2018
@ashishkumar468
Copy link
Collaborator Author

ashishkumar468 commented Aug 2, 2018

@maskaravivek @neslihanturan Did the required changes. Please verify

@commons-app commons-app deleted a comment Aug 2, 2018
@maskaravivek
Copy link
Member

Works well for me. Merging. Thanks @ashishkumar468

@maskaravivek maskaravivek merged commit 12a83da into commons-app:master Aug 3, 2018
ujjwalagrawal17 pushed a commit to ujjwalagrawal17/apps-android-commons that referenced this pull request Aug 8, 2018
* wip

* Changes for adding descriptions in multipe languages[issue commons-app#1501]

* Added callback for the adapter

* Codacy suggested changes

* Sort the languages in the spinner in alphabetical order

* scroll view nested scrolling enabled false

* Nested scrolling enabled false [Allow rv to expand]

* rebased to master, resolved conflicts

* replaced setCompoundDrawables with setCompoundDrawablesWithIntrinsicBounds [the former dint used to work on all devices]

*     replaced setCompoundDrawables with setCompoundDrawablesWithIntrinsicBounds [the former dint used to work on all devices]
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.

6 participants