package Ġpw . j any o . wh atan ime . ui . adapter Ċ Ċ import Ġandroid . content . Context Ċ import Ġco il . api . load Ċ import Ġcom . google . android . material . dialog . Material AlertDialog Builder Ċ import Ġpw . j any o . wh atan ime . R Ċ import Ġpw . j any o . wh atan ime . config . to Custom Tabs Ċ import Ġpw . j any o . wh atan ime . constant . Constant Ċ import Ġpw . j any o . wh atan ime . databinding . Item SearchResult Binding Ċ import Ġpw . j any o . wh atan ime . handler . Main Item Listener Ċ import Ġpw . j any o . wh atan ime . model . Docs Ċ import Ġv ip . m yst ery 0 . tools . base . binding . Base Binding RecyclerView Adapter Ċ import Ġv ip . m yst ery 0 . tools . utils . format Time Ċ import Ġjava . net . URL Encoder Ċ import Ġjava . text . Decimal Format Ċ Ċ class ĠMain Recycler Adapter ( private Ġval Ġcontext : ĠContext , ĊĉĉĉĉĉĉĠ Ġprivate Ġval Ġlistener : ĠMain Item Listener ) Ġ: ĠBase Binding RecyclerView Adapter < Docs , ĠItem SearchResult Binding >( R . layout . item _ search _ result ) Ġ{ Ċ ĉ override Ġfun Ġset Item View ( binding : ĠItem SearchResult Binding , Ġposition : ĠInt , Ġdata : ĠDocs ) Ġ{ Ċĉ ĉ binding . handler Ġ= Ġlistener Ċĉ ĉ binding . animation Docs Ġ= Ġdata Ċĉ ĉ val Ġrequest Url Ġ= Ġ"${ Constant . baseUrl } thumbnail . php ? an il ist _ id =" Ġ+ Ġdata . an il ist _ id Ġ+ Ġ"& file =" Ġ+ ĠURL Encoder . encode ( data . filename , Ġ" UTF - 8 ") Ġ+ Ġ"& t =" Ġ+ Ġdata . at Ġ+ Ġ"& token =" Ġ+ Ġdata . tok enth umb Ċĉ ĉ binding . imageView . load ( request Url ) Ġ{ Ċĉĉ ĉ placeholder ( R . mip map . j any o _ studio ) Ċĉĉ ĉ error ( R . drawable . ic _ load _ failed ) Ċĉ ĉ } Ċĉ ĉ val Ġnative Title Ġ= Ġ"${ context . getString ( R . string . hint _ title _ native )} ${ data . title _ native }" Ċĉ ĉ val Ġch inese Title Ġ= Ġ"${ context . getString ( R . string . hint _ title _ chinese )} ${ data . title _ chinese }" Ċĉ ĉ val Ġenglish Title Ġ= Ġ"${ context . getString ( R . string . hint _ title _ english )} ${ data . title _ english }" Ċĉ ĉ val Ġrom aji Title Ġ= Ġ"${ context . getString ( R . string . hint _ title _ rom aji )} ${ data . title _ rom aji }" Ċĉ ĉ binding . textView Title Native . text Ġ= Ġnative Title Ċĉ ĉ binding . textView Title Chinese . text Ġ= Ġch inese Title Ċĉ ĉ binding . textView Title English . text Ġ= Ġenglish Title Ċĉ ĉ binding . textView Title Rom aji . text Ġ= Ġrom aji Title Ċĉ ĉ binding . textView Time . text Ġ= Ġ( data . at . to Long () Ġ* Ġ 1 0 0 0 ). format Time () Ċĉ ĉ binding . textView An i List Id . text Ġ= Ġdata . an il ist _ id . toString () Ċĉ ĉ binding . textView Mal Id . text Ġ= Ġdata . mal _ id . toString () Ċĉ ĉ val Ġsimilarity Ġ= Ġ"${ Decimal Format ("# . 0 0 0 "). format ( data . similarity Ġ* Ġ 1 0 0 )} %" Ċĉ ĉ binding . textView Similarity . text Ġ= Ġsimilarity Ċĉ ĉ binding . card View . setOnClickListener Ġ{ Ċĉĉ ĉ Material AlertDialog Builder ( context ) Ċĉĉĉĉ ĉ . setTitle ( context . getString ( R . string . hint _ show _ animation _ detail , Ġdata . title _ native )) Ċĉĉĉĉ ĉ . set Positive Button ( android . R . string . ok ) Ġ{ Ġ_, Ġ_ Ġ-> Ċĉĉĉĉĉ ĉ context . to Custom Tabs (" https :// an il ist . co / anime /${ data . an il ist _ id }") Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ . set Negative Button ( android . R . string . cancel , Ġnull ) Ċĉĉĉĉ ĉ . show () Ċĉ ĉ } Ċ ĉ } Ċ }