QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 ContentItemNovel.java 源代码,内容仅作参考
package com.tencent.mtt.browser.history.components;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.cardview.widget.CardView;
import com.tencent.common.featuretoggle.FeatureToggle;
import com.tencent.mtt.R;
import com.tencent.mtt.browser.bookmark.ui.newstyle.BMHisReportHelper;
import com.tencent.mtt.browser.history.IHistoryModel;
import com.tencent.mtt.browser.history.newstyle.fastcut.HistoryFastCutItem;
import com.tencent.mtt.browser.history.util.HistoryUtil;
import com.tencent.mtt.browser.homepage.fastcut.IFastCutManager;
import com.tencent.mtt.browser.report.ReportHelperForHistory;
import com.tencent.mtt.browser.search.history.common.ReportHelperForHistorySearch;
import com.tencent.mtt.browser.setting.manager.SkinManager;
import com.tencent.mtt.favnew.inhost.newstyle.FavUtils;
import com.tencent.mtt.favnew.inhost.view.FavWebImageView;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.view.common.QBTextView;
import qb.fav.BuildConfig;
public class ContentItemNovel extends ContentItemBase {
QBTextView k;
QBTextView l;
FavWebImageView m;
QBTextView n;
QBTextView o;
CardView p;
CardView q;
public ContentItemNovel(Context context) {
this(context, null);
}
public ContentItemNovel(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
public void a(IHistoryModel iHistoryModel, boolean z) {
IFastCutManager iFastCutManager;
this.h = z;
setHistory(iHistoryModel);
if (z && this.g != null && (iFastCutManager = (IFastCutManager) QBContext.getInstance().getService(IFastCutManager.class)) != null) {
this.g.setVisibility(0);
FavUtils.a(this.g, iFastCutManager.hasExist(new HistoryFastCutItem(iHistoryModel)));
}
if (this.f) {
this.q.setVisibility(0);
} else {
this.q.setVisibility(8);
}
}
@Override
public void b() {
if (!FeatureToggle.a(BuildConfig.FEATURE_TOGGLE_868712883)) {
ReportHelperForHistory.a(this.e, this.f38907d);
if (this.f38906c != null) {
if (this.f) {
ReportHelperForHistorySearch.a(this.f38906c.getUrl());
} else {
BMHisReportHelper.c(4, this.f38906c.getUrl(), this.h, this.j);
}
}
}
if (this.f38904a != null) {
this.f38904a.a();
}
}
@Override
public View c() {
View inflate = LayoutInflater.from(this.f38905b).inflate(R.layout.j_, (ViewGroup) this, true);
this.g = (ImageView) findViewById(R.id.iv_fastcut_add);
this.q = (CardView) inflate.findViewById(R.id.history_type_background);
this.k = (QBTextView) findViewById(R.id.tv_fav_content);
this.l = (QBTextView) findViewById(R.id.tv_fav_author);
this.m = (FavWebImageView) findViewById(R.id.iv_fav_image);
this.m.setEnableNoPicMode(true);
this.o = (QBTextView) findViewById(R.id.tv_fav_type);
this.n = (QBTextView) findViewById(R.id.tv_fav_subtitle);
this.p = (CardView) findViewById(R.id.iv_fav_image_wrapView);
return inflate;
}
@Override
public void onSkinChange() {
FavWebImageView favWebImageView;
int i;
if (SkinManager.s().l()) {
favWebImageView = this.m;
i = 153;
} else {
favWebImageView = this.m;
i = 255;
}
favWebImageView.setImageAlpha(i);
}
@Override
public void setHistory(IHistoryModel iHistoryModel) {
if (iHistoryModel == null) {
return;
}
if (this.f38906c == null || !HistoryUtil.a(this.f38906c, iHistoryModel)) {
this.f38906c = iHistoryModel;
String title = this.f38906c.getTitle();
String iconUrl = this.f38906c.getIconUrl();
String author = this.f38906c.getAuthor();
String subtitle = this.f38906c.getSubtitle();
int type = this.f38906c.getType();
this.f38907d = HistoryUtil.b(type);
this.e = new ReportHelperForHistory.HistoryItemEntry(this.f38906c.getUrl(), this.f38906c.getTime());
if (TextUtils.isEmpty(iconUrl)) {
this.m.setUrl("https://m4.publicimg.browser.qq.com/publicimg/nav/fav/default/collect_content_novel_default.png");
} else {
this.m.setVisibility(0);
this.m.setUrl(iconUrl);
}
this.k.setText(title);
if (TextUtils.isEmpty(author)) {
this.l.setVisibility(8);
} else {
this.l.setVisibility(0);
this.l.setText(author);
this.l.requestLayout();
}
if (this.n != null) {
if (TextUtils.isEmpty(subtitle)) {
this.n.setVisibility(8);
} else {
this.n.setVisibility(0);
this.n.setText(subtitle);
}
this.n.requestLayout();
this.n.invalidate();
}
if (this.o != null) {
this.o.setText(HistoryUtil.a(type));
this.o.requestLayout();
this.o.invalidate();
}
}
}
}