Merge pull request #1215 from archroid/master

Fixed Iran region has no videos in feed
This commit is contained in:
archroid 2022-09-06 08:10:50 +04:30 committed by GitHub
commit 79aee960a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,10 +53,16 @@ class HomeFragment : BaseFragment() {
LocaleHelper
.getDetectedCountry(requireContext(), "UK")
.uppercase()
} else {
}
else {
regionPref
}
// Iran has no trending videos to show!
if (region == "IR"){
region = "US"
}
binding.recview.layoutManager = GridLayoutManager(view.context, grid.toInt())
fetchJson()
binding.homeRefresh.isEnabled = true
@ -85,6 +91,9 @@ class HomeFragment : BaseFragment() {
runOnUiThread {
binding.progressBar.visibility = View.GONE
binding.recview.adapter = TrendingAdapter(response, childFragmentManager)
if (response.isEmpty()){
Toast.makeText(context, "No videos found! Change your region and try again!", Toast.LENGTH_SHORT).show()
}
}
}
}