Teapod is a unofficial App for Crunchyroll
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB

package org.mosad.teapod.util
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.ImageView
import android.widget.TextView
import com.bumptech.glide.Glide
import org.mosad.teapod.R
class CustomAdapter(context: Context, private val layoutInflater: LayoutInflater, private val media: ArrayList<GUIMedia>) : ArrayAdapter<GUIMedia>(context, R.layout.linear_media) {
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
println("view")
return if (convertView == null) {
val guiMedia = layoutInflater.inflate(R.layout.linear_media, null)
val textTitle = guiMedia.findViewById<TextView>(R.id.text_title)
val imagePoster = guiMedia.findViewById<ImageView>(R.id.image_poster)
textTitle.text = media[position].title
Glide.with(context).load(media[position].imageLink).into(imagePoster)
guiMedia
} else {
convertView
}
}
}

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close