From 13f8fba31d0948ae0da4a7b1f571b16ae3ba71e1 Mon Sep 17 00:00:00 2001 From: Ashish Date: Sun, 2 Sep 2018 11:56:24 +0530 Subject: [PATCH 1/2] Bug fix issue #1826 Changes made : -Certain category names used to show suffixed with strings prefixed with pipe '|'. Removed everything after the pipe. As per the discussion on the thread, its safe to remove everything after the pipe, including the pipe --- .../nrw/commons/media/MediaDetailFragment.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java index b46789ba07..95dc00c228 100644 --- a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java @@ -436,8 +436,18 @@ private void enableDeleteButton(boolean visibility) { private void rebuildCatList() { categoryContainer.removeAllViews(); // @fixme add the category items - for (String cat : categoryNames) { - View catLabel = buildCatLabel(cat, categoryContainer); + + //As per issue #1826, some categories come suffixed with strings prefixed with |. As per the discussion + //that was meant for alphabetical sorting of the categories and can be safely removed. + for(int i=0;i Date: Fri, 7 Sep 2018 10:04:28 +0530 Subject: [PATCH 2/2] review suggested changes *Code formatting *Extracted out the index of pipe in a variable *Added issue link in comments --- .../fr/free/nrw/commons/media/MediaDetailFragment.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java index 95dc00c228..130ffdb6a8 100644 --- a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java @@ -437,13 +437,14 @@ private void rebuildCatList() { categoryContainer.removeAllViews(); // @fixme add the category items - //As per issue #1826, some categories come suffixed with strings prefixed with |. As per the discussion + //As per issue #1826(see https://github.com/commons-app/apps-android-commons/issues/1826), some categories come suffixed with strings prefixed with |. As per the discussion //that was meant for alphabetical sorting of the categories and can be safely removed. - for(int i=0;i