Skip to content

Commit

Permalink
fix: categories did not have a link in CategoryProductHelper.kt
Browse files Browse the repository at this point in the history
Closes #4129
  • Loading branch information
VaiTon committed Aug 6, 2021
1 parent 97653bd commit 84bfb42
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -43,8 +43,10 @@ object CategoryProductHelper {
.append(" ")
.apply {
// Add all the categories to text view and link them to wikidata is possible
append(categories.joinToString { getCategoriesTag(it, fragment, apiClient) })

categories.map { getCategoriesTag(it, fragment, apiClient) }.forEachIndexed { i, el ->
append(el)
if (i != categories.size) append(", ")
}
}

if (categories.any { it.categoryTag == "en:alcoholic-beverages" }) {
Expand All @@ -56,7 +58,7 @@ object CategoryProductHelper {
category: CategoryName,
fragment: BaseFragment,
apiClient: WikiDataApiClient
): CharSequence {
): SpannableStringBuilder {
val clickableSpan = object : ClickableSpan() {
override fun onClick(view: View) {
if (category.isWikiDataIdPresent == true) {
Expand Down

0 comments on commit 84bfb42

Please sign in to comment.