From 5a19c1bf4d56ae13962b62d9c7d211a91c7dc31e Mon Sep 17 00:00:00 2001 From: LagradOst <11805592+LagradOst@users.noreply.github.com> Date: Wed, 27 Apr 2022 21:48:27 +0200 Subject: [PATCH] hopefully fixed ocean-21 --- .../syncproviders/providers/AniListApi.kt | 7 ++++--- .../cloudstream3/ui/home/HomeChildItemAdapter.kt | 2 +- .../cloudstream3/ui/search/SearchResultBuilder.kt | 2 +- app/src/main/res/layout/fragment_home.xml | 1 + app/src/main/res/layout/home_result_big_grid.xml | 5 +++-- app/src/main/res/layout/home_result_grid.xml | 2 +- app/src/main/res/layout/home_result_grid_expanded.xml | 2 +- app/src/main/res/layout/options_popup_tv.xml | 2 +- app/src/main/res/layout/search_result_compact.xml | 2 +- app/src/main/res/layout/search_result_grid.xml | 2 +- .../main/res/layout/search_result_grid_expanded.xml | 11 +++-------- .../main/res/layout/search_result_super_compact.xml | 2 +- 12 files changed, 19 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/AniListApi.kt b/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/AniListApi.kt index b7398d05..94aabe21 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/AniListApi.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/syncproviders/providers/AniListApi.kt @@ -70,7 +70,7 @@ class AniListApi(index: Int) : AccountManager(index), SyncAPI { return user != null } - override fun getIdFromUrl(url : String): String { + override fun getIdFromUrl(url: String): String { return url.removePrefix("$mainUrl/anime/").removeSuffix("/") } @@ -746,8 +746,8 @@ class AniListApi(index: Int) : AccountManager(index), SyncAPI { } }""" val data = postApi(q) - if (data == "") return null - val userData = mapper.readValue(data ?: return null) + if (data.isNullOrBlank()) return null + val userData = mapper.readValue(data) val u = userData.data?.Viewer val user = AniListUser( u?.id, @@ -823,6 +823,7 @@ class AniListApi(index: Int) : AccountManager(index), SyncAPI { //@JsonProperty("rating") val rating: Int, @JsonProperty("node") val node: Recommendation, ) + data class Recommendation( @JsonProperty("mediaRecommendation") val mediaRecommendation: SeasonMedia, ) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeChildItemAdapter.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeChildItemAdapter.kt index 9ff54b20..b320ac05 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeChildItemAdapter.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/home/HomeChildItemAdapter.kt @@ -92,7 +92,7 @@ class HomeChildItemAdapter( itemView.tag = position if (position == 0) { // to fix tv - itemView.backgroundCard?.nextFocusLeftId = R.id.nav_rail_view + itemView.background_card?.nextFocusLeftId = R.id.nav_rail_view } //val ani = ScaleAnimation(0.9f, 1.0f, 0.9f, 1f) //ani.fillAfter = true diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchResultBuilder.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchResultBuilder.kt index 3d2f4c59..806ef07c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchResultBuilder.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchResultBuilder.kt @@ -35,7 +35,7 @@ object SearchResultBuilder { val textIsSub: TextView? = itemView.text_is_sub val textQuality: TextView? = itemView.text_quality - val bg: CardView = itemView.backgroundCard + val bg: CardView = itemView.background_card val bar: ProgressBar? = itemView.watchProgress val playImg: ImageView? = itemView.search_item_download_play diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 3d017579..4abdef0b 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -198,6 +198,7 @@ android:layout_height="40dp"> + + android:background="@drawable/type_bg_color" />