Added views placeholder to strings instead of hardcoded.

This commit is contained in:
GilesMunn 2022-10-02 15:46:17 +01:00
parent 0cf31945d4
commit 7710b5c717
2 changed files with 6 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.RecyclerView
import com.github.libretube.R
import com.github.libretube.databinding.TrendingRowBinding
import com.github.libretube.extensions.formatShort
import com.github.libretube.extensions.setFormattedDuration
@ -15,6 +16,7 @@ import com.github.libretube.ui.sheets.VideoOptionsBottomSheet
import com.github.libretube.ui.viewholders.SubscriptionViewHolder
import com.github.libretube.util.ImageHelper
import com.github.libretube.util.NavigationHelper
import org.chromium.base.ContextUtils.getApplicationContext
class TrendingAdapter(
private val streamItems: List<com.github.libretube.api.obj.StreamItem>,
@ -53,8 +55,9 @@ class TrendingAdapter(
textViewTitle.text = trending.title
textViewChannel.text =
trending.uploaderName + "" +
trending.views.formatShort() + " views • " +
DateUtils.getRelativeTimeSpanString(trending.uploaded!!)
trending.views.formatShort() + " " +
getApplicationContext().resources.getString(R.string.views_placeholder) +
"" + DateUtils.getRelativeTimeSpanString(trending.uploaded!!)
thumbnailDuration.setFormattedDuration(trending.duration!!)
channelImage.setOnClickListener {
NavigationHelper.navigateChannel(root.context, trending.uploaderUrl)

View File

@ -153,6 +153,7 @@
<string name="music_directory">Music folder</string>
<string name="movies_directory">Movie folder</string>
<string name="shareTo">Share URL to</string>
<string name="views_placeholder">views</string>
<string name="views">%1$s views</string>
<string name="defaultIcon">Default</string>
<string name="legacyIcon">Lost legacy</string>