From af7de7b3c09efeaa9f8fb9c6fb4716ad0eef7261 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Mon, 9 May 2022 22:04:06 +0200 Subject: [PATCH] Added sub and video count translation in the search view --- .../main/java/com/github/libretube/adapters/SearchAdapter.kt | 3 ++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/adapters/SearchAdapter.kt b/app/src/main/java/com/github/libretube/adapters/SearchAdapter.kt index eb3a10903..92ed0826f 100644 --- a/app/src/main/java/com/github/libretube/adapters/SearchAdapter.kt +++ b/app/src/main/java/com/github/libretube/adapters/SearchAdapter.kt @@ -1,5 +1,6 @@ package com.github.libretube.adapters +import android.content.res.Resources import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -89,7 +90,7 @@ class CustomViewHolder1(private val v: View): RecyclerView.ViewHolder(v){ val channelName = v.findViewById(R.id.search_channel_name) channelName.text = item.name val channelViews = v.findViewById(R.id.search_views) - channelViews.text = item.subscribers.formatShort() + " subscribers • "+ item.videos + " videos" + channelViews.text = v.context.getString(R.string.subscribers, item.subscribers.formatShort()) + " • " + v.context.getString(R.string.videoCount, item.videos.toString()) v.setOnClickListener { val activity = v.context as MainActivity val bundle = bundleOf("channel_id" to item.url) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 48c6e8bc7..936811986 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -63,4 +63,5 @@ Light Theme Dark Theme %1$s subscribers + %1$s videos