柬埔寨通 v6.1.5版本的 MD5 值为:9b68581ac30883219d6a25858a099d6b
以下内容为反编译后的 ShowTopicIndexHeadTwoDataView.java 源代码,内容仅作参考
package net.duohuo.magappx.circle.show.dataview;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.os.Build;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.BindViews;
import butterknife.OnClick;
import cn.iwgang.countdownview.CountdownView;
import com.facebook.imagepipeline.postprocessors.IterativeBoxBlurPostProcessor;
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.UrlScheme;
import net.duohuo.magappx.circle.show.model.TopicInfo;
import net.duohuo.magappx.circle.show.model.TopicUser;
import net.duohuo.magappx.circle.show.view.BlurringView;
import net.duohuo.magappx.common.recyclerbase.MultiItemTypeAdapter;
import net.duohuo.magappx.common.recyclerbase.RecyclerCommonAdapter;
import net.duohuo.magappx.common.recyclerbase.RecyclerViewHolder;
import net.duohuo.magappx.common.util.Constants;
import net.duohuo.magappx.common.util.ShapeUtil;
public class ShowTopicIndexHeadTwoDataView extends DataView<TopicInfo> {
private RecyclerCommonAdapter adapter;
@BindView(R.id.animateList)
View animateListV;
@BindView(R.id.blurring_view)
BlurringView blurringView;
@BindView(R.id.business_text)
TextView businessTextV;
@BindView(R.id.countdown_box)
View countdownBoxV;
@BindView(R.id.countdownview_text)
CountdownView countdownviewTextV;
@BindView(R.id.countdownview_title)
TextView countdownviewTitleV;
@BindView(R.id.degree_of_heat)
TextView degreeOfHeatV;
@BindView(R.id.detail_box)
View detailBoxV;
@BindView(R.id.headbg)
FrescoImageView headBgV;
@BindView(R.id.headbg_box)
ViewGroup headbgBoxV;
@BindView(R.id.initiator)
FrescoImageView initiatorV;
@BindView(R.id.recyclerview)
RecyclerView mRecyclerview;
@BindView(R.id.more_img)
ImageView moreMmgV;
@BindView(R.id.old_headbg)
FrescoImageView oldheadbgV;
OnCountdownEndListener onCountdownEndListener;
@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.popularity_list)
TextView popularityListV;
private RecyclerCommonAdapter recyclerCommonAdapter;
@BindView(R.id.shadow)
View shadowV;
@BindView(R.id.sponsor_recyclerView)
RecyclerView sponsorRecyclerViewV;
@BindView(R.id.topic_name)
TextView topicTitleV;
@BindView(R.id.topic_userName)
TextView topicUserNameV;
@BindView(R.id.watchCount)
TextView watchCountV;
@BindView(R.id.webView)
MagBizWebView webView;
@BindView(R.id.win_text)
TextView winTextV;
double x;
public interface OnCountdownEndListener {
void end();
}
public void initWebView() {
}
public ShowTopicIndexHeadTwoDataView(Context context, View view) {
super(context, view);
this.x = 1.4248d;
initWebView();
ViewGroup.LayoutParams layoutParams = this.headbgBoxV.getLayoutParams();
layoutParams.height = (IUtil.getDisplayWidth() * 263) / 375;
this.headbgBoxV.setLayoutParams(layoutParams);
ShapeUtil.shapeRect(this.animateListV, IUtil.dip2px(context, 3.0f), "#4dffffff");
ShapeUtil.shapeRect(this.countdownBoxV, IUtil.dip2px(context, 8.0f), "#F4F9FF");
ShapeUtil.setShapeColor(this.detailBoxV, "#FFFFFF", new float[]{IUtil.dip2px(context, 15.0f), IUtil.dip2px(context, 15.0f), IUtil.dip2px(context, 15.0f), IUtil.dip2px(context, 15.0f), 0.0f, 0.0f, 0.0f, 0.0f});
this.mRecyclerview.setLayoutManager(new GridLayoutManager(context, 4));
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
linearLayoutManager.setOrientation(1);
this.sponsorRecyclerViewV.setLayoutManager(linearLayoutManager);
RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.oldheadbgV.getLayoutParams();
layoutParams2.height = (IUtil.getDisplayWidth() * 163) / 375;
if (Build.VERSION.SDK_INT >= 19) {
layoutParams2.topMargin = IUtil.getStatusHeight() + IUtil.dip2px(getContext(), 48.0f);
}
this.oldheadbgV.setLayoutParams(layoutParams2);
}
@Override
public void bindView(final TopicInfo topicInfo) {
if (topicInfo == null) {
return;
}
if ("1".equals(topicInfo.getIs_new_activity_topic())) {
this.blurringView.setBlurredView(this.headBgV);
this.blurringView.setVisibility(8);
this.oldheadbgV.setVisibility(8);
} else {
if (topicInfo.getCoverPicHeight() > 0.0d && topicInfo.getCoverPicWidth() > 0.0d && topicInfo.getCoverPicWidth() / topicInfo.getCoverPicHeight() <= this.x) {
this.oldheadbgV.setVisibility(8);
this.blurringView.setVisibility(8);
this.blurringView.setBlurredView(this.headBgV);
} else {
this.headBgV.setPostProcessor(new IterativeBoxBlurPostProcessor(10, 10));
this.oldheadbgV.loadView(topicInfo.getCoverPicTburl(), R.color.image_def);
}
this.popularityListV.setText("活跃榜");
}
this.headBgV.loadView(topicInfo.getCoverPicTburl(), R.color.image_def);
if ("1".equals(topicInfo.getIs_new_activity_topic()) && topicInfo.getCallTime() != null && "1".equals(topicInfo.getCallTime().getStatus())) {
this.countdownBoxV.setVisibility(0);
this.countdownviewTitleV.setText(topicInfo.getCallTime().getDesc());
if (topicInfo.getCallTime().getTime() <= 0) {
this.countdownviewTextV.setVisibility(8);
} else {
this.countdownviewTextV.setVisibility(0);
this.countdownviewTextV.start((topicInfo.getCallTime().getTime() * 1000) - System.currentTimeMillis());
this.countdownviewTextV.setOnCountdownEndListener(new CountdownView.OnCountdownEndListener() {
@Override
public void onEnd(CountdownView countdownView) {
if (ShowTopicIndexHeadTwoDataView.this.onCountdownEndListener != null) {
ShowTopicIndexHeadTwoDataView.this.onCountdownEndListener.end();
}
}
});
this.countdownviewTextV.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View view) {
ShowTopicIndexHeadTwoDataView.this.countdownviewTextV.start((topicInfo.getCallTime().getTime() * 1000) - System.currentTimeMillis());
}
@Override
public void onViewDetachedFromWindow(View view) {
ShowTopicIndexHeadTwoDataView.this.countdownviewTextV.stop();
}
});
}
} else {
this.countdownBoxV.setVisibility(8);
}
this.topicTitleV.setText(topicInfo.getName());
this.watchCountV.setText(topicInfo.getWatchCount());
this.participantCountV.setText(topicInfo.getParticipationCount());
this.degreeOfHeatV.setText(topicInfo.getDynamicCount());
if (topicInfo.getInitiatorUser() != null) {
this.initiatorV.loadCircleView(topicInfo.getInitiatorUser().getHead(), R.color.image_def, true);
this.topicUserNameV.setText(topicInfo.getInitiatorUser().getName());
}
if (!TextUtils.isEmpty(topicInfo.getActivityRules())) {
this.webView.setVisibility(0);
this.webView.loadDataWithBaseURL("https://app.jpztong.com/", topicInfo.getActivityRules(), "text/html", "utf-8", null);
}
List<TopicInfo.UserListBean> userList = topicInfo.getUserList();
if (userList != null) {
int size = userList.size() > 4 ? 4 : userList.size();
this.moreMmgV.setVisibility(size < 4 ? 8 : 0);
for (int i = 0; i < size; i++) {
if (i == 3) {
this.participantVs[3].setPostProcessor(new IterativeBoxBlurPostProcessor(10, 10));
}
this.participantVs[i].loadCircleView(userList.get(i).getHead(), R.color.image_def, true);
this.participantVs[i].setVisibility(0);
}
}
boolean z = SafeJsonUtil.getBoolean(topicInfo.getSponsor_merchant(), "is_show");
this.businessTextV.setVisibility(z ? 0 : 8);
if (z) {
final List parseList = SafeJsonUtil.parseList(SafeJsonUtil.getString(topicInfo.getSponsor_merchant(), Constants.PAGE_INFO), TopicUser.class);
RecyclerCommonAdapter<TopicUser> recyclerCommonAdapter = new RecyclerCommonAdapter<TopicUser>(this.context, R.layout.topic_sponsor_list_item, parseList) {
@Override
public void convert(RecyclerViewHolder recyclerViewHolder, TopicUser topicUser, int i2) {
try {
recyclerViewHolder.setText(R.id.business_name, topicUser.getName());
recyclerViewHolder.setText(R.id.business_des, topicUser.getRemark());
recyclerViewHolder.loadView(R.id.head, topicUser.getUser_head(), R.color.image_def, true);
recyclerViewHolder.loadView(R.id.head_tag, topicUser.getGroup_ico_src(), R.color.image_def, true);
recyclerViewHolder.getView(R.id.head_tag).setVisibility(TextUtils.isEmpty(topicUser.getGroup_ico_src()) ? 8 : 0);
} catch (Exception unused) {
}
}
};
this.adapter = recyclerCommonAdapter;
this.sponsorRecyclerViewV.setAdapter(recyclerCommonAdapter);
this.adapter.setOnItemClickListener(new MultiItemTypeAdapter.OnItemClickListener() {
@Override
public boolean onItemLongClick(View view, RecyclerView.ViewHolder viewHolder, int i2) {
return false;
}
@Override
public void onItemClick(View view, RecyclerView.ViewHolder viewHolder, int i2) {
UrlScheme.toUrl(ShowTopicIndexHeadTwoDataView.this.context, ((TopicUser) parseList.get(i2)).getLink());
}
});
}
boolean z2 = SafeJsonUtil.getBoolean(topicInfo.getWin_user(), "is_show");
this.winTextV.setVisibility(z2 ? 0 : 8);
if (z2) {
final List parseList2 = SafeJsonUtil.parseList(SafeJsonUtil.getString(topicInfo.getWin_user(), Constants.PAGE_INFO), TopicUser.class);
RecyclerCommonAdapter<TopicUser> recyclerCommonAdapter2 = new RecyclerCommonAdapter<TopicUser>(this.context, R.layout.awards_list_item, parseList2) {
@Override
public void convert(RecyclerViewHolder recyclerViewHolder, TopicUser topicUser, int i2) {
try {
ViewGroup viewGroup = (ViewGroup) recyclerViewHolder.getView(R.id.win_box);
int displayWidth = (IUtil.getDisplayWidth() - IUtil.dip2px(ShowTopicIndexHeadTwoDataView.this.context, 32.0f)) / 4;
ViewGroup.LayoutParams layoutParams = viewGroup.getLayoutParams();
layoutParams.width = displayWidth;
layoutParams.height = (displayWidth * 98) / 85;
viewGroup.setLayoutParams(layoutParams);
recyclerViewHolder.setText(R.id.awards_name, topicUser.getName());
recyclerViewHolder.setText(R.id.awards_des, topicUser.getRemark());
recyclerViewHolder.loadView(R.id.heard_pic, topicUser.getUser_head(), R.color.image_def, true);
} catch (Exception unused) {
}
}
};
this.recyclerCommonAdapter = recyclerCommonAdapter2;
this.mRecyclerview.setAdapter(recyclerCommonAdapter2);
this.recyclerCommonAdapter.setOnItemClickListener(new MultiItemTypeAdapter.OnItemClickListener() {
@Override
public boolean onItemLongClick(View view, RecyclerView.ViewHolder viewHolder, int i2) {
return false;
}
@Override
public void onItemClick(View view, RecyclerView.ViewHolder viewHolder, int i2) {
UrlScheme.toUrl(ShowTopicIndexHeadTwoDataView.this.context, ((TopicUser) parseList2.get(i2)).getLink());
}
});
}
TextUtils.isEmpty(topicInfo.getActivityRules());
}
public static Bitmap createBitmapFromView(View view) {
view.clearFocus();
Bitmap createBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
if (createBitmap != null) {
Canvas canvas = new Canvas(createBitmap);
view.draw(canvas);
canvas.setBitmap(null);
}
return createBitmap;
}
@OnClick({R.id.animateList})
public void activeListClick() {
if (getData() == null) {
return;
}
if ("1".equals(getData().getIs_new_activity_topic())) {
UrlScheme.toUrl(getContext(), getData().getLink());
} else {
UrlSchemeProxy.animateList(this.context).topicId(Integer.valueOf(getData().getId())).go();
}
}
public void setOnCountdownEndListener(OnCountdownEndListener onCountdownEndListener) {
this.onCountdownEndListener = onCountdownEndListener;
}
public void setBgVague() {
this.blurringView.setVisibility(0);
this.blurringView.setBlurredView(this.headBgV);
this.shadowV.setVisibility(0);
}
public void setBgUnVague() {
this.blurringView.setVisibility(8);
this.shadowV.setVisibility(8);
}
}