View all buttons in all lists in favorites list.
Removed all local changes in favorites list from all modules repository Added flag to only load favorites list when there is changes in modules data. Created FavoritesActivity and fragment_web_series_eng and creadted viewmodel and integrated api for loading data of webseries.
This commit is contained in:
@@ -17,6 +17,9 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.Woka"
|
android:theme="@style/Theme.Woka"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
|
<activity
|
||||||
|
android:name=".home.mylist.view.FavoritesActivity"
|
||||||
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".modules.blogs.view.BlogsActivity"
|
android:name=".modules.blogs.view.BlogsActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import com.woka.audiobooks.models.audiodata.AudioBookData
|
|||||||
import com.woka.audiobooks.models.audiodata.AudioBooksResponse
|
import com.woka.audiobooks.models.audiodata.AudioBooksResponse
|
||||||
import com.woka.audiobooks.models.continuedata.ContinueAudioResponse
|
import com.woka.audiobooks.models.continuedata.ContinueAudioResponse
|
||||||
import com.woka.home.mylist.MyListRepository
|
import com.woka.home.mylist.MyListRepository
|
||||||
import com.woka.home.mylist.models.FavAudioBookData
|
|
||||||
import com.woka.home.mylist.models.PostType
|
import com.woka.home.mylist.models.PostType
|
||||||
import com.woka.networking.ApiResult
|
import com.woka.networking.ApiResult
|
||||||
import com.woka.networking.RetrofitHelper
|
import com.woka.networking.RetrofitHelper
|
||||||
@@ -14,7 +13,6 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import okhttp3.FormBody
|
import okhttp3.FormBody
|
||||||
import kotlin.math.max
|
|
||||||
|
|
||||||
object AudioBookRepository {
|
object AudioBookRepository {
|
||||||
|
|
||||||
@@ -69,19 +67,8 @@ object AudioBookRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun changeLikeLocally(id: String, isLiked: Boolean){
|
private fun changeLikeLocally(id: String, isLiked: Boolean){
|
||||||
// changing in fav list locally
|
// now, not handling data locally but setting flag to load the favorite list
|
||||||
MyListRepository.myFavData.result?.audio_data?.let {
|
MyListRepository.setLoadNewDataFlag(true)
|
||||||
for (audioData in it){
|
|
||||||
if ("${audioData.id}" == id){
|
|
||||||
audioData.is_liked = isLiked
|
|
||||||
audioData.likes_count?.let { count ->
|
|
||||||
audioData.likes_count = if (isLiked) count + 1
|
|
||||||
else max(0, count - 1)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateFavShow(audioBookData: AudioBookData, addToBookmark: Boolean){
|
fun updateFavShow(audioBookData: AudioBookData, addToBookmark: Boolean){
|
||||||
@@ -105,13 +92,6 @@ object AudioBookRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MyListRepository.myFavData.result?.audio_data?.let {favAudioData ->
|
MyListRepository.setLoadNewDataFlag(true)
|
||||||
audioBookData.mark_as_favourite = addToBookmark
|
|
||||||
if (addToBookmark){
|
|
||||||
favAudioData.add(FavAudioBookData(audioBookData))
|
|
||||||
}else{
|
|
||||||
favAudioData.removeIf{it.id == audioBookData.id}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,5 +16,29 @@ enum class ContentType(val id: Int) {
|
|||||||
FM(13),
|
FM(13),
|
||||||
TEASER(14),
|
TEASER(14),
|
||||||
OTHERS(15),
|
OTHERS(15),
|
||||||
HOME(16)
|
HOME(16);
|
||||||
|
|
||||||
|
companion object{
|
||||||
|
fun create(id: Int): ContentType?{
|
||||||
|
return when (id){
|
||||||
|
1 -> SERIES
|
||||||
|
2 -> SEASON
|
||||||
|
3 -> EPISODE
|
||||||
|
4 -> VIDEO
|
||||||
|
5 -> PAINT
|
||||||
|
6 -> GAME
|
||||||
|
7 -> AUDIO
|
||||||
|
8 -> KARAOKE_VIDEO
|
||||||
|
9 -> SHOP_PRODUCT
|
||||||
|
10 -> PARENTAL_VIDEO
|
||||||
|
11 -> ARTICLE
|
||||||
|
12 -> LIVE_TV
|
||||||
|
13 -> FM
|
||||||
|
14 -> TEASER
|
||||||
|
15 -> OTHERS
|
||||||
|
16 -> HOME
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ import com.woka.home.mylist.models.FavAudioBookData
|
|||||||
import com.woka.home.mylist.models.FavGameData
|
import com.woka.home.mylist.models.FavGameData
|
||||||
import com.woka.home.mylist.models.FavKaraokeData
|
import com.woka.home.mylist.models.FavKaraokeData
|
||||||
import com.woka.home.mylist.models.PostType
|
import com.woka.home.mylist.models.PostType
|
||||||
|
import com.woka.home.mylist.view.FavoritesActivity
|
||||||
|
import com.woka.home.mylist.view.FavoritesActivity.Companion.EXTRA_FAVORITE_CONTENT_TYPE
|
||||||
|
import com.woka.home.mylist.view.FavoritesActivity.Companion.EXTRA_FAVORITE_TITLE
|
||||||
|
import com.woka.home.mylist.view.FavoritesActivity.Companion.EXTRA_FAVORITE_WEB_SERIES_IS_ENGLISH
|
||||||
import com.woka.home.viewmodels.HomeViewModel
|
import com.woka.home.viewmodels.HomeViewModel
|
||||||
import com.woka.karaoke.KaraokeRepository
|
import com.woka.karaoke.KaraokeRepository
|
||||||
import com.woka.karaoke.models.listing.KaraokeData
|
import com.woka.karaoke.models.listing.KaraokeData
|
||||||
@@ -116,7 +120,7 @@ class MyListFragment : Fragment() {
|
|||||||
registerIntentLaunchers()
|
registerIntentLaunchers()
|
||||||
|
|
||||||
if (userPrefs?.userType != UserType.GUEST) {
|
if (userPrefs?.userType != UserType.GUEST) {
|
||||||
MyListRepository.loadMyFavList()
|
loadFavoriteList()
|
||||||
}else{
|
}else{
|
||||||
binding.noSignInView.show()
|
binding.noSignInView.show()
|
||||||
}
|
}
|
||||||
@@ -164,6 +168,16 @@ class MyListFragment : Fragment() {
|
|||||||
|
|
||||||
clickHelper.upsertClickEvent(ContentType.OTHERS)
|
clickHelper.upsertClickEvent(ContentType.OTHERS)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
webSeriesEngViewAll.setOnClickListener {
|
||||||
|
activity?.let {activity ->
|
||||||
|
startActivity(Intent(activity, FavoritesActivity::class.java).apply {
|
||||||
|
putExtra(EXTRA_FAVORITE_TITLE, getString(R.string.web_series_english))
|
||||||
|
putExtra(EXTRA_FAVORITE_CONTENT_TYPE, ContentType.SERIES.id)
|
||||||
|
putExtra(EXTRA_FAVORITE_WEB_SERIES_IS_ENGLISH, true)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,6 +193,124 @@ class MyListFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun loadFavoriteList(){
|
||||||
|
lifecycleScope.launch {
|
||||||
|
binding.apply {
|
||||||
|
progressBar.show()
|
||||||
|
noData.hide()
|
||||||
|
|
||||||
|
when (val it = MyListRepository.loadMyFavList()){
|
||||||
|
is ApiResult.Error -> {
|
||||||
|
progressBar.hide()
|
||||||
|
noData.show()
|
||||||
|
}
|
||||||
|
is ApiResult.Loading -> {}
|
||||||
|
is ApiResult.Success -> {
|
||||||
|
it.data?.result?.let { result ->
|
||||||
|
|
||||||
|
var dataLoaded = false
|
||||||
|
|
||||||
|
progressBar.hide()
|
||||||
|
|
||||||
|
result.show_data?.let {showData ->
|
||||||
|
if (showData.isNotEmpty()){
|
||||||
|
val engList = mutableListOf<BookmarkedShowData>()
|
||||||
|
val hinList = mutableListOf<BookmarkedShowData>()
|
||||||
|
|
||||||
|
for (show in showData){
|
||||||
|
if (show.bookmark_category_ids?.isEmpty() == true) continue
|
||||||
|
|
||||||
|
val ids = show.bookmark_category_ids?.split(",")
|
||||||
|
ids?.let {bIds ->
|
||||||
|
if (bIds.isNotEmpty()) {
|
||||||
|
when (bIds.size) {
|
||||||
|
1 -> if (bIds[0] == "1") engList.add(show) else hinList.add(show)
|
||||||
|
else -> {
|
||||||
|
engList.add(show)
|
||||||
|
hinList.add(show)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (engList.isNotEmpty()){
|
||||||
|
webSeriesEnglishView.show()
|
||||||
|
dataLoaded = true
|
||||||
|
webSeriesEAdapter.submitList(engList.reversed())
|
||||||
|
|
||||||
|
webSeriesEngViewAll.setVisibility(engList.size >= 3)
|
||||||
|
}else{
|
||||||
|
webSeriesEnglishView.hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hinList.isNotEmpty()){
|
||||||
|
webSeriesHindiView.show()
|
||||||
|
dataLoaded = true
|
||||||
|
webSeriesHAdapter.submitList(hinList.reversed())
|
||||||
|
|
||||||
|
webSeriesHinViewAll.setVisibility(hinList.size >= 3)
|
||||||
|
}else{
|
||||||
|
webSeriesHindiView.hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
webSeriesEnglishView.hide()
|
||||||
|
webSeriesHindiView.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result.audio_data?.let { audioData ->
|
||||||
|
|
||||||
|
if (audioData.isNotEmpty()){
|
||||||
|
audioBooksView.show()
|
||||||
|
|
||||||
|
dataLoaded = true
|
||||||
|
audioBooksAdapter.submitList(audioData.reversed())
|
||||||
|
|
||||||
|
audioBooksViewAll.setVisibility(audioData.size >= 3)
|
||||||
|
}else{
|
||||||
|
audioBooksView.hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
result.sing_karaoke_data?.let { singKaraokeData ->
|
||||||
|
if (singKaraokeData.isNotEmpty()){
|
||||||
|
karaokeView.show()
|
||||||
|
|
||||||
|
dataLoaded = true
|
||||||
|
karaokeAdapter.submitList(singKaraokeData.reversed())
|
||||||
|
karaokeViewAll.setVisibility(singKaraokeData.size >= 3)
|
||||||
|
}else{
|
||||||
|
karaokeView.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result.game_data?.let { gamesData ->
|
||||||
|
if (gamesData.isNotEmpty()){
|
||||||
|
gamesView.show()
|
||||||
|
|
||||||
|
dataLoaded = true
|
||||||
|
gamesAdapter.submitList(gamesData.reversed())
|
||||||
|
gamesViewAll.setVisibility(gamesData.size >= 3)
|
||||||
|
}else{
|
||||||
|
gamesView.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!dataLoaded){
|
||||||
|
noData.show()
|
||||||
|
}else{
|
||||||
|
noData.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun setObservers(){
|
private fun setObservers(){
|
||||||
binding.apply {
|
binding.apply {
|
||||||
|
|
||||||
@@ -211,122 +343,6 @@ class MyListFragment : Fragment() {
|
|||||||
gamesAdapter.notifyItemRangeChanged(0, gamesAdapter.currentList.size)
|
gamesAdapter.notifyItemRangeChanged(0, gamesAdapter.currentList.size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MyListRepository.myFavListLiveData.observe(viewLifecycleOwner){
|
|
||||||
lifecycleScope.launch {
|
|
||||||
when (it){
|
|
||||||
is ApiResult.Error -> {
|
|
||||||
progressBar.hide()
|
|
||||||
noData.show()
|
|
||||||
}
|
|
||||||
is ApiResult.Loading -> {
|
|
||||||
progressBar.show()
|
|
||||||
noData.hide()
|
|
||||||
}
|
|
||||||
is ApiResult.Success -> {
|
|
||||||
it.data?.result?.let { result ->
|
|
||||||
|
|
||||||
var dataLoaded = false
|
|
||||||
|
|
||||||
progressBar.hide()
|
|
||||||
|
|
||||||
result.show_data?.let {showData ->
|
|
||||||
if (showData.isNotEmpty()){
|
|
||||||
val engList = mutableListOf<BookmarkedShowData>()
|
|
||||||
val hinList = mutableListOf<BookmarkedShowData>()
|
|
||||||
|
|
||||||
for (show in showData){
|
|
||||||
if (show.bookmark_category_ids?.isEmpty() == true) continue
|
|
||||||
|
|
||||||
val ids = show.bookmark_category_ids?.split(",")
|
|
||||||
ids?.let {bIds ->
|
|
||||||
if (bIds.isNotEmpty()) {
|
|
||||||
when (bIds.size) {
|
|
||||||
1 -> if (bIds[0] == "1") engList.add(show) else hinList.add(show)
|
|
||||||
else -> {
|
|
||||||
engList.add(show)
|
|
||||||
hinList.add(show)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (engList.isNotEmpty()){
|
|
||||||
webSeriesEnglishView.show()
|
|
||||||
dataLoaded = true
|
|
||||||
webSeriesEAdapter.submitList(engList.reversed())
|
|
||||||
|
|
||||||
webSeriesEngViewAll.setVisibility(engList.size >= 3)
|
|
||||||
}else{
|
|
||||||
webSeriesEnglishView.hide()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hinList.isNotEmpty()){
|
|
||||||
webSeriesHindiView.show()
|
|
||||||
dataLoaded = true
|
|
||||||
webSeriesHAdapter.submitList(hinList.reversed())
|
|
||||||
|
|
||||||
webSeriesHinViewAll.setVisibility(hinList.size >= 3)
|
|
||||||
}else{
|
|
||||||
webSeriesHindiView.hide()
|
|
||||||
}
|
|
||||||
|
|
||||||
}else{
|
|
||||||
webSeriesEnglishView.hide()
|
|
||||||
webSeriesHindiView.hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
result.audio_data?.let { audioData ->
|
|
||||||
|
|
||||||
if (audioData.isNotEmpty()){
|
|
||||||
audioBooksView.show()
|
|
||||||
|
|
||||||
dataLoaded = true
|
|
||||||
audioBooksAdapter.submitList(audioData.reversed())
|
|
||||||
|
|
||||||
audioBooksViewAll.setVisibility(audioData.size >= 3)
|
|
||||||
}else{
|
|
||||||
audioBooksView.hide()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
result.sing_karaoke_data?.let { singKaraokeData ->
|
|
||||||
if (singKaraokeData.isNotEmpty()){
|
|
||||||
karaokeView.show()
|
|
||||||
|
|
||||||
dataLoaded = true
|
|
||||||
karaokeAdapter.submitList(singKaraokeData.reversed())
|
|
||||||
karaokeViewAll.setVisibility(singKaraokeData.size >= 3)
|
|
||||||
}else{
|
|
||||||
karaokeView.hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
result.game_data?.let { gamesData ->
|
|
||||||
if (gamesData.isNotEmpty()){
|
|
||||||
gamesView.show()
|
|
||||||
|
|
||||||
dataLoaded = true
|
|
||||||
gamesAdapter.submitList(gamesData.reversed())
|
|
||||||
gamesViewAll.setVisibility(gamesData.size >= 3)
|
|
||||||
}else{
|
|
||||||
gamesView.hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dataLoaded){
|
|
||||||
noData.show()
|
|
||||||
}else{
|
|
||||||
noData.hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,13 @@
|
|||||||
package com.woka.home.mylist
|
package com.woka.home.mylist
|
||||||
|
|
||||||
import androidx.lifecycle.LiveData
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
|
||||||
import com.woka.home.mylist.models.MyListResponse
|
import com.woka.home.mylist.models.MyListResponse
|
||||||
import com.woka.home.mylist.models.Result
|
import com.woka.home.mylist.models.Result
|
||||||
import com.woka.networking.ApiResult
|
import com.woka.networking.ApiResult
|
||||||
import com.woka.userdata.UserRepository
|
import com.woka.userdata.UserRepository
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
|
|
||||||
object MyListRepository {
|
object MyListRepository {
|
||||||
|
|
||||||
private val _myFavListLiveData = MutableLiveData<ApiResult<MyListResponse>>()
|
private var myFavData: MyListResponse = MyListResponse(Result(
|
||||||
val myFavListLiveData: LiveData<ApiResult<MyListResponse>>
|
|
||||||
get() = _myFavListLiveData
|
|
||||||
|
|
||||||
var myFavData: MyListResponse = MyListResponse(Result(
|
|
||||||
mutableListOf(),
|
mutableListOf(),
|
||||||
mutableListOf(),
|
mutableListOf(),
|
||||||
mutableListOf(),
|
mutableListOf(),
|
||||||
@@ -27,9 +18,14 @@ object MyListRepository {
|
|||||||
/*
|
/*
|
||||||
flag to load a new data whenever necessary
|
flag to load a new data whenever necessary
|
||||||
for eg. when user has signed in with new account and the apps hold the older repository
|
for eg. when user has signed in with new account and the apps hold the older repository
|
||||||
|
or changed data from independent module
|
||||||
*/
|
*/
|
||||||
private var shallLoadNewData: Boolean = true
|
private var shallLoadNewData: Boolean = true
|
||||||
|
|
||||||
|
fun setLoadNewDataFlag(loadNew: Boolean){
|
||||||
|
this.shallLoadNewData = loadNew
|
||||||
|
}
|
||||||
|
|
||||||
fun clearData(){
|
fun clearData(){
|
||||||
shallLoadNewData = true
|
shallLoadNewData = true
|
||||||
myFavData.result?.let {
|
myFavData.result?.let {
|
||||||
@@ -41,26 +37,25 @@ object MyListRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun loadMyFavList(){
|
suspend fun loadMyFavList(): ApiResult<MyListResponse> {
|
||||||
if (shallLoadNewData) {
|
return if (shallLoadNewData) {
|
||||||
// shall load new data
|
// shall load new data
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
val response = UserRepository.loadMyFavList()
|
||||||
_myFavListLiveData.postValue(ApiResult.Loading())
|
|
||||||
val response = UserRepository.loadMyFavList()
|
|
||||||
|
|
||||||
when (response){
|
when (response){
|
||||||
is ApiResult.Error -> {}
|
is ApiResult.Error -> {}
|
||||||
is ApiResult.Loading -> {}
|
is ApiResult.Loading -> {}
|
||||||
is ApiResult.Success -> {
|
is ApiResult.Success -> {
|
||||||
response.data?.let {
|
response.data?.let {
|
||||||
myFavData = it
|
myFavData = it
|
||||||
shallLoadNewData = false
|
shallLoadNewData = false
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_myFavListLiveData.postValue(response)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
response
|
||||||
|
}else{
|
||||||
|
ApiResult.Success(myFavData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
174
app/src/main/java/com/woka/home/mylist/view/FavoritesActivity.kt
Normal file
174
app/src/main/java/com/woka/home/mylist/view/FavoritesActivity.kt
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
package com.woka.home.mylist.view
|
||||||
|
|
||||||
|
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 androidx.fragment.app.Fragment
|
||||||
|
import androidx.lifecycle.ViewModelProvider
|
||||||
|
import com.woka.R
|
||||||
|
import com.woka.database.models.clicks.ContentType
|
||||||
|
import com.woka.databinding.ActivityFavoritesBinding
|
||||||
|
import com.woka.home.mylist.adapters.WebSeriesAdapter
|
||||||
|
import com.woka.home.mylist.models.PostType
|
||||||
|
import com.woka.home.mylist.view.fragments.WebSeriesEngFragment
|
||||||
|
import com.woka.home.mylist.viewmodel.FavoriteViewModel
|
||||||
|
import com.woka.networking.ApiResult
|
||||||
|
import com.woka.utils.hide
|
||||||
|
import com.woka.utils.lightStatusBar
|
||||||
|
import com.woka.utils.setVisibility
|
||||||
|
import com.woka.utils.show
|
||||||
|
|
||||||
|
class FavoritesActivity : AppCompatActivity() {
|
||||||
|
|
||||||
|
companion object{
|
||||||
|
const val EXTRA_FAVORITE_TITLE = "extra_favorite_title"
|
||||||
|
const val EXTRA_FAVORITE_CONTENT_TYPE = "extra_favorite_content_type"
|
||||||
|
const val EXTRA_FAVORITE_WEB_SERIES_IS_ENGLISH = "extra_favorite_web_series_is_english"
|
||||||
|
}
|
||||||
|
|
||||||
|
private lateinit var binding: ActivityFavoritesBinding
|
||||||
|
private lateinit var viewModel: FavoriteViewModel
|
||||||
|
|
||||||
|
private lateinit var adapter: WebSeriesAdapter
|
||||||
|
|
||||||
|
private var favTitle: String = ""
|
||||||
|
private var contentType: ContentType? = null
|
||||||
|
private var webSeriesIsEnglish = false
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
enableEdgeToEdge()
|
||||||
|
binding = ActivityFavoritesBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
||||||
|
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||||
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||||
|
insets
|
||||||
|
}
|
||||||
|
|
||||||
|
window.lightStatusBar(false)
|
||||||
|
window.navigationBarColor = Color.BLACK
|
||||||
|
|
||||||
|
viewModel = ViewModelProvider(this)[FavoriteViewModel::class.java]
|
||||||
|
|
||||||
|
adapter = WebSeriesAdapter(this, "1", ::onListEmptyListener)
|
||||||
|
|
||||||
|
favTitle = intent.getStringExtra(EXTRA_FAVORITE_TITLE)?:""
|
||||||
|
contentType = ContentType.create(intent.getIntExtra(EXTRA_FAVORITE_CONTENT_TYPE, -1))
|
||||||
|
webSeriesIsEnglish = intent.getBooleanExtra(EXTRA_FAVORITE_WEB_SERIES_IS_ENGLISH, false)
|
||||||
|
|
||||||
|
initViews()
|
||||||
|
|
||||||
|
clickEvents()
|
||||||
|
|
||||||
|
initFragment()
|
||||||
|
|
||||||
|
setObservers()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun onListEmptyListener(postType: PostType, b: Boolean) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initViews(){
|
||||||
|
binding.apply {
|
||||||
|
title.text = favTitle
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun clickEvents(){
|
||||||
|
binding.apply {
|
||||||
|
backBtn.setOnClickListener {
|
||||||
|
onBackPressedDispatcher.onBackPressed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initFragment(){
|
||||||
|
var fragment: Fragment? = null
|
||||||
|
when (contentType){
|
||||||
|
ContentType.SERIES -> {
|
||||||
|
viewModel.contentType = contentType
|
||||||
|
viewModel.webSeriesIsEnglish = webSeriesIsEnglish
|
||||||
|
|
||||||
|
fragment = WebSeriesEngFragment()
|
||||||
|
}
|
||||||
|
ContentType.SEASON -> {}
|
||||||
|
ContentType.EPISODE -> {}
|
||||||
|
ContentType.VIDEO -> {}
|
||||||
|
ContentType.PAINT -> {}
|
||||||
|
ContentType.GAME -> {}
|
||||||
|
ContentType.AUDIO -> {}
|
||||||
|
ContentType.KARAOKE_VIDEO -> {}
|
||||||
|
ContentType.SHOP_PRODUCT -> {}
|
||||||
|
ContentType.PARENTAL_VIDEO -> {}
|
||||||
|
ContentType.ARTICLE -> {}
|
||||||
|
ContentType.LIVE_TV -> {}
|
||||||
|
ContentType.FM -> {}
|
||||||
|
ContentType.TEASER -> {}
|
||||||
|
ContentType.OTHERS -> {}
|
||||||
|
ContentType.HOME -> {}
|
||||||
|
null -> {}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment?.let {
|
||||||
|
supportFragmentManager.beginTransaction()
|
||||||
|
.add(R.id.fc_favorites, it)
|
||||||
|
.commit()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setObservers(){
|
||||||
|
viewModel.favoritesLiveData.observe(this){
|
||||||
|
binding.apply {
|
||||||
|
when (it){
|
||||||
|
is ApiResult.Error -> {
|
||||||
|
if (adapter.currentList.isEmpty()){
|
||||||
|
// no orders at all
|
||||||
|
dataView.hide()
|
||||||
|
noData.show()
|
||||||
|
}else{
|
||||||
|
// load more orders failed
|
||||||
|
dataView.show()
|
||||||
|
shimmer.hide()
|
||||||
|
|
||||||
|
loadMoreBtn.text = getString(R.string.retry)
|
||||||
|
loadMoreBtn.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
is ApiResult.Loading -> {
|
||||||
|
noData.hide()
|
||||||
|
|
||||||
|
dataView.show()
|
||||||
|
shimmer.show()
|
||||||
|
|
||||||
|
loadMoreBtn.hide()
|
||||||
|
}
|
||||||
|
is ApiResult.Success -> {
|
||||||
|
it.data?.let {ordersList ->
|
||||||
|
noData.hide()
|
||||||
|
|
||||||
|
dataView.show()
|
||||||
|
shimmer.hide()
|
||||||
|
|
||||||
|
loadMoreBtn.text = getString(R.string.load_more)
|
||||||
|
loadMoreBtn.setVisibility(!viewModel.lastPage)
|
||||||
|
|
||||||
|
if (adapter.currentList.isEmpty()){
|
||||||
|
adapter.submitList(ordersList)
|
||||||
|
}else{
|
||||||
|
adapter.notifyItemRangeInserted(
|
||||||
|
adapter.currentList.size,
|
||||||
|
ordersList.size
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.woka.home.mylist.view.fragments
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.lifecycle.ViewModelProvider
|
||||||
|
import com.woka.R
|
||||||
|
import com.woka.databinding.FragmentWebSeriesEngBinding
|
||||||
|
import com.woka.home.mylist.viewmodel.FavoriteViewModel
|
||||||
|
|
||||||
|
class WebSeriesEngFragment : Fragment() {
|
||||||
|
|
||||||
|
private lateinit var binding: FragmentWebSeriesEngBinding
|
||||||
|
private lateinit var viewModel: FavoriteViewModel
|
||||||
|
|
||||||
|
override fun onCreateView(
|
||||||
|
inflater: LayoutInflater, container: ViewGroup?,
|
||||||
|
savedInstanceState: Bundle?
|
||||||
|
): View {
|
||||||
|
binding = FragmentWebSeriesEngBinding.inflate(inflater, container, false)
|
||||||
|
viewModel = ViewModelProvider(requireActivity())[FavoriteViewModel::class.java]
|
||||||
|
return binding.root
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.woka.home.mylist.viewmodel
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import androidx.lifecycle.ViewModel
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import com.woka.database.models.clicks.ContentType
|
||||||
|
import com.woka.home.mylist.MyListRepository
|
||||||
|
import com.woka.home.mylist.models.MyListResponse
|
||||||
|
import com.woka.home.mylist.models.Result
|
||||||
|
import com.woka.networking.ApiResult
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
class FavoriteViewModel: ViewModel() {
|
||||||
|
|
||||||
|
var contentType: ContentType? = null
|
||||||
|
var webSeriesIsEnglish = false
|
||||||
|
|
||||||
|
private val _favoritesLiveData = MutableLiveData<ApiResult<MyListResponse>>()
|
||||||
|
val favoritesLiveData: LiveData<ApiResult<MyListResponse>>
|
||||||
|
get() = _favoritesLiveData
|
||||||
|
|
||||||
|
private val myListResponse = MyListResponse(Result(
|
||||||
|
mutableListOf(),
|
||||||
|
mutableListOf(),
|
||||||
|
mutableListOf(),
|
||||||
|
mutableListOf(),
|
||||||
|
mutableListOf()
|
||||||
|
))
|
||||||
|
|
||||||
|
private var nextPageToLoad: Int = 0
|
||||||
|
private var quantityPerPage: Int = 6
|
||||||
|
var lastPage = false
|
||||||
|
|
||||||
|
fun loadAudioSongs(contentType: ContentType) {
|
||||||
|
viewModelScope.launch {
|
||||||
|
_favoritesLiveData.postValue(ApiResult.Loading())
|
||||||
|
|
||||||
|
when (val value = MyListRepository.loadMyFavList()) {
|
||||||
|
is ApiResult.Error -> _favoritesLiveData.postValue(
|
||||||
|
ApiResult.Error(
|
||||||
|
value.errorMessage,
|
||||||
|
value.error
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
is ApiResult.Loading -> _favoritesLiveData.postValue(ApiResult.Loading())
|
||||||
|
is ApiResult.Success -> {
|
||||||
|
value.data?.let {
|
||||||
|
when (contentType){
|
||||||
|
ContentType.SERIES -> {
|
||||||
|
it.result?.show_data?.let { newList ->
|
||||||
|
|
||||||
|
myListResponse.result?.show_data?.addAll(newList)
|
||||||
|
|
||||||
|
lastPage = newList.size < quantityPerPage
|
||||||
|
|
||||||
|
_favoritesLiveData.postValue(ApiResult.Success(myListResponse))
|
||||||
|
nextPageToLoad++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ContentType.SEASON -> {}
|
||||||
|
ContentType.EPISODE -> {}
|
||||||
|
ContentType.VIDEO -> {}
|
||||||
|
ContentType.PAINT -> {}
|
||||||
|
ContentType.GAME -> {
|
||||||
|
it.result?.game_data?.let { newList ->
|
||||||
|
|
||||||
|
myListResponse.result?.game_data?.addAll(newList)
|
||||||
|
|
||||||
|
lastPage = newList.size < quantityPerPage
|
||||||
|
|
||||||
|
_favoritesLiveData.postValue(ApiResult.Success(myListResponse))
|
||||||
|
nextPageToLoad++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ContentType.AUDIO -> {
|
||||||
|
it.result?.audio_data?.let { newList ->
|
||||||
|
|
||||||
|
myListResponse.result?.audio_data?.addAll(newList)
|
||||||
|
|
||||||
|
lastPage = newList.size < quantityPerPage
|
||||||
|
|
||||||
|
_favoritesLiveData.postValue(ApiResult.Success(myListResponse))
|
||||||
|
nextPageToLoad++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ContentType.KARAOKE_VIDEO -> {
|
||||||
|
it.result?.sing_karaoke_data?.let { newList ->
|
||||||
|
|
||||||
|
myListResponse.result?.sing_karaoke_data?.addAll(newList)
|
||||||
|
|
||||||
|
lastPage = newList.size < quantityPerPage
|
||||||
|
|
||||||
|
_favoritesLiveData.postValue(ApiResult.Success(myListResponse))
|
||||||
|
nextPageToLoad++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ContentType.SHOP_PRODUCT -> {}
|
||||||
|
ContentType.PARENTAL_VIDEO -> {}
|
||||||
|
ContentType.ARTICLE -> {}
|
||||||
|
ContentType.LIVE_TV -> {}
|
||||||
|
ContentType.FM -> {}
|
||||||
|
ContentType.TEASER -> {}
|
||||||
|
ContentType.OTHERS -> {}
|
||||||
|
ContentType.HOME -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -69,19 +69,8 @@ object KaraokeRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun changeLikeLocally(id: String, isLiked: Boolean){
|
private fun changeLikeLocally(id: String, isLiked: Boolean){
|
||||||
// changing in fav list locally
|
// now, not handling data locally but setting flag to load the favorite list
|
||||||
MyListRepository.myFavData.result?.sing_karaoke_data?.let {
|
MyListRepository.setLoadNewDataFlag(true)
|
||||||
for (audioData in it){
|
|
||||||
if ("${audioData.id}" == id){
|
|
||||||
audioData.is_liked = isLiked
|
|
||||||
audioData.likes_count?.let { count ->
|
|
||||||
audioData.likes_count = if (isLiked) count + 1
|
|
||||||
else max(0, count - 1)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateFavShow(karaoke: KaraokeData, addToBookmark: Boolean){
|
fun updateFavShow(karaoke: KaraokeData, addToBookmark: Boolean){
|
||||||
@@ -105,14 +94,7 @@ object KaraokeRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MyListRepository.myFavData.result?.sing_karaoke_data?.let {favAudioData ->
|
MyListRepository.setLoadNewDataFlag(true)
|
||||||
karaoke.mark_as_favourite = addToBookmark
|
|
||||||
if (addToBookmark){
|
|
||||||
favAudioData.add(FavKaraokeData(karaoke))
|
|
||||||
}else{
|
|
||||||
favAudioData.removeIf{it.id == karaoke.id}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,19 +124,8 @@ object WebSeriesRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun changeLikeLocally(id: String, isLiked: Boolean){
|
private fun changeLikeLocally(id: String, isLiked: Boolean){
|
||||||
// changing in fav list locally
|
// now, not handling data locally but setting flag to load the favorite list
|
||||||
MyListRepository.myFavData.result?.show_data?.let {
|
MyListRepository.setLoadNewDataFlag(true)
|
||||||
for (show in it){
|
|
||||||
if ("${show.id}" == id){
|
|
||||||
show.is_liked = isLiked
|
|
||||||
show.likes_count?.let { count ->
|
|
||||||
show.likes_count = if (isLiked) count + 1
|
|
||||||
else max(0, count - 1)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateFavShow(showData: ShowData, addToBookmark: Boolean, categoryId: String){
|
fun updateFavShow(showData: ShowData, addToBookmark: Boolean, categoryId: String){
|
||||||
@@ -162,36 +151,7 @@ object WebSeriesRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MyListRepository.myFavData.result?.show_data?.let {
|
// now, not handling data locally but setting flag to load the favorite list
|
||||||
var found = false
|
MyListRepository.setLoadNewDataFlag(true)
|
||||||
var showFound: BookmarkedShowData? = null
|
|
||||||
|
|
||||||
for (show in it){
|
|
||||||
if (showData.id == show.id){
|
|
||||||
|
|
||||||
if (addToBookmark){
|
|
||||||
show.addAsBookMark(categoryId)
|
|
||||||
}else{
|
|
||||||
show.removeAsBookMark(categoryId)
|
|
||||||
}
|
|
||||||
|
|
||||||
showFound = show
|
|
||||||
found = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found && addToBookmark){
|
|
||||||
MyListRepository.myFavData.result?.show_data?.add(BookmarkedShowData(showData, categoryId))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (found){
|
|
||||||
showFound?.let {bookMarkShowData ->
|
|
||||||
if (!bookMarkShowData.isBookMarked()){
|
|
||||||
it.remove(bookMarkShowData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,19 +57,8 @@ object GamesRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun changeLikeLocally(id: String, isLiked: Boolean){
|
private fun changeLikeLocally(id: String, isLiked: Boolean){
|
||||||
// changing in fav list locally
|
// now, not handling data locally but setting flag to load the favorite list
|
||||||
MyListRepository.myFavData.result?.game_data?.let {
|
MyListRepository.setLoadNewDataFlag(true)
|
||||||
for (audioData in it){
|
|
||||||
if ("${audioData.id}" == id){
|
|
||||||
audioData.is_liked = isLiked
|
|
||||||
audioData.likes_count?.let { count ->
|
|
||||||
audioData.likes_count = if (isLiked) count + 1
|
|
||||||
else max(0, count - 1)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateFavShow(gameData: GameData, addToBookmark: Boolean){
|
fun updateFavShow(gameData: GameData, addToBookmark: Boolean){
|
||||||
@@ -93,13 +82,7 @@ object GamesRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MyListRepository.myFavData.result?.game_data?.let {favAudioData ->
|
// now, not handling data locally but setting flag to load the favorite list
|
||||||
gameData.mark_as_favourite = addToBookmark
|
MyListRepository.setLoadNewDataFlag(true)
|
||||||
if (addToBookmark){
|
|
||||||
favAudioData.add(FavGameData(gameData))
|
|
||||||
}else{
|
|
||||||
favAudioData.removeIf{it.id == gameData.id}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
79
app/src/main/res/layout/activity_favorites.xml
Normal file
79
app/src/main/res/layout/activity_favorites.xml
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<androidx.constraintlayout.widget.ConstraintLayout 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="#D3EFF8"
|
||||||
|
tools:context=".shop.views.MyOrdersActivity">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/toolbar_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:paddingEnd="5dp"
|
||||||
|
android:paddingStart="15dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/back_btn"
|
||||||
|
android:layout_width="@dimen/_25sdp"
|
||||||
|
android:layout_height="@dimen/_25sdp"
|
||||||
|
android:contentDescription="@string/image"
|
||||||
|
android:src="@drawable/ic_arrow_back_full"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
app:tint="@color/black"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:fontFamily="@font/exo_2_bold"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/_14ssp"
|
||||||
|
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
|
||||||
|
android:layout_toEndOf="@id/back_btn"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.fragment.app.FragmentContainerView
|
||||||
|
android:id="@+id/fc_favorites"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/toolbar_view"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/g1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintGuide_percent="0.7"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:contentDescription="@string/image"
|
||||||
|
android:src="@drawable/img_my_orders_ng"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/g1"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
119
app/src/main/res/layout/fragment_web_series_eng.xml
Normal file
119
app/src/main/res/layout/fragment_web_series_eng.xml
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
<androidx.constraintlayout.widget.ConstraintLayout 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="@android:color/transparent"
|
||||||
|
tools:context=".shop.views.MyOrdersActivity">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/no_data"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:contentDescription="@string/image"
|
||||||
|
android:src="@drawable/img_support"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/no_data_txt"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:text="@string/no_orders_found"
|
||||||
|
android:fontFamily="@font/exo_2_bold"
|
||||||
|
android:textColor="@color/color_primary"
|
||||||
|
android:textSize="@dimen/_14ssp"
|
||||||
|
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:id="@+id/data_view"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:translationZ="1dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
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"
|
||||||
|
tools:listitem="@layout/show_view_holder"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<com.facebook.shimmer.ShimmerFrameLayout
|
||||||
|
android:id="@+id/shimmer"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:shimmer_auto_start="true"
|
||||||
|
app:shimmer_duration="1500"
|
||||||
|
app:shimmer_highlight_alpha="0.5"
|
||||||
|
>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/load_more_btn"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:text="@string/load_more"
|
||||||
|
android:fontFamily="@font/exo_2_bold"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/_12ssp"
|
||||||
|
|
||||||
|
android:paddingHorizontal="25dp"
|
||||||
|
android:layout_marginVertical="15dp"
|
||||||
|
|
||||||
|
android:background="@drawable/round_25"
|
||||||
|
android:backgroundTint="@color/night_status"
|
||||||
|
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -36,7 +36,6 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
tools:text="Woka title of show"
|
|
||||||
android:fontFamily="@font/exo_2_bold"
|
android:fontFamily="@font/exo_2_bold"
|
||||||
android:textColor="@color/color_primary"
|
android:textColor="@color/color_primary"
|
||||||
android:textSize="@dimen/_12ssp"
|
android:textSize="@dimen/_12ssp"
|
||||||
|
|||||||
Reference in New Issue
Block a user