This commit is contained in:
LagradOst 2021-05-19 16:43:08 +02:00
parent 379a3f2fe6
commit d0fbf5a782
5 changed files with 30 additions and 24 deletions

View file

@ -47,6 +47,9 @@ class ShiroProvider : MainAPI() {
override val mainUrl: String override val mainUrl: String
get() = "https://shiro.is" get() = "https://shiro.is"
override val name: String
get() = "Shiro"
data class ShiroSearchResponseShow( data class ShiroSearchResponseShow(
@JsonProperty("image") val image: String, @JsonProperty("image") val image: String,
@JsonProperty("_id") val _id: String, @JsonProperty("_id") val _id: String,
@ -150,7 +153,7 @@ class ShiroProvider : MainAPI() {
val episodeCount = i.episodeCount.toInt() val episodeCount = i.episodeCount.toInt()
returnValue.add(AnimeSearchResponse( returnValue.add(AnimeSearchResponse(
i.english ?: i.canonicalTitle, i.name.replace("Dubbed",""), // i.english ?: i.canonicalTitle,
"$mainUrl/${i.slug}", "$mainUrl/${i.slug}",
i.slug, i.slug,
this.name, this.name,

View file

@ -64,10 +64,10 @@ class SearchAdapter(
val cardView: ImageView = itemView.imageView val cardView: ImageView = itemView.imageView
val cardText: TextView = itemView.imageText val cardText: TextView = itemView.imageText
val text_type: TextView? = itemView.text_type val text_type: TextView? = itemView.text_type
val search_result_lang: ImageView? = itemView.search_result_lang // val search_result_lang: ImageView? = itemView.search_result_lang
/*
val text_is_dub: View? = itemView.text_is_dub val text_is_dub: View? = itemView.text_is_dub
val text_is_sub: View? = itemView.text_is_sub*/ val text_is_sub: View? = itemView.text_is_sub
//val cardTextExtra: TextView? = itemView.imageTextExtra //val cardTextExtra: TextView? = itemView.imageTextExtra
//val imageTextProvider: TextView? = itemView.imageTextProvider //val imageTextProvider: TextView? = itemView.imageTextProvider
@ -92,10 +92,10 @@ class SearchAdapter(
TvType.ONA -> "ONA" TvType.ONA -> "ONA"
TvType.TvSeries -> "TV" TvType.TvSeries -> "TV"
} }
search_result_lang?.visibility = View.GONE // search_result_lang?.visibility = View.GONE
/*
text_is_dub?.visibility = View.GONE text_is_dub?.visibility = View.GONE
text_is_sub?.visibility = View.GONE*/ text_is_sub?.visibility = View.GONE
cardText.text = card.name cardText.text = card.name
@ -116,12 +116,13 @@ class SearchAdapter(
when (card) { when (card) {
is AnimeSearchResponse -> { is AnimeSearchResponse -> {
if (card.dubStatus?.size == 1) { if (card.dubStatus?.size == 1) {
search_result_lang?.visibility = View.VISIBLE //search_result_lang?.visibility = View.VISIBLE
if (card.dubStatus.contains(DubStatus.HasDub)) { if (card.dubStatus.contains(DubStatus.HasDub)) {
search_result_lang?.setColorFilter(ContextCompat.getColor(activity, R.color.dubColor)) text_is_dub?.visibility = View.VISIBLE
//search_result_lang?.setColorFilter(ContextCompat.getColor(activity, R.color.dubColor))
} else if (card.dubStatus.contains(DubStatus.HasSub)) { } else if (card.dubStatus.contains(DubStatus.HasSub)) {
search_result_lang?.setColorFilter(ContextCompat.getColor(activity, R.color.subColor)) //search_result_lang?.setColorFilter(ContextCompat.getColor(activity, R.color.subColor))
// text_is_sub?.visibility = View.VISIBLE text_is_sub?.visibility = View.VISIBLE
} }
} }
} }

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/dubColor"/> <solid android:color="@color/dubColorBg"/>
<corners android:radius="@dimen/roundedImageRadius"/> <corners android:radius="@dimen/roundedImageRadius"/>
<stroke android:color="@color/dubColor" android:width="1dp"/> <stroke android:color="@color/dubColor" android:width="2dp"/>
</shape> </shape>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/subColor"/> <solid android:color="@color/subColorBg"/>
<corners android:radius="@dimen/roundedImageRadius"/> <corners android:radius="@dimen/roundedImageRadius"/>
<stroke android:color="@color/subColor" android:width="1dp"/> <stroke android:color="@color/subColor" android:width="2dp"/>
</shape> </shape>

View file

@ -79,7 +79,7 @@
android:alpha="0.9"> android:alpha="0.9">
</View>--> </View>-->
<ImageView <!--<ImageView
android:src="@drawable/ic_baseline_bookmark_24" android:src="@drawable/ic_baseline_bookmark_24"
android:id="@+id/search_result_lang" android:id="@+id/search_result_lang"
android:layout_gravity="right" android:layout_gravity="right"
@ -87,20 +87,22 @@
android:layout_marginRight="-6.5dp" android:layout_marginRight="-6.5dp"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp"> android:layout_height="30dp">
</ImageView> </ImageView>-->
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_gravity="end" android:layout_gravity="end"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<!-- <!--
<ImageView android:id="@+id/text_is_dub" android:tint="@color/colorPrimary" android:src="@drawable/ic_baseline_subtitles_24" android:layout_width="wrap_content" android:layout_height="20dp"> <ImageView android:id="@+id/text_is_dub" android:tint="@color/colorPrimary"
android:src="@drawable/ic_baseline_subtitles_24" android:layout_width="wrap_content"
android:layout_height="20dp">
</ImageView> </ImageView>-->
<TextView <TextView
android:text="Dub" android:text="Dub"
android:id="@+id/_text_is_dub" android:id="@+id/text_is_dub"
android:textColor="@color/textColor" android:textColor="@color/textColor"
android:paddingRight="10dp" android:paddingRight="10dp"
android:paddingLeft="10dp" android:paddingLeft="10dp"
@ -125,9 +127,9 @@
android:minWidth="50dp" android:minWidth="50dp"
android:gravity="center" android:gravity="center"
android:background="@drawable/sub_bg_color" android:background="@drawable/sub_bg_color"
android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_width="wrap_content" android:layout_height="wrap_content"
android:baselineAligned="false"> >
</TextView>--> </TextView>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>