柬埔寨通 v6.1.5版本的 MD5 值为:9b68581ac30883219d6a25858a099d6b
以下内容为反编译后的 ShowTopicHeadTwoDataView.java 源代码,内容仅作参考
package net.duohuo.magappx.circle.show.dataview;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.BindViews;
import butterknife.OnClick;
import com.jianpuzhaitong.forum.R;
import java.util.List;
import net.duohuo.core.build.UrlSchemeProxy;
import net.duohuo.core.dataview.DataView;
import net.duohuo.core.fresco.FrescoImageView;
import net.duohuo.core.util.IUtil;
import net.duohuo.core.util.SafeJsonUtil;
import net.duohuo.magappx.MagBizWebView;
import net.duohuo.magappx.circle.show.model.TopicInfo;
import net.duohuo.magappx.circle.show.model.TopicUser;
import net.duohuo.magappx.common.util.Constants;
import net.duohuo.magappx.common.util.SplitArrayUtil;
public class ShowTopicHeadTwoDataView extends DataView<TopicInfo> {
@BindView(R.id.animate_box)
View animateBoxV;
@BindView(R.id.box_sponsor_merchant)
LinearLayout boxSponsorMerchant;
@BindView(R.id.style2)
View boxStyle2;
@BindView(R.id.box_win_user)
LinearLayout boxWinUser;
@BindView(R.id.contentbox)
View contentBoxV;
int displayWidth;
@BindView(R.id.dynamicCount)
TextView dynamicCountV;
@BindView(R.id.headBg)
FrescoImageView headBgV;
@BindView(R.id.head)
FrescoImageView headV;
@BindView(R.id.infomation)
TextView infomationV;
@BindView(R.id.initiatorName)
TextView initiatorNameV;
@BindView(R.id.initiator)
FrescoImageView initiatorV;
@BindView(R.id.line)
View lineV;
boolean loadFinished;
@BindView(R.id.participant_box)
LinearLayout participantBoxV;
@BindView(R.id.participantCount)
TextView participantCountV;
@BindViews({R.id.participant_one, R.id.participant_second, R.id.participant_third, R.id.participant_fourth})
FrescoImageView[] participantVs;
@BindView(R.id.shadow_style2)
View shadowStyle2V;
@BindView(R.id.sponsorMerchant_label)
View sponsorMerchantLabel;
@BindView(R.id.titleStyle2)
TextView titleStyle2V;
@BindView(R.id.topicTitle)
TextView topicTitleV;
@BindView(R.id.watchCount)
TextView watchCountV;
@BindView(R.id.webView)
MagBizWebView webView;
@BindView(R.id.winuser_label)
View winuserLabel;
public void initWebView() {
}
public ShowTopicHeadTwoDataView(Context context) {
super(context);
this.displayWidth = 500;
this.loadFinished = false;
setView(LayoutInflater.from(context).inflate(R.layout.show_topic_head_two, (ViewGroup) null));
this.displayWidth = IUtil.getDisplayWidth();
initWebView();
}
@Override
public void bindView(TopicInfo topicInfo) {
if (topicInfo == null) {
return;
}
boolean equals = "1".equals(topicInfo.getTopic_style());
this.contentBoxV.setVisibility(equals ? 0 : 8);
this.lineV.setVisibility(equals ? 0 : 8);
this.boxStyle2.setVisibility(equals ? 8 : 0);
this.titleStyle2V.setVisibility(equals ? 8 : 0);
this.shadowStyle2V.setVisibility(equals ? 8 : 0);
if (!equals) {
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) this.webView.getLayoutParams();
layoutParams.setMargins(0, 0, 0, 0);
this.webView.setLayoutParams(layoutParams);
}
if (!TextUtils.isEmpty(topicInfo.getCoverPicTburl())) {
RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.headBgV.getLayoutParams();
layoutParams2.width = this.displayWidth;
layoutParams2.height = (this.displayWidth * 276) / 640;
this.headBgV.setLayoutParams(layoutParams2);
this.headBgV.loadView(topicInfo.getCoverPicTburl(), R.color.grey_bg);
} else {
if (equals) {
this.headBgV.setVisibility(8);
}
LinearLayout.LayoutParams layoutParams3 = (LinearLayout.LayoutParams) this.contentBoxV.getLayoutParams();
layoutParams3.setMargins(0, 0, 0, 0);
this.contentBoxV.setLayoutParams(layoutParams3);
}
this.headV.loadView(topicInfo.getIconTburl(), R.color.image_def);
this.headV.asCircle(IUtil.dip2px(this.context, 2.0f));
this.topicTitleV.setText("#" + topicInfo.getName() + "#");
this.titleStyle2V.setText("#" + topicInfo.getName() + "#");
this.watchCountV.setText(topicInfo.getWatchCount());
this.participantCountV.setText(topicInfo.getParticipationCount());
this.dynamicCountV.setText(topicInfo.getDynamicCount());
this.infomationV.setText(topicInfo.getWatchCount() + "围观 | " + topicInfo.getParticipationCount() + "参与 | " + topicInfo.getDynamicCount() + "动态");
boolean z = SafeJsonUtil.getBoolean(topicInfo.getSponsor_merchant(), "is_show");
this.boxSponsorMerchant.setVisibility(z ? 0 : 8);
this.sponsorMerchantLabel.setVisibility(z ? 0 : 8);
if (z) {
List parseList = SafeJsonUtil.parseList(SafeJsonUtil.getString(topicInfo.getSponsor_merchant(), Constants.PAGE_INFO), TopicUser.class);
if (parseList.size() > 0) {
List list = SplitArrayUtil.getInstance().getList(parseList, 2);
this.boxSponsorMerchant.removeAllViews();
for (int i = 0; i < list.size(); i++) {
LinearLayout linearLayout = new LinearLayout(this.context);
linearLayout.setOrientation(0);
for (int i2 = 0; i2 < ((List) list.get(i)).size(); i2++) {
TopicWinUserDataView topicWinUserDataView = new TopicWinUserDataView(this.context, parseList.size());
topicWinUserDataView.setData((TopicUser) ((List) list.get(i)).get(i2));
linearLayout.addView(topicWinUserDataView.getRootView());
}
this.boxSponsorMerchant.addView(linearLayout);
}
}
}
boolean z2 = SafeJsonUtil.getBoolean(topicInfo.getWin_user(), "is_show");
this.boxWinUser.setVisibility(z2 ? 0 : 8);
this.winuserLabel.setVisibility(z2 ? 0 : 8);
if (z2) {
List parseList2 = SafeJsonUtil.parseList(SafeJsonUtil.getString(topicInfo.getWin_user(), Constants.PAGE_INFO), TopicUser.class);
if (parseList2.size() > 0) {
List list2 = SplitArrayUtil.getInstance().getList(parseList2, 2);
this.boxWinUser.removeAllViews();
for (int i3 = 0; i3 < list2.size(); i3++) {
LinearLayout linearLayout2 = new LinearLayout(this.context);
linearLayout2.setOrientation(0);
for (int i4 = 0; i4 < ((List) list2.get(i3)).size(); i4++) {
TopicWinUserDataView topicWinUserDataView2 = new TopicWinUserDataView(this.context, parseList2.size());
topicWinUserDataView2.setData((TopicUser) ((List) list2.get(i3)).get(i4));
linearLayout2.addView(topicWinUserDataView2.getRootView());
}
this.boxWinUser.addView(linearLayout2);
}
}
}
bindInitiator(topicInfo, equals);
if (topicInfo.getInitiatorUser() != null) {
this.initiatorV.loadView(topicInfo.getInitiatorUser().getHead(), R.drawable.default_avatar, (Boolean) true);
this.initiatorNameV.setText(topicInfo.getInitiatorUser().getName());
} else {
this.animateBoxV.setVisibility(8);
}
if (TextUtils.isEmpty(topicInfo.getActivityRules())) {
return;
}
this.webView.setVisibility(0);
this.webView.loadDataWithBaseURL("https://app.jpztong.com/", topicInfo.getActivityRules(), "text/html", "utf-8", null);
}
public void bindInitiator(TopicInfo topicInfo, boolean z) {
int i = z ? 4 : 3;
List<TopicInfo.UserListBean> userList = topicInfo.getUserList();
if (userList != null) {
if (userList.size() <= i) {
i = userList.size();
}
for (int i2 = 0; i2 < i; i2++) {
if (z) {
this.participantVs[i2].loadView(userList.get(i2).getHead(), R.drawable.default_avatar, (Boolean) true);
this.participantVs[i2].setVisibility(0);
} else {
FrescoImageView frescoImageView = (FrescoImageView) this.participantBoxV.getChildAt(i2);
frescoImageView.loadView(userList.get(i2).getHead(), R.drawable.default_avatar, (Boolean) true);
frescoImageView.setVisibility(0);
}
}
}
}
@OnClick({R.id.animateList, R.id.participant_box})
public void activeListClick() {
if (getData() == null) {
return;
}
UrlSchemeProxy.animateList(this.context).topicId(Integer.valueOf(getData().getId())).go();
}
}