Skip to content

Add PageTitle class to canonicalize page names#738

Merged
misaochan merged 1 commit into
commons-app:masterfrom
whym:pagetitle
Jul 13, 2017
Merged

Add PageTitle class to canonicalize page names#738
misaochan merged 1 commit into
commons-app:masterfrom
whym:pagetitle

Conversation

@whym
Copy link
Copy Markdown
Collaborator

@whym whym commented Jun 15, 2017

This is basically a refactoring. No effective change is intended (unless I missed something).

@misaochan
Copy link
Copy Markdown
Member

Is anyone able to review this? :)

@veyndan veyndan requested review from veyndan and removed request for veyndan June 22, 2017 18:50
*/
@NonNull
public String getPrefixedText() {
if (namespace.length() == 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Replace with namespace.isEmpty()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the suggestion. Done in the modified commit.

@commons-app commons-app deleted a comment Jun 24, 2017
@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 24, 2017

Codecov Report

Merging #738 into master will increase coverage by 0.59%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #738      +/-   ##
=========================================
+ Coverage    6.23%   6.83%   +0.59%     
=========================================
  Files          93      94       +1     
  Lines        5033    5047      +14     
  Branches      455     456       +1     
=========================================
+ Hits          314     345      +31     
+ Misses       4693    4674      -19     
- Partials       26      28       +2
Impacted Files Coverage Δ
...ee/nrw/commons/media/MediaDetailPagerFragment.java 0% <0%> (ø) ⬆️
...src/main/java/fr/free/nrw/commons/LicenseList.java 0% <0%> (ø) ⬆️
...n/java/fr/free/nrw/commons/MediaDataExtractor.java 0% <0%> (ø) ⬆️
app/src/main/java/fr/free/nrw/commons/Utils.java 13.88% <0%> (-0.4%) ⬇️
...n/java/fr/free/nrw/commons/auth/LoginActivity.java 0% <0%> (ø) ⬆️
...e/nrw/commons/contributions/UploadCountClient.java 0% <0%> (ø) ⬆️
...fr/free/nrw/commons/media/MediaDetailFragment.java 0% <0%> (ø) ⬆️
app/src/main/java/fr/free/nrw/commons/Media.java 12.93% <100%> (+12.93%) ⬆️
...p/src/main/java/fr/free/nrw/commons/PageTitle.java 94.44% <94.44%> (ø)
... and 1 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 691acbf...d241d36. Read the comment docs.

Copy link
Copy Markdown
Member

@misaochan misaochan left a comment

Choose a reason for hiding this comment

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

I finally had time to test this today (sorry for the long wait @whym ) and I seem to be having issues with loading appropriate-sized images in the media details pager view. If the picture is a landscape while the phone is held in portrait, previously it would resize the picture to an appropriate width, with blank area above and below. Currently it just crops part of it.

@misaochan
Copy link
Copy Markdown
Member

Also, one of the photos that I uploaded while testing this, https://commons.wikimedia.org/wiki/File:Korean_bbq_set.jpg , actually went through (can be viewed in browser), but does not display appropriately either in the main Contributions view or in the media details view.
screenshot_20170624-221910

@whym
Copy link
Copy Markdown
Collaborator Author

whym commented Jun 24, 2017

I couldn't reproduce the blank picture issue (#738 (comment)). Maybe it's specific to certain API levels? I didn't have the issue with API 23 (real device) and API 25 (emulator).

If I understand it correctly, the crop issue (#738 (review)) does happen to me, too. However, I thought that the app behaved that way for some time. Doesn't it happen with the current master? If so, that might have to be filed as a new bug. I agree it's not ideal.

Anyway, I have changed something that might help in the updated commit.

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

I'm on a API 23 real device. The blank problem doesn't happen to certain pics, perhaps it's related to the file name chosen?

Ah, I never noticed the crop issue before - I know prior to the hackathon it wasn't there. Will test master when I can.

@misaochan
Copy link
Copy Markdown
Member

misaochan commented Jun 25, 2017

The crop issue does indeed occur on master as well. :/ Not sure when it was introduced.

Will try and test this branch further afterwards. Not sure if the blank picture issue was preexisting either.

@misaochan
Copy link
Copy Markdown
Member

misaochan commented Jun 26, 2017

I tested again and the blank issue persists, always for the most recent photo uploaded (so currently "korean bbq set" is displayed, but not the latest photo that I uploaded). Restarting the app fixes the problem.

I'm testing on a Samsung Galaxy s7 with Android 7.0 (so API 24 and not 23, sorry for the confusion).

@whym
Copy link
Copy Markdown
Collaborator Author

whym commented Jun 27, 2017

Still no luck with reproducing it. (I'm using API 24 emulator.) Do you see any suspicious error messages before or after the frame is shown?

@misaochan
Copy link
Copy Markdown
Member

Nothing more than the usual LeakCanary warnings. Do you think logs would help?

@misaochan
Copy link
Copy Markdown
Member

Tested this again today (exact same API and device), and it appears to happen sporadically. Not all pictures cause this problem, but it happens at least 50% of the time for me. I can confirm that this does not happen with master.

@misaochan
Copy link
Copy Markdown
Member

@whym I just realized that this bug does happen on master for me, and always after #667 occurs. So I think it's safe to say it wasn't caused by your PR. Sorry! (When I tested your PR vs master initially, by coincidence #667 did not occur on master, so this bug did not occur)

Is this PR still merge-ready? Am happy to merge if it is. :)

@commons-app commons-app deleted a comment Jul 13, 2017
@whym
Copy link
Copy Markdown
Collaborator Author

whym commented Jul 13, 2017

It's been rebased and is ready to be merged. (I have also added a few coding-style fixes but this should not affect the behavior.)

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.

4 participants