Skip to content

Add button on image details to copy wikicode to clipboard #1849

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

Merged
merged 2 commits into from
Aug 27, 2018

Conversation

albendz
Copy link
Contributor

@albendz albendz commented Aug 22, 2018

Add button on image details to copy wikicode to clipboard

Fixes #1843 Add text field to media details view for users to copy image template into Wikipedia

Description (required)

Fixes #1843 Add text field to media details view for users to copy image template into Wikipedia

  • Added a button to copy wikicode to clipboard in the details section
  • Added strings for copy button and for toast text
  • Added action on copy button to copy to clipboard on click

Tests performed (required)

Tested on API 24, Android 7.0, Samsung S6 device

Screenshots showing what changed (optional)

screenshot_20180822-142002
screenshot_20180822-142159
screenshot_20180822-142205

@codecov-io
Copy link

codecov-io commented Aug 22, 2018

Codecov Report

Merging #1849 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1849      +/-   ##
=========================================
- Coverage    3.61%   3.61%   -0.01%     
=========================================
  Files         192     192              
  Lines        9838    9848      +10     
  Branches      871     871              
=========================================
  Hits          356     356              
- Misses       9456    9466      +10     
  Partials       26      26
Impacted Files Coverage Δ
...fr/free/nrw/commons/media/MediaDetailFragment.java 0% <0%> (ø) ⬆️
.../java/fr/free/nrw/commons/nearby/NearbyPlaces.java 0% <0%> (ø) ⬆️

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 e458421...b6c3488. Read the comment docs.

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!
Nice idea to use a copy button rather than the texbox I had suggested :-)

@misaochan
Copy link
Member

misaochan commented Aug 23, 2018

Looks good to me, thanks for working on this @albendz !

A bit nitpicky, but err, should we make the two buttons (copy text and nominate for deletion) the same size? As the sizes currently look a bit off to me. Different colors should be fine since that will make it easy to distinguish between the two.

@albendz
Copy link
Contributor Author

albendz commented Aug 23, 2018

I left it as a default color after a copy paste. I should have checked before: do you have UI guidelines? I'm in favor of the same size just because of how everything on this view fragment is full page width. Otherwise, I would say use a smaller button with the copy icon and no text. I can't think of a good place to put that though.

@misaochan
Copy link
Member

Sorry, we don't have any UI guidelines per se. :) Same size would work - currently it seems to be a bit smaller than "nominate for deletion", which is probably why it looks a bit strange to me. If you wanted to use a smaller button with the copy icon, I would recommend adding an additional field (perhaps below "Description"?) that says "Use this file", and having the copy button on the left similar to the map icon in "Coordinates".

@maskaravivek
Copy link
Member

Was wondering if having this in the top menu might be better? A lot of people might not be interested in this feature so I am not sure about granting it such a prominent position in the page.

@nicolas-raoul
Copy link
Member

@maskaravivek I disagree :-) We should actively/prominently remind people that they can add pictures to WIkipedia/etc articles, because that is one of the most important uses of Commons, and the uploader is probably the best person to know how to use this picture. Also, unlike other activities we do not care too much if it gets a bit longer.

@albendz
Copy link
Contributor Author

albendz commented Aug 25, 2018

I am going to make the change to have the new button width look like the nominate for deletion button width. Let me know if there is need for further discussion here.

@albendz
Copy link
Contributor Author

albendz commented Aug 25, 2018

capture

@misaochan
Copy link
Member

Looks great, thank you!

@misaochan misaochan merged commit a059a3c into commons-app:master Aug 27, 2018
ilgazer pushed a commit to ilgazer/apps-android-commons that referenced this pull request Sep 9, 2018
…p#1849)

* Add button on image details to copy wikicode to clipboard

* Make copy wikicode button width the same as the nominate deletion button width by filling in background
dbrant pushed a commit to dbrant/apps-android-commons that referenced this pull request Sep 9, 2018
…p#1849)

* Add button on image details to copy wikicode to clipboard

* Make copy wikicode button width the same as the nominate deletion button width by filling in background
neslihanturan pushed a commit that referenced this pull request Sep 11, 2018
* Sweeping update of gradle and library versions.

This updates all of the dependencies of the project to their latest
versions. Everyone should please upgrade to the latest version of Android
Studio, update your build tools, and keep your version of Gradle and the
Kotlin plugin up to date.

* Update build tools in travis.

* Remove cruft and fix tests.

* Remove even more stuff.

* Reinstate instrumented tests.

* Update emulator image in travis.

* Localisation updates from https://translatewiki.net.

* Work towards eliminating string literals from code. (#1861)

String literals are being used in many places in the code, instead of
proper string resources which are automatically localized. This PR
replaces many of the string literals with pre-packaged resources, or will
add the appropriate string if necessary.

* Add button on image details to copy wikicode to clipboard (#1849)

* Add button on image details to copy wikicode to clipboard

* Make copy wikicode button width the same as the nominate deletion button width by filling in background

* Build fix

* Enable ProGuard for Debug and Release builds.

This enables ProGuard minification, which significantly shrinks the APK
(for both debug and release configurations) and vastly decreases the
method count.

* Add ProGuard rules for test builds.
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.

5 participants