sort subscriptions feed

This commit is contained in:
Bnyro 2022-07-29 12:39:03 +02:00
parent 07a9418570
commit 211881ad92
72 changed files with 181 additions and 107 deletions

View File

@ -59,8 +59,7 @@ class PlaylistsAdapter(
val token = PreferenceHelper.getToken()
deletePlaylist(playlist.id!!, token, position)
}
builder.setNegativeButton(R.string.cancel) { _, _ ->
}
builder.setNegativeButton(R.string.cancel, null)
builder.show()
}
root.setOnClickListener {

View File

@ -18,7 +18,7 @@ class RequireRestartDialog : DialogFragment() {
activity?.recreate()
ThemeHelper.restartMainActivity(requireContext())
}
.setNegativeButton(R.string.cancel) { _, _ -> }
.setNegativeButton(R.string.cancel, null)
.create()
} ?: throw IllegalStateException("Activity cannot be null")
}

View File

@ -23,9 +23,7 @@ class UpdateDialog(
MaterialAlertDialogBuilder(requireContext())
.setTitle(context?.getString(R.string.update_available, updateInfo.name))
.setMessage(context?.getString(R.string.update_now))
.setNegativeButton(context?.getString(R.string.cancel)) { _, _ ->
dismiss()
}
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(context?.getString(R.string.okay)) { _, _ ->
val downloadUrl = getDownloadUrl(updateInfo)
Log.i("downloadUrl", downloadUrl.toString())

View File

@ -33,9 +33,7 @@ class VideoOptionsDialog(private val videoId: String, context: Context) : Dialog
*/
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return MaterialAlertDialogBuilder(requireContext())
.setNegativeButton(R.string.cancel) { dialog, _ ->
dialog.dismiss()
}
.setNegativeButton(R.string.cancel, null)
.setAdapter(
ArrayAdapter(
requireContext(),

View File

@ -36,7 +36,6 @@ class SearchFragment : Fragment() {
private val TAG = "SearchFragment"
private lateinit var binding: FragmentSearchBinding
private var selectedFilter = 0
private var apiSearchFilter = "all"
private var nextPage: String? = null
@ -62,8 +61,6 @@ class SearchFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
var tempSelectedItem = 0
binding.clearSearchImageView.setOnClickListener {
binding.autoCompleteTextView.text.clear()
binding.historyRecycler.adapter = null
@ -84,14 +81,8 @@ class SearchFragment : Fragment() {
MaterialAlertDialogBuilder(view.context)
.setTitle(getString(R.string.choose_filter))
.setSingleChoiceItems(filterOptions, selectedFilter) { _, id ->
tempSelectedItem = id
}
.setPositiveButton(
getString(R.string.okay)
) { _, _ ->
selectedFilter = tempSelectedItem
apiSearchFilter = when (selectedFilter) {
.setItems(filterOptions) { _, id ->
apiSearchFilter = when (id) {
0 -> "all"
1 -> "videos"
2 -> "channels"
@ -105,7 +96,6 @@ class SearchFragment : Fragment() {
fetchSearch(binding.autoCompleteTextView.text.toString())
}
.setNegativeButton(getString(R.string.cancel), null)
.create()
.show()
}

View File

@ -5,22 +5,22 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ProgressBar
import android.widget.Toast
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.github.libretube.R
import com.github.libretube.adapters.SubscriptionChannelAdapter
import com.github.libretube.adapters.TrendingAdapter
import com.github.libretube.databinding.FragmentSubscriptionsBinding
import com.github.libretube.obj.StreamItem
import com.github.libretube.preferences.PreferenceHelper
import com.github.libretube.preferences.PreferenceKeys
import com.github.libretube.util.RetrofitInstance
import com.github.libretube.util.toID
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import retrofit2.HttpException
import java.io.IOException
@ -31,6 +31,8 @@ class SubscriptionsFragment : Fragment() {
lateinit var token: String
private var isLoaded = false
private var subscriptionAdapter: TrendingAdapter? = null
private var feed: List<StreamItem> = listOf()
private var sortOrder = "most_recent"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@ -62,11 +64,15 @@ class SubscriptionsFragment : Fragment() {
resources.getInteger(R.integer.grid_items).toString()
)
binding.subFeed.layoutManager = GridLayoutManager(view.context, grid.toInt())
fetchFeed(binding.subFeed, binding.subProgress)
fetchFeed()
binding.subRefresh.setOnRefreshListener {
fetchChannels(binding.subChannels)
fetchFeed(binding.subFeed, binding.subProgress)
fetchChannels()
fetchFeed()
}
binding.sortTV.setOnClickListener {
showSortDialog()
}
binding.toggleSubs.visibility = View.VISIBLE
@ -76,7 +82,7 @@ class SubscriptionsFragment : Fragment() {
if (!binding.subChannelsContainer.isVisible) {
if (!loadedSubbedChannels) {
binding.subChannels.layoutManager = LinearLayoutManager(context)
fetchChannels(binding.subChannels)
fetchChannels()
loadedSubbedChannels = true
}
binding.subChannelsContainer.visibility = View.VISIBLE
@ -102,13 +108,28 @@ class SubscriptionsFragment : Fragment() {
}
} else {
binding.subRefresh.isEnabled = false
binding.subFeedContainer.visibility = View.GONE
}
}
private fun fetchFeed(feedRecView: RecyclerView, progressBar: ProgressBar) {
private fun showSortDialog() {
val sortOptions = resources.getStringArray(R.array.sortOptions)
val sortOptionValues = resources.getStringArray(R.array.sortOptionsValues)
MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.sort)
.setItems(sortOptions) { _, index ->
binding.sortTV.text = sortOptions[index]
sortOrder = sortOptionValues[index]
showFeed()
}
.setNegativeButton(R.string.cancel, null)
.show()
}
private fun fetchFeed() {
fun run() {
lifecycleScope.launchWhenCreated {
val response = try {
feed = try {
RetrofitInstance.authApi.getFeed(token)
} catch (e: IOException) {
Log.e(TAG, e.toString())
@ -120,9 +141,11 @@ class SubscriptionsFragment : Fragment() {
} finally {
binding.subRefresh.isRefreshing = false
}
if (response.isNotEmpty()) {
subscriptionAdapter = TrendingAdapter(response, childFragmentManager, false)
feedRecView.adapter = subscriptionAdapter
if (feed.isNotEmpty()) {
// save the last recent video to the prefs for the notification worker
PreferenceHelper.setLatestVideoId(feed[0].url.toID())
// show the feed
showFeed()
} else {
runOnUiThread {
with(binding.boogh) {
@ -136,14 +159,29 @@ class SubscriptionsFragment : Fragment() {
binding.loginOrRegister.visibility = View.VISIBLE
}
}
progressBar.visibility = View.GONE
binding.subProgress.visibility = View.GONE
isLoaded = true
}
}
run()
}
private fun fetchChannels(channelRecView: RecyclerView) {
private fun showFeed() {
// sort the feed
val sortedFeed = when (sortOrder) {
"most_recent" -> feed
"least_recent" -> feed.reversed()
"most_views" -> feed.sortedBy { it.views }.reversed()
"least_views" -> feed.sortedBy { it.views }
"channel_name_az" -> feed.sortedBy { it.uploaderName }
"channel_name_za" -> feed.sortedBy { it.uploaderName }.reversed()
else -> feed
}
subscriptionAdapter = TrendingAdapter(sortedFeed, childFragmentManager, false)
binding.subFeed.adapter = subscriptionAdapter
}
private fun fetchChannels() {
fun run() {
lifecycleScope.launchWhenCreated {
val response = try {
@ -159,9 +197,7 @@ class SubscriptionsFragment : Fragment() {
binding.subRefresh.isRefreshing = false
}
if (response.isNotEmpty()) {
// save the last recent video to the prefs for the notification worker
PreferenceHelper.setLatestVideoId(response[0].url.toID())
channelRecView.adapter = SubscriptionChannelAdapter(response.toMutableList())
binding.subChannels.adapter = SubscriptionChannelAdapter(response.toMutableList())
} else {
Toast.makeText(context, R.string.subscribeIsEmpty, Toast.LENGTH_SHORT).show()
}

View File

@ -27,7 +27,7 @@ class AdvancedSettings : PreferenceFragmentCompat() {
MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.reset)
.setMessage(R.string.reset_message)
.setNegativeButton(getString(R.string.cancel)) { _, _ -> }
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.reset) { _, _ ->
// clear default preferences
PreferenceHelper.clearPreferences()

View File

@ -41,7 +41,7 @@ class HistorySettings : PreferenceFragmentCompat() {
MaterialAlertDialogBuilder(requireContext())
.setTitle(title)
.setMessage(R.string.irreversible)
.setNegativeButton(getString(R.string.cancel)) { _, _ -> }
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.okay) { _, _ ->
// clear the selected preference preferences
PreferenceHelper.removePreference(preferenceKey)

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -2,7 +2,7 @@
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="#FF000000"
android:pathData="M24,40 L8,24l2.1,-2.1 12.4,12.4V8h3v26.3l12.4,-12.4L40,24Z" />
</vector>

View File

@ -2,7 +2,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="512"
android:viewportHeight="512">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="300"
android:viewportHeight="300">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="143dp"
android:height="144dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="143"
android:viewportHeight="144">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="32"
android:viewportHeight="32">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -2,7 +2,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:width="22dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="18"
android:viewportHeight="20"
tools:ignore="VectorRaster">

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="256"
android:viewportHeight="256">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="300"
android:viewportHeight="300">
<path

View File

@ -2,7 +2,7 @@
xmlns:aapt="http://schemas.android.com/aapt"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="1080"
android:viewportHeight="1080">
<path android:pathData="M308.4,156.8C308.4,156.8 315.7,151.4 328.7,144.1C336,141 345.1,137.7 355.5,134.8C366.4,132.6 378.6,130.8 391.1,129.9C403.9,129.9 416.9,130.7 429.1,132.3C441.2,134.7 452.4,137.9 461.8,141.2C480,149.7 491.4,156.8 491.4,156.8C491.4,156.8 491.4,168.5 491.4,189.1C491.4,199.3 491.4,211.8 491.4,226C491.4,240.3 491.4,256.4 491.4,274C491.4,291.6 491.4,310.6 491.4,330.8C491.4,340.8 491.4,351.2 491.4,361.7C491.4,372.3 491.4,383.1 491.4,394.1C491.4,405.1 491.4,416.3 491.4,427.6C491.4,438.9 491.4,450.3 491.4,461.8C491.4,473.4 491.4,485 491.4,496.7C491.4,508.3 491.4,520.1 491.4,531.8C491.4,543.5 491.4,555.2 491.4,566.9C491.4,578.5 491.4,590.2 491.4,601.7C491.4,613.3 491.4,624.7 491.4,636C491.4,647.3 491.4,658.5 491.4,669.5C491.4,680.4 491.4,691.2 491.4,701.8C491.4,712.4 491.4,722.7 491.4,732.8C491.4,752.9 491.4,772 491.4,789.5C491.4,807.1 491.4,823.2 491.4,837.5C491.4,851.8 491.4,864.3 491.4,874.5C491.4,895 491.4,906.7 491.4,906.7C491.4,906.7 480,906.7 462.8,906.7C454.2,906.7 444.2,906.7 433.5,906.7C422.8,906.7 411.3,906.7 399.9,906.7C388.5,906.7 377,906.7 366.3,906.7C355.6,906.7 345.6,906.7 337,906.7C319.9,906.7 308.4,906.7 308.4,906.7C308.4,906.7 308.4,895 308.4,874.5C308.4,864.3 308.4,851.8 308.4,837.5C308.4,823.2 308.4,807.1 308.4,789.5C308.4,772 308.4,752.9 308.4,732.8C308.4,722.7 308.4,712.4 308.4,701.8C308.4,691.2 308.4,680.4 308.4,669.5C308.4,658.5 308.4,647.3 308.4,636C308.4,624.7 308.4,613.3 308.4,601.7C308.4,590.2 308.4,578.5 308.4,566.9C308.4,555.2 308.4,543.5 308.4,531.8C308.4,520.1 308.4,508.3 308.4,496.7C308.4,485 308.4,473.4 308.4,461.8C308.4,450.3 308.4,438.9 308.4,427.6C308.4,416.3 308.4,405.1 308.4,394.1C308.4,383.1 308.4,372.3 308.4,361.7C308.4,351.2 308.4,340.8 308.4,330.8C308.4,310.6 308.4,291.6 308.4,274C308.4,256.4 308.4,240.3 308.4,226C308.4,211.8 308.4,199.3 308.4,189.1C308.4,168.5 308.4,156.8 308.4,156.8Z">

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="485.74"
android:viewportHeight="485.74">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="459"
android:viewportHeight="459">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="32"
android:viewportHeight="32">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="512"
android:viewportHeight="512">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="15"
android:viewportHeight="15">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="16"
android:viewportHeight="16">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="60"
android:viewportHeight="60">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="52"
android:viewportHeight="52">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="310"
android:viewportHeight="310">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="420.83"
android:viewportHeight="420.83">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="300"
android:viewportHeight="300">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?android:attr/colorControlNormal"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path

View File

@ -40,5 +40,5 @@
android:textSize="12sp"
app:cornerRadius="20dp"
app:elevation="20dp"
tools:text="@string/unsubscribe" />
android:text="@string/unsubscribe" />
</RelativeLayout>

View File

@ -109,19 +109,37 @@
</RelativeLayout>
<RelativeLayout
<LinearLayout
android:id="@+id/sub_feed_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/sub_feed"
<TextView
android:id="@+id/sortTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:drawablePadding="5dp"
android:paddingHorizontal="10dp"
android:text="@string/most_recent"
android:textSize="16sp"
app:drawableEndCompat="@drawable/ic_arrow_downward" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false" />
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/sub_feed"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</com.github.libretube.views.CustomSwipeToRefresh>

View File

@ -778,4 +778,22 @@
<item>720</item>
</string-array>
<string-array name="sortOptions">
<item>@string/most_recent</item>
<item>@string/least_recent</item>
<item>@string/most_views</item>
<item>@string/least_views</item>
<item>@string/channel_name_az</item>
<item>@string/channel_name_za</item>
</string-array>
<string-array name="sortOptionsValues">
<item>most_recent</item>
<item>least_recent</item>
<item>most_views</item>
<item>least_views</item>
<item>channel_name_az</item>
<item>channel_name_za</item>
</string-array>
</resources>

View File

@ -273,4 +273,11 @@
<string name="new_streams_by">New streams by %1$s …</string>
<string name="irreversible">Are you sure? This can\'t be undone!</string>
<string name="history_empty">History is empty.</string>
<string name="most_recent">Most recent</string>
<string name="least_recent">Least recent</string>
<string name="most_views">Most views</string>
<string name="least_views">Least views</string>
<string name="channel_name_az">Channel Name (A-Z)</string>
<string name="channel_name_za">Channel Name (Z-A)</string>
<string name="sort">Sort</string>
</resources>