package com.duolebo.blyrobot.ui

import android.content.Context
import android.graphics.drawable.Drawable
import android.view.LayoutInflater
import android.widget.RelativeLayout
import com.duolebo.blyrobot.R
import com.duolebo.blyrobot.data.ApkInfo
import kotlinx.android.synthetic.main.app_config_item.view.*

class AppConfigListItem(context: Context?) : RelativeLayout(context) {

    init {
        LayoutInflater.from(context).inflate(R.layout.app_config_item, this)
    }

    fun setData(apkInfo: ApkInfo) {
        this.appName.text = apkInfo.name
        this.packageName.text = apkInfo.packageName
    }

    fun setIcon(drawable: Drawable) {
        this.appIcon.setImageDrawable(drawable)
    }
}