Added views placeholder to channel view.

This commit is contained in:
GilesMunn 2022-10-09 15:06:18 +01:00
parent 214b90c84d
commit 93ebedc328

View File

@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.github.libretube.R
import com.github.libretube.api.obj.StreamItem import com.github.libretube.api.obj.StreamItem
import com.github.libretube.databinding.VideoRowBinding import com.github.libretube.databinding.VideoRowBinding
import com.github.libretube.extensions.formatShort import com.github.libretube.extensions.formatShort
@ -15,6 +16,7 @@ import com.github.libretube.ui.sheets.VideoOptionsBottomSheet
import com.github.libretube.ui.viewholders.ChannelViewHolder import com.github.libretube.ui.viewholders.ChannelViewHolder
import com.github.libretube.util.ImageHelper import com.github.libretube.util.ImageHelper
import com.github.libretube.util.NavigationHelper import com.github.libretube.util.NavigationHelper
import org.chromium.base.ContextUtils
class ChannelAdapter( class ChannelAdapter(
private val videoFeed: MutableList<StreamItem>, private val videoFeed: MutableList<StreamItem>,
@ -46,8 +48,9 @@ class ChannelAdapter(
videoTitle.text = video.title videoTitle.text = video.title
videoInfo.text = videoInfo.text =
video.views.formatShort() + "" + video.views.formatShort() + " " +
DateUtils.getRelativeTimeSpanString(video.uploaded!!) ContextUtils.getApplicationContext().resources.getString(R.string.views_placeholder) +
"" + DateUtils.getRelativeTimeSpanString(video.uploaded!!)
thumbnailDuration.text = thumbnailDuration.text =
DateUtils.formatElapsedTime(video.duration!!) DateUtils.formatElapsedTime(video.duration!!)