package com.gh.common.provider

import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import com.gh.common.databind.BindingAdapters
import com.gh.gamecenter.common.databinding.LayoutGameItemSellingPointBinding
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.provider.IBindingAdaptersProvider
import com.gh.gamecenter.home.custom.adapter.CustomViewExt

@com.therouter.inject.ServiceProvider
class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
    override fun setGameName(
        view: TextView,
        game: GameEntity,
        isShowPlatform: Boolean,
    ) {
        BindingAdapters.setGameName(view, game, isShowPlatform)
    }

    override fun setGameTags(layout: LinearLayout, gameEntity: GameEntity) {
        BindingAdapters.setGameTags(layout, gameEntity, "")
    }

    override fun setMessageUnread(view: TextView, unreadCount: Int) {
        BindingAdapters.setMessageUnread(view, unreadCount)
    }

    override fun setGame(view: View, gameEntity: GameEntity) {
        BindingAdapters.setGame(view, gameEntity)
    }

    override fun setGameTagsWithSellingPoints(
        layout: LinearLayout,
        sellingPointsBinding: LayoutGameItemSellingPointBinding,
        gameEntity: GameEntity,
        subjectTag: String
    ) {
        BindingAdapters.setGameTagsWithSellingPoint(layout, sellingPointsBinding, gameEntity, subjectTag)
    }

    override fun setGameDescription(tvDesc: TextView, briefStyle: String, game: GameEntity) {
        CustomViewExt.setDescription(tvDesc, briefStyle, game)
    }
}