QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

以下内容为反编译后的 HeaderBgItemDataHolder.java 源代码,内容仅作参考


package com.tencent.mtt.browser.account.loginedit;

import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import androidx.recyclerview.widget.RecyclerView;
import com.tencent.luggage.wxa.co.a;
import com.tencent.mtt.R;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
import com.tencent.mtt.browser.account.loginedit.AccountHeaderDefaultNativePage;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.nxeasy.listview.base.ItemDataHolder;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import qb.a.f;

public class HeaderBgItemDataHolder extends ItemDataHolder<View> {

    private AccountHeaderDefaultNativePage.HeaderBgBean f34755a;

    public HeaderBgItemDataHolder(AccountHeaderDefaultNativePage.HeaderBgBean headerBgBean) {
        this.f34755a = headerBgBean;
    }

    public void a(boolean z) {
        this.f34755a.f34754b = z;
    }

    public boolean a() {
        return this.f34755a.f34754b;
    }

    public String b() {
        return this.f34755a.f34753a;
    }

    @Override
    public void bindDataToView(View view) {
        QBWebImageView qBWebImageView = (QBWebImageView) view.findViewById(R.id.account_header_bg);
        ImageView imageView = (ImageView) view.findViewById(R.id.account_header_bg_checkbox);
        AccountHeaderDefaultNativePage.HeaderBgBean headerBgBean = this.f34755a;
        if (headerBgBean != null && qBWebImageView != null && imageView != null) {
            SimpleSkinBuilder.a(imageView).g(headerBgBean.f34754b ? R.drawable.abf : R.drawable.abd).f();
            String str = !TextUtils.isEmpty(this.f34755a.f34753a) ? this.f34755a.f34753a : "https://kd.qpic.cn/common/test/ugc_3dc7a068.png";
            qBWebImageView.setScaleType(ImageView.ScaleType.FIT_XY);
            qBWebImageView.setRadius(MttResources.g(f.e));
            qBWebImageView.setUrl(str);
        }
        view.setOnClickListener(this);
    }

    @Override
    public View createItemView(Context context) {
        View inflate = LayoutInflater.from(context).inflate(R.layout.a2, (ViewGroup) null);
        inflate.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
        return inflate;
    }

    @Override
    public int getBottomMargin(int i) {
        return MttResources.s(6);
    }

    @Override
    public int getItemHeight() {
        return MttResources.s(a.CTRL_INDEX);
    }

    @Override
    public long getItemId() {
        return this.position;
    }

    @Override
    public RecyclerView.LayoutParams getLayoutParams(RecyclerView.LayoutParams layoutParams, int i, int i2) {
        RecyclerView.LayoutParams layoutParams2 = super.getLayoutParams(layoutParams, i, i2);
        layoutParams2.width = -1;
        return layoutParams2;
    }

    @Override
    protected int getLeftMargin(int i) {
        return MttResources.s(12);
    }

    @Override
    protected int getRightMargin(int i) {
        return MttResources.s(12);
    }

    @Override
    public int getTopMargin(int i) {
        return MttResources.s(6);
    }

    @Override
    public void onClick(View view) {
        EventCollector.getInstance().onViewClickedBefore(view);
        if (this.itemContext == null || this.itemContext.f68742b == null) {
            super.onClick(view);
        } else {
            this.itemContext.f68742b.a(view.getId(), this);
        }
        EventCollector.getInstance().onViewClicked(view);
    }
}