Integrated season listing api
Handling of category wise data listing in show listing. Changing all repository code to handle dynamic changes in category listing Episode listing activity created. inflated data from show data
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.woka.home.mylist
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.woka.home.mylist.models.AudioData
|
||||
@@ -12,7 +11,6 @@ import com.woka.home.mylist.models.SingKaraokeData
|
||||
import com.woka.networking.ApiResult
|
||||
import com.woka.networking.RetrofitHelper
|
||||
import com.woka.userdata.UserRepository
|
||||
import com.woka.utils.TAG
|
||||
import com.woka.webseries.WebSeriesRepository
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -159,45 +157,23 @@ object MyListRepository {
|
||||
}
|
||||
}
|
||||
|
||||
if (categoryId == "1"){
|
||||
WebSeriesRepository.englishWebSeriesData?.show_data?.let {
|
||||
for (show in it){
|
||||
var found = false
|
||||
WebSeriesRepository.webSeriesData[categoryId]?.show_data?.let {
|
||||
for (show in it){
|
||||
var found = false
|
||||
|
||||
show?.let {data ->
|
||||
if (showData.id == data.id){
|
||||
found = true
|
||||
show?.let {data ->
|
||||
if (showData.id == data.id){
|
||||
found = true
|
||||
|
||||
if (addToFav){
|
||||
show.addAsBookMark(categoryId)
|
||||
}else{
|
||||
show.removeAsBookMark(categoryId)
|
||||
}
|
||||
if (addToFav){
|
||||
show.addAsBookMark(categoryId)
|
||||
}else{
|
||||
show.removeAsBookMark(categoryId)
|
||||
}
|
||||
}
|
||||
|
||||
if (found) break
|
||||
}
|
||||
}
|
||||
}else{
|
||||
WebSeriesRepository.hindiWebSeriesData?.show_data?.let {
|
||||
for (show in it){
|
||||
var found = false
|
||||
|
||||
show?.let {data ->
|
||||
if (showData.id == data.id){
|
||||
found = true
|
||||
|
||||
if (addToFav){
|
||||
show.addAsBookMark(categoryId)
|
||||
}else{
|
||||
show.removeAsBookMark(categoryId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found) break
|
||||
}
|
||||
if (found) break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.woka.home.mylist.MyListRepository
|
||||
import com.woka.home.mylist.models.PostType
|
||||
import com.woka.home.mylist.models.BookmarkedShowData
|
||||
import com.woka.utils.isNetworkConnected
|
||||
import com.woka.utils.show
|
||||
import com.woka.utils.toast
|
||||
import java.util.concurrent.Executors
|
||||
import kotlin.math.max
|
||||
@@ -63,6 +64,9 @@ class WebSeriesAdapter(private val context: Context,
|
||||
|
||||
title.text = showData.title
|
||||
|
||||
likeCount.show()
|
||||
like.show()
|
||||
|
||||
showData.likes_count?.let {
|
||||
likeCount.text = "$it"
|
||||
}
|
||||
@@ -101,6 +105,7 @@ class WebSeriesAdapter(private val context: Context,
|
||||
like.isSelected = !like.isSelected
|
||||
}
|
||||
|
||||
fav.show()
|
||||
fav.isSelected = true
|
||||
|
||||
fav.setOnClickListener {
|
||||
|
||||
@@ -5,12 +5,10 @@ import androidx.lifecycle.MutableLiveData
|
||||
import com.woka.home.mylist.MyFavApiService
|
||||
import com.woka.home.mylist.MyListRepository
|
||||
import com.woka.home.mylist.models.BookmarkedShowData
|
||||
import com.woka.home.mylist.models.MyListResponse
|
||||
import com.woka.home.mylist.models.PostType
|
||||
import com.woka.modules.ModuleApiService
|
||||
import com.woka.networking.ApiResult
|
||||
import com.woka.networking.RetrofitHelper
|
||||
import com.woka.userdata.UserRepository
|
||||
import com.woka.webseries.models.ContinueEpisodeResponse
|
||||
import com.woka.webseries.models.ShowData
|
||||
import com.woka.webseries.models.WebSeriesResponse
|
||||
@@ -29,17 +27,11 @@ object WebSeriesRepository {
|
||||
// live data
|
||||
|
||||
// show data (loose caching)
|
||||
private val _englishWebSeriesLiveData = MutableLiveData<ApiResult<WebSeriesResponse>>()
|
||||
val englishWebSeriesLiveData: LiveData<ApiResult<WebSeriesResponse>>
|
||||
get() = _englishWebSeriesLiveData
|
||||
private val _webSeriesLiveData = MutableLiveData<ApiResult<HashMap<String, WebSeriesResponse>>>()
|
||||
val webSeriesLiveData: LiveData<ApiResult<HashMap<String, WebSeriesResponse>>>
|
||||
get() = _webSeriesLiveData
|
||||
|
||||
var englishWebSeriesData: WebSeriesResponse? = null
|
||||
|
||||
private val _hindiWebSeriesLiveData = MutableLiveData<ApiResult<WebSeriesResponse>>()
|
||||
val hindiWebSeriesLiveData: LiveData<ApiResult<WebSeriesResponse>>
|
||||
get() = _hindiWebSeriesLiveData
|
||||
|
||||
var hindiWebSeriesData: WebSeriesResponse? = null
|
||||
var webSeriesData = HashMap<String, WebSeriesResponse>()
|
||||
|
||||
// continue watching (tight caching)
|
||||
private val _continueWatchLiveData = MutableLiveData<ApiResult<ContinueEpisodeResponse>>()
|
||||
@@ -93,62 +85,39 @@ object WebSeriesRepository {
|
||||
}
|
||||
}
|
||||
|
||||
fun clearData(){
|
||||
_englishWebSeriesLiveData.postValue(ApiResult.Loading())
|
||||
_hindiWebSeriesLiveData.postValue(ApiResult.Loading())
|
||||
|
||||
hindiWebSeriesData = null
|
||||
englishWebSeriesData = null
|
||||
|
||||
shallLoadNewContinueWatchData = true
|
||||
continueWatchData = null
|
||||
}
|
||||
|
||||
fun loadEnglishWebSeries(){
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
_englishWebSeriesLiveData.postValue(ApiResult.Loading())
|
||||
|
||||
val response = RetrofitHelper.handleApiCall {
|
||||
apiService.getWebSeries(
|
||||
FormBody.Builder()
|
||||
.add("category_id", "1")
|
||||
.build()
|
||||
)
|
||||
fun loadWebSeries(categoryId: String){
|
||||
if (webSeriesData.containsKey(categoryId)){
|
||||
webSeriesData[categoryId]?.let {
|
||||
_webSeriesLiveData.postValue(ApiResult.Success(webSeriesData))
|
||||
return
|
||||
}
|
||||
|
||||
when (response){
|
||||
is ApiResult.Error -> {}
|
||||
is ApiResult.Loading -> {}
|
||||
is ApiResult.Success -> {
|
||||
englishWebSeriesData = response.data
|
||||
}
|
||||
}
|
||||
|
||||
_englishWebSeriesLiveData.postValue(response)
|
||||
}
|
||||
}
|
||||
|
||||
fun loadHindiWebSeries(){
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
_hindiWebSeriesLiveData.postValue(ApiResult.Loading())
|
||||
_webSeriesLiveData.postValue(ApiResult.Loading())
|
||||
|
||||
val response = RetrofitHelper.handleApiCall {
|
||||
apiService.getWebSeries(
|
||||
FormBody.Builder()
|
||||
.add("category_id", "18")
|
||||
.add("category_id", categoryId)
|
||||
.build()
|
||||
)
|
||||
}
|
||||
|
||||
when (response){
|
||||
is ApiResult.Error -> {}
|
||||
is ApiResult.Loading -> {}
|
||||
is ApiResult.Error -> {
|
||||
_webSeriesLiveData.postValue(ApiResult.Error(response.errorMessage, response.error))
|
||||
}
|
||||
is ApiResult.Loading -> {
|
||||
_webSeriesLiveData.postValue(ApiResult.Loading())
|
||||
}
|
||||
is ApiResult.Success -> {
|
||||
hindiWebSeriesData = response.data
|
||||
response.data?.let {
|
||||
webSeriesData[categoryId] = it
|
||||
_webSeriesLiveData.postValue(ApiResult.Success(data = webSeriesData))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_hindiWebSeriesLiveData.postValue(response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,37 +145,16 @@ object WebSeriesRepository {
|
||||
is ApiResult.Error -> {}
|
||||
is ApiResult.Loading -> {}
|
||||
is ApiResult.Success -> {
|
||||
changeLikeLocally(postId, likeIt, categoryId)
|
||||
changeLikeLocally(postId, likeIt)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun changeLikeLocally(id: String, isLiked: Boolean, categoryId: String){
|
||||
|
||||
if (categoryId == "1"){
|
||||
englishWebSeriesData?.show_data?.let{
|
||||
for (show in it){
|
||||
var found = false
|
||||
show?.let {data ->
|
||||
if ("${data.id}" == id){
|
||||
|
||||
data.is_liked = isLiked
|
||||
|
||||
data.likes_count?.let { count ->
|
||||
data.likes_count = if (isLiked) count + 1
|
||||
else max(0, count - 1)
|
||||
}
|
||||
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if (found) break
|
||||
}
|
||||
}
|
||||
}else{
|
||||
hindiWebSeriesData?.show_data?.let{
|
||||
for (show in it){
|
||||
private fun changeLikeLocally(id: String, isLiked: Boolean){
|
||||
for (showDataResponse in webSeriesData.values){
|
||||
showDataResponse.show_data?.let {shows ->
|
||||
for (show in shows){
|
||||
var found = false
|
||||
show?.let {data ->
|
||||
if ("${data.id}" == id){
|
||||
@@ -234,4 +182,12 @@ object WebSeriesRepository {
|
||||
categoryId
|
||||
)
|
||||
}
|
||||
|
||||
fun clearData(){
|
||||
_webSeriesLiveData.postValue(ApiResult.Loading())
|
||||
webSeriesData.clear()
|
||||
|
||||
shallLoadNewContinueWatchData = true
|
||||
continueWatchData = null
|
||||
}
|
||||
}
|
||||
@@ -8,12 +8,19 @@ import android.widget.ArrayAdapter
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.woka.R
|
||||
import com.woka.modules.categorymodels.Category
|
||||
import com.woka.utils.hide
|
||||
import com.woka.utils.show
|
||||
|
||||
class SpinnerAdapter(context: Context, list: List<String>): ArrayAdapter<String>(context, 0, list){
|
||||
class SpinnerAdapter(context: Context, private val list: List<Category>, ): ArrayAdapter<Category>(context, 0, list){
|
||||
|
||||
private var currentSelection: Int = 0
|
||||
var currentSelection: Int = 0
|
||||
|
||||
var selectedCategoryType: String? = null
|
||||
get() {
|
||||
return "${list[currentSelection].id}"
|
||||
}
|
||||
private set
|
||||
|
||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||
return createViewFromResource(convertView, parent, position)
|
||||
@@ -23,7 +30,7 @@ class SpinnerAdapter(context: Context, list: List<String>): ArrayAdapter<String>
|
||||
val view = convertView ?: LayoutInflater.from(context).inflate(R.layout.spinner_view_holder, parent, false)
|
||||
val textView = view.findViewById<TextView>(R.id.spinner_text_view)
|
||||
val tickView = view.findViewById<ImageView>(R.id.spinner_tick)
|
||||
textView.text = getItem(position)
|
||||
textView.text = getItem(position).category_name
|
||||
|
||||
if (currentSelection == position){
|
||||
tickView.show()
|
||||
@@ -37,10 +44,14 @@ class SpinnerAdapter(context: Context, list: List<String>): ArrayAdapter<String>
|
||||
private fun createViewFromResource(convertView: View?, parent: ViewGroup, position: Int): View {
|
||||
val view = convertView ?: LayoutInflater.from(context).inflate(R.layout.spinner_view_holder, parent, false)
|
||||
val textView = view.findViewById<TextView>(R.id.spinner_text_view)
|
||||
textView.text = getItem(position)
|
||||
textView.text = getItem(position).category_name
|
||||
return view
|
||||
}
|
||||
|
||||
override fun getItem(position: Int): Category {
|
||||
return list[position]
|
||||
}
|
||||
|
||||
fun selectPosition(position: Int){
|
||||
this.currentSelection = position
|
||||
}
|
||||
|
||||
@@ -1,45 +1,40 @@
|
||||
package com.woka.webseries.adapters
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.content.Intent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.AsyncDifferConfig
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.woka.R
|
||||
import com.woka.databinding.ShowViewHolderBinding
|
||||
import com.woka.utils.TAG
|
||||
import com.woka.utils.isNetworkConnected
|
||||
import com.woka.utils.show
|
||||
import com.woka.utils.toast
|
||||
import com.woka.webseries.WebSeriesRepository
|
||||
import com.woka.webseries.models.ShowData
|
||||
import java.util.concurrent.Executors
|
||||
import com.woka.webseries.views.SeasonActivity
|
||||
import com.woka.webseries.views.SeasonActivity.Companion.EXTRA_SHOW_CATEGORY_DATA
|
||||
import com.woka.webseries.views.SeasonActivity.Companion.EXTRA_SHOW_ID
|
||||
import kotlin.math.max
|
||||
|
||||
class WebSeriesShowAdapter private constructor(private val context: Context,
|
||||
private var categoryId: String,
|
||||
config: AsyncDifferConfig<ShowData>): ListAdapter<ShowData, WebSeriesShowAdapter.ShowViewHolder>(config) {
|
||||
companion object{
|
||||
|
||||
private val DIFF_UTIL = object : DiffUtil.ItemCallback<ShowData>(){
|
||||
override fun areItemsTheSame(oldItem: ShowData, newItem: ShowData): Boolean = oldItem.id == newItem.id
|
||||
override fun areContentsTheSame(oldItem: ShowData, newItem: ShowData): Boolean {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
private val DIFF_CONFIG = AsyncDifferConfig.Builder(DIFF_UTIL)
|
||||
.setBackgroundThreadExecutor(Executors.newSingleThreadExecutor())
|
||||
.build()
|
||||
}
|
||||
class WebSeriesShowAdapter(private val context: Context): RecyclerView.Adapter<WebSeriesShowAdapter.ShowViewHolder>() {
|
||||
|
||||
inner class ShowViewHolder(val binding: ShowViewHolderBinding): ViewHolder(binding.root)
|
||||
|
||||
constructor(context: Context, categoryId: String): this(context, categoryId, DIFF_CONFIG)
|
||||
private var categoryId: String? = null
|
||||
|
||||
private var showList: List<ShowData> = ArrayList()
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
fun submitListShowList(it: List<ShowData>, categoryId: String?) {
|
||||
this.showList = it
|
||||
this.categoryId = categoryId
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ShowViewHolder {
|
||||
return ShowViewHolder(
|
||||
@@ -51,8 +46,10 @@ class WebSeriesShowAdapter private constructor(private val context: Context,
|
||||
)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ShowViewHolder, pos: Int) {
|
||||
val showData = getItem(holder.absoluteAdapterPosition)
|
||||
override fun getItemCount(): Int = showList.size
|
||||
|
||||
override fun onBindViewHolder(holder: ShowViewHolder, position: Int) {
|
||||
val showData = showList[holder.absoluteAdapterPosition]
|
||||
|
||||
holder.binding.apply {
|
||||
showData.thumbnail_path?.let {
|
||||
@@ -65,6 +62,10 @@ class WebSeriesShowAdapter private constructor(private val context: Context,
|
||||
|
||||
title.text = showData.title
|
||||
|
||||
like.show()
|
||||
likeCount.show()
|
||||
fav.show()
|
||||
|
||||
showData.likes_count?.let {
|
||||
likeCount.text = "$it"
|
||||
}
|
||||
@@ -79,25 +80,27 @@ class WebSeriesShowAdapter private constructor(private val context: Context,
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
if (like.isSelected){
|
||||
WebSeriesRepository.likeUnLikeShow("${showData.id}", false, categoryId)
|
||||
categoryId?.let {
|
||||
if (like.isSelected){
|
||||
WebSeriesRepository.likeUnLikeShow("${showData.id}", false, it)
|
||||
|
||||
showData.likes_count?.let {
|
||||
likeCount.text = "${max(it - 1, 0)}"
|
||||
}
|
||||
}else{
|
||||
WebSeriesRepository.likeUnLikeShow("${showData.id}", true, categoryId)
|
||||
showData.likes_count?.let {
|
||||
likeCount.text = "${max(it - 1, 0)}"
|
||||
}
|
||||
}else{
|
||||
WebSeriesRepository.likeUnLikeShow("${showData.id}", true, it)
|
||||
|
||||
showData.likes_count?.let {
|
||||
val value = it + 1
|
||||
likeCount.text = "$value"
|
||||
showData.likes_count?.let {
|
||||
val value = it + 1
|
||||
likeCount.text = "$value"
|
||||
}
|
||||
}
|
||||
|
||||
like.isSelected = !like.isSelected
|
||||
}
|
||||
|
||||
like.isSelected = !like.isSelected
|
||||
}
|
||||
|
||||
fav.isSelected = showData.isBookMarked(categoryId)
|
||||
categoryId?.let { fav.isSelected = showData.isBookMarked(it) }
|
||||
|
||||
fav.setOnClickListener {
|
||||
if (!context.isNetworkConnected()){
|
||||
@@ -105,13 +108,22 @@ class WebSeriesShowAdapter private constructor(private val context: Context,
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
WebSeriesRepository.updateFavShow(
|
||||
showData,
|
||||
!fav.isSelected,
|
||||
categoryId
|
||||
)
|
||||
categoryId?.let {
|
||||
WebSeriesRepository.updateFavShow(
|
||||
showData,
|
||||
!fav.isSelected,
|
||||
it
|
||||
)
|
||||
|
||||
fav.isSelected = !fav.isSelected
|
||||
fav.isSelected = !fav.isSelected
|
||||
}
|
||||
}
|
||||
|
||||
root.setOnClickListener {
|
||||
context.startActivity(Intent(context, SeasonActivity::class.java).apply {
|
||||
putExtra(EXTRA_SHOW_ID, showData.id)
|
||||
putExtra(EXTRA_SHOW_CATEGORY_DATA, categoryId)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.woka.webseries.models
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
data class SeasonMoreDetail(
|
||||
val content_id: Int?,
|
||||
val description: String?,
|
||||
@@ -10,4 +12,4 @@ data class SeasonMoreDetail(
|
||||
val title: String?,
|
||||
val trailer_hd_url: String?,
|
||||
val trailer_sd_url: String?
|
||||
)
|
||||
): Serializable
|
||||
@@ -9,11 +9,8 @@ import com.woka.webseries.models.WebSeriesResponse
|
||||
|
||||
class WebSeriesViewModel: ViewModel() {
|
||||
|
||||
val englishWebSeriesData: LiveData<ApiResult<WebSeriesResponse>>
|
||||
get() = WebSeriesRepository.englishWebSeriesLiveData
|
||||
|
||||
val hindiWebSeriesData: LiveData<ApiResult<WebSeriesResponse>>
|
||||
get() = WebSeriesRepository.hindiWebSeriesLiveData
|
||||
val webSeriesLiveData: LiveData<ApiResult<HashMap<String, WebSeriesResponse>>>
|
||||
get() = WebSeriesRepository.webSeriesLiveData
|
||||
|
||||
val continueWatchLiveData: LiveData<ApiResult<ContinueEpisodeResponse>>
|
||||
get() = WebSeriesRepository.continueWatchLiveData
|
||||
|
||||
@@ -1,16 +1,30 @@
|
||||
package com.woka.webseries.views
|
||||
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.bumptech.glide.Glide
|
||||
import com.woka.R
|
||||
import com.woka.databinding.ActivitySeasonBinding
|
||||
import com.woka.utils.lightStatusBar
|
||||
import com.woka.webseries.WebSeriesRepository
|
||||
import com.woka.webseries.models.ShowData
|
||||
|
||||
class SeasonActivity : AppCompatActivity() {
|
||||
|
||||
companion object{
|
||||
const val EXTRA_SHOW_ID = "extra_show_id_data"
|
||||
const val EXTRA_SHOW_CATEGORY_DATA = "extra_show_category_data"
|
||||
}
|
||||
|
||||
private lateinit var binding: ActivitySeasonBinding
|
||||
private var showId: Int = -1
|
||||
private var categoryId: String? = null
|
||||
|
||||
private var showData: ShowData? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -22,5 +36,49 @@ class SeasonActivity : AppCompatActivity() {
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||
insets
|
||||
}
|
||||
|
||||
with(window){
|
||||
statusBarColor = Color.parseColor("#D3EFF8")
|
||||
lightStatusBar(true)
|
||||
}
|
||||
|
||||
showId = intent.getIntExtra(EXTRA_SHOW_ID, -1)
|
||||
categoryId = intent.getStringExtra(EXTRA_SHOW_CATEGORY_DATA)
|
||||
|
||||
if (showId == -1 || categoryId == null){
|
||||
finish()
|
||||
return
|
||||
}
|
||||
|
||||
WebSeriesRepository.webSeriesData[categoryId]?.show_data?.let {
|
||||
for (show in it){
|
||||
if (showId == show?.id){
|
||||
showData = show
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
initViews()
|
||||
|
||||
}
|
||||
|
||||
private fun initViews() {
|
||||
if (showData != null && categoryId != null) {
|
||||
binding.apply {
|
||||
showData!!.thumbnail_path?.let {
|
||||
Glide.with(applicationContext)
|
||||
.load(it)
|
||||
.into(image)
|
||||
}
|
||||
|
||||
likeCount.text = "${showData!!.likes_count}"
|
||||
|
||||
favSeason.isSelected = showData!!.isBookMarked(categoryId!!)
|
||||
|
||||
likeSeason.isSelected = showData!!.is_liked?:false
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import android.widget.ArrayAdapter
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator
|
||||
@@ -26,14 +27,13 @@ import com.woka.webseries.adapters.WebSeriesShowAdapter
|
||||
import com.woka.webseries.models.WebSeriesResponse
|
||||
import com.woka.webseries.viewmodel.WebSeriesViewModel
|
||||
|
||||
class WebSeriesActivity : WokaBaseActivity(), Observer<ApiResult<WebSeriesResponse>>{
|
||||
class WebSeriesActivity : WokaBaseActivity(), Observer<ApiResult<HashMap<String, WebSeriesResponse>>>{
|
||||
|
||||
private lateinit var binding: ActivityWebSeriesBinding
|
||||
|
||||
private lateinit var viewmodel: WebSeriesViewModel
|
||||
|
||||
private lateinit var engShowAdapter: WebSeriesShowAdapter
|
||||
private lateinit var hinShowAdapter: WebSeriesShowAdapter
|
||||
private lateinit var showAdapter: WebSeriesShowAdapter
|
||||
|
||||
private lateinit var continueWatchAdapter: ContinueEpisodeAdapter
|
||||
|
||||
@@ -88,8 +88,7 @@ class WebSeriesActivity : WokaBaseActivity(), Observer<ApiResult<WebSeriesRespon
|
||||
private fun initViews(){
|
||||
|
||||
// adapters
|
||||
engShowAdapter = WebSeriesShowAdapter(this, "1")
|
||||
hinShowAdapter = WebSeriesShowAdapter(this, "18")
|
||||
showAdapter = WebSeriesShowAdapter(this)
|
||||
continueWatchAdapter = ContinueEpisodeAdapter(this)
|
||||
|
||||
binding.apply {
|
||||
@@ -97,12 +96,10 @@ class WebSeriesActivity : WokaBaseActivity(), Observer<ApiResult<WebSeriesRespon
|
||||
|
||||
toolbar.title.text = getString(R.string.web_series)
|
||||
|
||||
rvHindiWebSeries.adapter = hinShowAdapter
|
||||
rvEngWebSeries.adapter = engShowAdapter
|
||||
rvWebSeries.adapter = showAdapter
|
||||
rvContinueWatch.adapter = continueWatchAdapter
|
||||
|
||||
((rvHindiWebSeries.itemAnimator) as SimpleItemAnimator).supportsChangeAnimations = false
|
||||
((rvEngWebSeries.itemAnimator) as SimpleItemAnimator).supportsChangeAnimations = false
|
||||
((rvWebSeries.itemAnimator) as SimpleItemAnimator).supportsChangeAnimations = false
|
||||
((rvContinueWatch.itemAnimator) as SimpleItemAnimator).supportsChangeAnimations = false
|
||||
}
|
||||
|
||||
@@ -110,8 +107,8 @@ class WebSeriesActivity : WokaBaseActivity(), Observer<ApiResult<WebSeriesRespon
|
||||
|
||||
private fun setObservers(){
|
||||
|
||||
viewmodel.hindiWebSeriesData.observe(this, this)
|
||||
viewmodel.englishWebSeriesData.observe(this, this)
|
||||
viewmodel.webSeriesLiveData.observe(this, this)
|
||||
|
||||
viewmodel.continueWatchLiveData.observe(this){
|
||||
when (it){
|
||||
is ApiResult.Error -> {
|
||||
@@ -127,20 +124,6 @@ class WebSeriesActivity : WokaBaseActivity(), Observer<ApiResult<WebSeriesRespon
|
||||
}
|
||||
}
|
||||
|
||||
binding.categorySpinner.onItemSelectedListener = object : OnItemSelectedListener{
|
||||
override fun onItemSelected(
|
||||
parent: AdapterView<*>?,
|
||||
view: View?,
|
||||
position: Int,
|
||||
id: Long
|
||||
) {
|
||||
catSpinnerAdapter?.selectPosition(position)
|
||||
loadShowData()
|
||||
}
|
||||
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
||||
}
|
||||
|
||||
ModuleRepository.showCategoryLiveData.observe(this){
|
||||
when(it){
|
||||
is ApiResult.Error -> {
|
||||
@@ -149,64 +132,67 @@ class WebSeriesActivity : WokaBaseActivity(), Observer<ApiResult<WebSeriesRespon
|
||||
}
|
||||
is ApiResult.Loading -> {}
|
||||
is ApiResult.Success -> {
|
||||
|
||||
val categories = mutableListOf<String>()
|
||||
it.data?.result?.let {catList ->
|
||||
for (cat in catList){
|
||||
cat?.category_name?.let { category ->
|
||||
categories.add(category)
|
||||
}
|
||||
binding.shimmer.hide()
|
||||
|
||||
binding.trailerView.show()
|
||||
|
||||
adjustMasilaImage()
|
||||
|
||||
binding.spinnerCard.show()
|
||||
binding.selectLangTxt.show()
|
||||
|
||||
WebSeriesRepository.continueWatchData?.let {
|
||||
binding.continueWatchTxt.show()
|
||||
binding.rvContinueWatch.show()
|
||||
}?:{
|
||||
binding.continueWatchTxt.hide()
|
||||
binding.rvContinueWatch.hide()
|
||||
}
|
||||
|
||||
catSpinnerAdapter = SpinnerAdapter(this, catList.filterNotNull())
|
||||
binding.categorySpinner.setAdapter(catSpinnerAdapter)
|
||||
|
||||
loadShowData()
|
||||
}
|
||||
|
||||
catSpinnerAdapter = SpinnerAdapter(this, categories)
|
||||
|
||||
loadShowData()
|
||||
|
||||
binding.categorySpinner.setAdapter(catSpinnerAdapter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
binding.categorySpinner.onItemSelectedListener = object : OnItemSelectedListener{
|
||||
override fun onItemSelected(
|
||||
parent: AdapterView<*>?,
|
||||
view: View?,
|
||||
position: Int,
|
||||
id: Long
|
||||
) {
|
||||
if (position != catSpinnerAdapter?.currentSelection){
|
||||
catSpinnerAdapter?.selectPosition(position)
|
||||
loadShowData()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onChanged(value: ApiResult<WebSeriesResponse>) {
|
||||
override fun onChanged(value: ApiResult<HashMap<String, WebSeriesResponse>>) {
|
||||
when (value){
|
||||
is ApiResult.Error -> {
|
||||
binding.shimmer.hide()
|
||||
binding.errorView.show()
|
||||
binding.shimmerShowData.hide()
|
||||
binding.rvWebSeries.hide()
|
||||
}
|
||||
is ApiResult.Loading -> {
|
||||
binding.shimmerShowData.show()
|
||||
binding.rvWebSeries.hide()
|
||||
}
|
||||
is ApiResult.Loading -> {}
|
||||
is ApiResult.Success -> {
|
||||
value.data?.show_data?.let {
|
||||
binding.trailerView.show()
|
||||
catSpinnerAdapter?.selectedCategoryType?.let { categoryType ->
|
||||
value.data?.get(categoryType)?.show_data?.let {showList ->
|
||||
binding.shimmerShowData.hide()
|
||||
|
||||
adjustMasilaImage()
|
||||
|
||||
binding.shimmer.hide()
|
||||
|
||||
binding.spinnerCard.show()
|
||||
binding.selectLangTxt.show()
|
||||
|
||||
WebSeriesRepository.continueWatchData?.let {
|
||||
binding.continueWatchTxt.show()
|
||||
binding.rvContinueWatch.show()
|
||||
}?:{
|
||||
binding.continueWatchTxt.hide()
|
||||
binding.rvContinueWatch.hide()
|
||||
}
|
||||
|
||||
if (binding.categorySpinner.selectedItemPosition <= 0){
|
||||
// hindi
|
||||
binding.rvHindiWebSeries.show()
|
||||
binding.rvEngWebSeries.hide()
|
||||
|
||||
hinShowAdapter.submitList(it)
|
||||
}else{
|
||||
// English
|
||||
binding.rvHindiWebSeries.hide()
|
||||
binding.rvEngWebSeries.show()
|
||||
|
||||
engShowAdapter.submitList(it)
|
||||
showAdapter.submitListShowList(showList.filterNotNull(), categoryType)
|
||||
binding.rvWebSeries.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -214,10 +200,8 @@ class WebSeriesActivity : WokaBaseActivity(), Observer<ApiResult<WebSeriesRespon
|
||||
}
|
||||
|
||||
private fun loadShowData(){
|
||||
if (binding.categorySpinner.selectedItemId == 0L){
|
||||
WebSeriesRepository.loadHindiWebSeries()
|
||||
}else{
|
||||
WebSeriesRepository.loadEnglishWebSeries()
|
||||
catSpinnerAdapter?.selectedCategoryType?.let {
|
||||
WebSeriesRepository.loadWebSeries(it)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
app/src/main/res/drawable-hdpi/img_season_bg.png
Normal file
BIN
app/src/main/res/drawable-hdpi/img_season_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
BIN
app/src/main/res/drawable-ldpi/img_season_bg.png
Normal file
BIN
app/src/main/res/drawable-ldpi/img_season_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/drawable-mdpi/img_season_bg.png
Normal file
BIN
app/src/main/res/drawable-mdpi/img_season_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
app/src/main/res/drawable-xhdpi/img_season_bg.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/img_season_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/img_season_bg.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/img_season_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/img_season_bg.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/img_season_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -1,5 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="471.7" android:viewportWidth="471.7" android:width="24dp">
|
||||
|
||||
<path android:fillColor="#000000" android:pathData="M433.6,67c-24.7,-24.7 -57.4,-38.2 -92.3,-38.2s-67.7,13.6 -92.4,38.3l-12.9,12.9l-13.1,-13.1c-24.7,-24.7 -57.6,-38.4 -92.5,-38.4c-34.8,0 -67.6,13.6 -92.2,38.2c-24.7,24.7 -38.3,57.5 -38.2,92.4c0,34.9 13.7,67.6 38.4,92.3l187.8,187.8c2.6,2.6 6.1,4 9.5,4c3.4,0 6.9,-1.3 9.5,-3.9l188.2,-187.5c24.7,-24.7 38.3,-57.5 38.3,-92.4C471.8,124.5 458.3,91.7 433.6,67zM414.4,232.7l-178.7,178l-178.3,-178.3c-19.6,-19.6 -30.4,-45.6 -30.4,-73.3s10.7,-53.7 30.3,-73.2c19.5,-19.5 45.5,-30.3 73.1,-30.3c27.7,0 53.8,10.8 73.4,30.4l22.6,22.6c5.3,5.3 13.8,5.3 19.1,0l22.4,-22.4c19.6,-19.6 45.7,-30.4 73.3,-30.4c27.6,0 53.6,10.8 73.2,30.3c19.6,19.6 30.3,45.6 30.3,73.3C444.8,187.1 434,213.1 414.4,232.7z"/>
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="471.7"
|
||||
android:viewportHeight="471.7">
|
||||
|
||||
<path
|
||||
android:fillColor="@color/color_primary"
|
||||
android:pathData="M433.6,67c-24.7,-24.7 -57.4,-38.2 -92.3,-38.2s-67.7,13.6 -92.4,38.3l-12.9,12.9l-13.1,-13.1c-24.7,-24.7 -57.6,-38.4 -92.5,-38.4c-34.8,0 -67.6,13.6 -92.2,38.2c-24.7,24.7 -38.3,57.5 -38.2,92.4c0,34.9 13.7,67.6 38.4,92.3l187.8,187.8c2.6,2.6 6.1,4 9.5,4c3.4,0 6.9,-1.3 9.5,-3.9l188.2,-187.5c24.7,-24.7 38.3,-57.5 38.3,-92.4C471.8,124.5 458.3,91.7 433.6,67zM414.4,232.7l-178.7,178l-178.3,-178.3c-19.6,-19.6 -30.4,-45.6 -30.4,-73.3s10.7,-53.7 30.3,-73.2c19.5,-19.5 45.5,-30.3 73.1,-30.3c27.7,0 53.8,10.8 73.4,30.4l22.6,22.6c5.3,5.3 13.8,5.3 19.1,0l22.4,-22.4c19.6,-19.6 45.7,-30.4 73.3,-30.4c27.6,0 53.6,10.8 73.2,30.3c19.6,19.6 30.3,45.6 30.3,73.3C444.8,187.1 434,213.1 414.4,232.7z" />
|
||||
|
||||
</vector>
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_selected="true"
|
||||
android:drawable="@drawable/ic_heart_filled"/>
|
||||
<item android:drawable="@drawable/ic_heart_filled" android:state_selected="true" />
|
||||
|
||||
<item android:state_selected="false"
|
||||
android:drawable="@drawable/ic_heart_not_filled"
|
||||
/>
|
||||
<item android:drawable="@drawable/ic_heart_not_filled" android:state_selected="false" />
|
||||
|
||||
</selector>
|
||||
@@ -1,7 +1,16 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||
|
||||
<path android:fillColor="#1C274C" android:pathData="M20.27,16.265L20.975,12.185C21.152,11.166 20.368,10.234 19.335,10.234H14.154C13.64,10.234 13.249,9.773 13.333,9.266L13.995,5.221C14.103,4.564 14.072,3.892 13.905,3.248C13.766,2.714 13.354,2.285 12.813,2.111L12.668,2.064C12.34,1.959 11.983,1.984 11.674,2.132C11.335,2.296 11.086,2.595 10.994,2.95L10.518,4.784C10.367,5.367 10.146,5.93 9.862,6.463C9.447,7.24 8.805,7.862 8.137,8.438L6.698,9.677C6.293,10.027 6.08,10.551 6.126,11.084L6.938,20.477C7.012,21.339 7.733,22 8.597,22H13.245C16.726,22 19.698,19.574 20.27,16.265Z"/>
|
||||
|
||||
<path android:fillColor="#1C274C" android:fillType="evenOdd" android:pathData="M2.968,9.485C3.369,9.468 3.713,9.77 3.747,10.17L4.719,21.406C4.781,22.128 4.213,22.75 3.487,22.75C2.803,22.75 2.25,22.195 2.25,21.513V10.234C2.25,9.833 2.566,9.502 2.968,9.485Z"/>
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="#1C274C"
|
||||
android:pathData="M20.27,16.265L20.975,12.185C21.152,11.166 20.368,10.234 19.335,10.234H14.154C13.64,10.234 13.249,9.773 13.333,9.266L13.995,5.221C14.103,4.564 14.072,3.892 13.905,3.248C13.766,2.714 13.354,2.285 12.813,2.111L12.668,2.064C12.34,1.959 11.983,1.984 11.674,2.132C11.335,2.296 11.086,2.595 10.994,2.95L10.518,4.784C10.367,5.367 10.146,5.93 9.862,6.463C9.447,7.24 8.805,7.862 8.137,8.438L6.698,9.677C6.293,10.027 6.08,10.551 6.126,11.084L6.938,20.477C7.012,21.339 7.733,22 8.597,22H13.245C16.726,22 19.698,19.574 20.27,16.265Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#1C274C"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M2.968,9.485C3.369,9.468 3.713,9.77 3.747,10.17L4.719,21.406C4.781,22.128 4.213,22.75 3.487,22.75C2.803,22.75 2.25,22.195 2.25,21.513V10.234C2.25,9.833 2.566,9.502 2.968,9.485Z" />
|
||||
|
||||
</vector>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="800dp"
|
||||
android:height="800dp"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
|
||||
10
app/src/main/res/drawable/ic_play_filled.xml
Normal file
10
app/src/main/res/drawable/ic_play_filled.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M0,16C0,7.177 7.177,0 16,0C24.823,0 32,7.177 32,16C32,24.823 24.823,32 16,32C7.177,32 0,24.823 0,16ZM23.652,16L11.826,9.043V22.956L23.652,16Z"
|
||||
android:fillColor="#ffffff"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/ic_share.xml
Normal file
5
app/src/main/res/drawable/ic_share.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="18" android:viewportWidth="18" android:width="24dp">
|
||||
|
||||
<path android:fillColor="#09005D" android:pathData="M15,0C13.342,0 12,1.342 12,3C12,3.208 12.029,3.413 12.07,3.609L5.25,7.031C4.699,6.401 3.902,6 3,6C1.342,6 0,7.342 0,9C0,10.658 1.342,12 3,12C3.902,12 4.699,11.599 5.25,10.969L12.07,14.391C12.029,14.587 12,14.792 12,15C12,16.658 13.342,18 15,18C16.658,18 18,16.658 18,15C18,13.342 16.658,12 15,12C14.098,12 13.301,12.401 12.75,13.031L5.93,9.609C5.971,9.413 6,9.208 6,9C6,8.792 5.971,8.587 5.93,8.391L12.75,4.969C13.301,5.599 14.098,6 15,6C16.658,6 18,4.658 18,3C18,1.342 16.658,0 15,0Z"/>
|
||||
|
||||
</vector>
|
||||
@@ -1,10 +1,388 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_primary"
|
||||
tools:context=".webseries.views.SeasonActivity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/img_season_bg"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingBottom="35dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_btn"
|
||||
android:layout_width="@dimen/_25sdp"
|
||||
android:layout_height="@dimen/_25sdp"
|
||||
android:contentDescription="@string/back_btn"
|
||||
android:src="@drawable/ic_arrow_back_full"
|
||||
android:scaleType="fitXY"
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
android:translationZ="1dp"
|
||||
|
||||
app:tint="@color/color_primary" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/trailer_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/back_btn"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/_140sdp"
|
||||
android:layout_margin="10dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:src="@drawable/img_masila_tn_small"
|
||||
android:src="@android:color/darker_gray"
|
||||
android:contentDescription="@string/masila"
|
||||
android:scaleType="fitXY"
|
||||
/>
|
||||
|
||||
<com.woka.utils.PressableCard
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/round_25"
|
||||
android:backgroundTint="@color/color_primary"
|
||||
android:layout_centerInParent="true"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/play_trailer"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
|
||||
/>
|
||||
|
||||
</com.woka.utils.PressableCard>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/season_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text="HIP HIPPO’S ADVENTURES"
|
||||
android:fontFamily="@font/exo_2_extrabold"
|
||||
android:textColor="@color/color_primary"
|
||||
android:textSize="@dimen/_16ssp"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@id/trailer_card"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/season_year"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text="2022"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textColor="@color/color_primary"
|
||||
|
||||
android:layout_marginTop="5dp"
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/season_title"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/episode_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text="5 EPISODES"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textColor="@color/color_primary"
|
||||
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="25dp"
|
||||
|
||||
app:layout_constraintStart_toEndOf="@id/season_year"
|
||||
app:layout_constraintTop_toBottomOf="@id/season_title"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/seaon_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text="1 HR 25 MIN"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textColor="@color/color_primary"
|
||||
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="25dp"
|
||||
|
||||
app:layout_constraintStart_toEndOf="@id/episode_number"
|
||||
app:layout_constraintTop_toBottomOf="@id/season_title"
|
||||
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
|
||||
android:gravity="center_vertical"
|
||||
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/season_title"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_like_filled"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/like_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
tools:text="10"
|
||||
android:fontFamily="@font/exo_2_semibold"
|
||||
android:textColor="@color/color_primary"
|
||||
|
||||
android:textAlignment="center"
|
||||
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginStart="3dp"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/season_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text="Adventures of a powerful but dimwitted cyborg police inspector named Gadget as he investigates the criminal schemes of Dr. Claw and his organization, M.A.D"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textColor="@color/color_primary"
|
||||
|
||||
android:layout_marginTop="8dp"
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/season_year"
|
||||
|
||||
/>
|
||||
|
||||
<com.woka.utils.PressableCard
|
||||
android:id="@+id/watch_card"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/season_description"
|
||||
|
||||
app:isHapticEnabled="true"
|
||||
|
||||
android:layout_marginTop="20dp">
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/watch"
|
||||
android:fontFamily="@font/exo_2_extrabold"
|
||||
android:textColor="@color/white"
|
||||
|
||||
android:background="@drawable/round_bg_25"
|
||||
android:backgroundTint="#5E1FC4"
|
||||
|
||||
android:drawableStart="@drawable/ic_play_filled"
|
||||
|
||||
android:drawablePadding="15dp"
|
||||
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingVertical="10dp"
|
||||
|
||||
/>
|
||||
|
||||
</com.woka.utils.PressableCard>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rate_season_ll"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/watch_card"
|
||||
app:layout_constraintBottom_toBottomOf="@id/watch_card"
|
||||
|
||||
android:gravity="center_horizontal"
|
||||
|
||||
android:layout_marginEnd="5dp"
|
||||
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/like_season"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_like_selector"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginTop="5dp"
|
||||
|
||||
android:text="@string/rate"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textColor="@color/color_primary" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_1"
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="@color/color_primary"
|
||||
|
||||
android:layout_marginEnd="15dp"
|
||||
|
||||
app:layout_constraintEnd_toStartOf="@id/rate_season_ll"
|
||||
app:layout_constraintTop_toTopOf="@id/watch_card"
|
||||
app:layout_constraintBottom_toBottomOf="@id/watch_card"
|
||||
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/share_season_ll"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
app:layout_constraintEnd_toStartOf="@id/divider_1"
|
||||
app:layout_constraintTop_toTopOf="@id/watch_card"
|
||||
app:layout_constraintBottom_toBottomOf="@id/watch_card"
|
||||
|
||||
android:gravity="center_horizontal"
|
||||
|
||||
android:layout_marginEnd="10dp"
|
||||
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/share_season"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_share"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginTop="5dp"
|
||||
|
||||
android:text="@string/share"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textColor="@color/color_primary" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_2"
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="@color/color_primary"
|
||||
|
||||
android:layout_marginEnd="15dp"
|
||||
|
||||
app:layout_constraintEnd_toStartOf="@id/share_season_ll"
|
||||
app:layout_constraintTop_toTopOf="@id/watch_card"
|
||||
app:layout_constraintBottom_toBottomOf="@id/watch_card"
|
||||
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/fav_season_LL"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
app:layout_constraintEnd_toStartOf="@id/divider_2"
|
||||
app:layout_constraintTop_toTopOf="@id/watch_card"
|
||||
app:layout_constraintBottom_toBottomOf="@id/watch_card"
|
||||
|
||||
android:gravity="center_horizontal"
|
||||
|
||||
android:layout_marginEnd="10dp"
|
||||
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fav_season"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_heart_select"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginTop="3dp"
|
||||
|
||||
android:text="@string/add"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textColor="@color/color_primary" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/shimmer"
|
||||
android:visibility="visible"
|
||||
android:visibility="gone"
|
||||
android:background="@color/color_primary_dark"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@@ -258,7 +258,7 @@
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/spinner_card"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
android:layout_width="@dimen/_160sdp"
|
||||
android:layout_height="@dimen/_40sdp"
|
||||
|
||||
@@ -280,19 +280,34 @@
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_hindi_web_series"
|
||||
android:visibility="gone"
|
||||
<com.facebook.shimmer.ShimmerFrameLayout
|
||||
android:id="@+id/shimmer_show_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/show_view_holder"
|
||||
android:layout_marginTop="5dp"
|
||||
/>
|
||||
app:shimmer_base_alpha="0.8"
|
||||
app:shimmer_auto_start="true"
|
||||
app:shimmer_highlight_alpha="0.5"
|
||||
app:shimmer_duration="1500"
|
||||
android:layout_marginVertical="10dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/show_view_holder"/>
|
||||
<include layout="@layout/show_view_holder"/>
|
||||
<include layout="@layout/show_view_holder"/>
|
||||
<include layout="@layout/show_view_holder"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.facebook.shimmer.ShimmerFrameLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_eng_web_series"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/rv_web_series"
|
||||
android:visibility="visible"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
|
||||
<com.woka.utils.PressableImageView
|
||||
android:id="@+id/like"
|
||||
android:visibility="gone"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="24dp"
|
||||
android:contentDescription="@string/image"
|
||||
@@ -73,6 +74,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/like_count"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -93,6 +95,7 @@
|
||||
|
||||
<com.woka.utils.PressableImageView
|
||||
android:id="@+id/fav"
|
||||
android:visibility="gone"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="19dp"
|
||||
android:contentDescription="@string/image"
|
||||
|
||||
@@ -177,4 +177,8 @@
|
||||
<string name="trailer">TRAILER</string>
|
||||
<string name="select_video_language">Select video language</string>
|
||||
<string name="continue_watching">Continue watching</string>
|
||||
<string name="watch">WATCH</string>
|
||||
<string name="add">ADD</string>
|
||||
<string name="rate">RATE</string>
|
||||
<string name="share">SHARE</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user