TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c
以下内容为反编译后的 TroopMoreDetailView.java 源代码,内容仅作参考
package com.tencent.mobileqq.troop.widget;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.tencent.biz.ProtoServlet;
import com.tencent.biz.pubaccount.PublicAccountBrowser;
import com.tencent.biz.qqstory.utils.UIUtils;
import com.tencent.common.app.BaseApplicationImpl;
import com.tencent.mobileqq.activity.QQBrowserActivity;
import com.tencent.mobileqq.activity.TroopMemberListActivity;
import com.tencent.mobileqq.activity.aio.AIOUtils;
import com.tencent.mobileqq.app.AppConstants;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.app.ThreadManager;
import com.tencent.mobileqq.data.TroopInfo;
import com.tencent.mobileqq.service.troop.TroopConstants;
import com.tencent.mobileqq.troop.activity.TroopAdminList;
import com.tencent.mobileqq.troop.activity.TroopLocationModifyActivity;
import com.tencent.mobileqq.troop.utils.TroopUtils;
import com.tencent.mobileqq.troopinfo.TroopInfoData;
import com.tencent.mobileqq.util.TroopReportor;
import com.tencent.mobileqq.utils.NetworkUtil;
import com.tencent.mobileqq.vaswebviewplugin.VasWebviewConstants;
import com.tencent.qphone.base.util.QLog;
import com.tencent.tim.R;
import java.util.ArrayList;
import java.util.List;
import mqq.app.AppRuntime;
import mqq.app.NewIntent;
import mqq.observer.BusinessObserver;
import tencent.im.cs.cmd0x6ff.subcmd0x608.troop_member_distribute;
import tencent.im.oidb.cmd0x899.oidb_0x899;
import tencent.im.troop.activity.troopactivity;
public class TroopMoreDetailView extends LinearLayout implements View.OnClickListener {
private static final int f94276a = 98;
public static final String f33092a = "qqact.actvitylist";
private static final int f94277b = 99;
private static final int f94278c = 100;
private static final String f33093c = "TroopMoreDetailView";
private static final int d = 0;
private static final int e = 1;
private static final int f = 2;
private static final int g = 3;
private static final int h = 4;
private static final int i = 5;
private static final int j = 6;
private static final int k = 7;
private static final int l = 1;
private static final int m = 2;
public DisplayMetrics f33094a;
TroopInfo f33095a;
public TroopInfoData f33096a;
public ArrayList f33097a;
public List f33098a;
vhq f33099a;
vhr f33100a;
boolean f33101a;
public View[] f33102a;
String f33103b;
public TroopMoreDetailView(Context context) {
super(context);
this.f33096a = new TroopInfoData();
this.f33103b = "";
this.f33097a = new ArrayList();
d();
}
public TroopMoreDetailView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.f33096a = new TroopInfoData();
this.f33103b = "";
this.f33097a = new ArrayList();
d();
}
public TroopMoreDetailView(Context context, AttributeSet attributeSet, int i2) {
super(context, attributeSet, i2);
this.f33096a = new TroopInfoData();
this.f33103b = "";
this.f33097a = new ArrayList();
d();
}
public QQAppInterface m8907a() {
AppRuntime m1871a = BaseApplicationImpl.a().m1871a();
if (m1871a instanceof QQAppInterface) {
return (QQAppInterface) m1871a;
}
return null;
}
public Activity a() {
Context context = getContext();
if (context instanceof Activity) {
return (Activity) context;
}
return null;
}
public void a(int i2, int i3, Intent intent) {
if (i3 != -1) {
return;
}
switch (i2) {
case 98:
case 99:
default:
return;
}
}
private void d() {
setOrientation(1);
}
public void setTroopInfo(TroopInfo troopInfo) {
this.f33095a = troopInfo;
QQAppInterface m8907a = m8907a();
if (m8907a != null) {
this.f33096a.updateForTroopInfo(this.f33095a, m8907a.getCurrentAccountUin());
}
}
public void setTroopInfoData(TroopInfoData troopInfoData) {
this.f33096a = troopInfoData;
}
public void setGuestVisitor(boolean z) {
this.f33101a = z;
}
public void m8909a() {
Activity a2 = a();
if (a2 != null) {
this.f33094a = new DisplayMetrics();
a2.getWindowManager().getDefaultDisplay().getMetrics(this.f33094a);
boolean z = (this.f33096a.dwGroupFlagExt & 2048) != 0;
boolean z2 = !TextUtils.isEmpty(this.f33096a.troopLocation);
this.f33102a = new View[7];
View inflate = View.inflate(getContext(), R.layout.f57638name_res_0x7f03050d, null);
a(0, (z || z2) ? 1 : 0, inflate, getContext().getString(R.string.f63620name_res_0x7f0a1463), null, true, 1);
this.f33102a[0] = inflate;
addView(inflate);
b();
View inflate2 = View.inflate(getContext(), R.layout.f57639name_res_0x7f03050e, null);
a(1, 2, inflate2, "认证机构", this.f33096a.troopAuthenticateInfo, true);
this.f33102a[1] = inflate2;
addView(inflate2);
inflate2.setVisibility(z ? 0 : 8);
View inflate3 = View.inflate(getContext(), R.layout.f57639name_res_0x7f03050e, null);
a(2, 3, inflate3, "群位置", this.f33096a.troopLocation, true);
this.f33102a[2] = inflate3;
addView(inflate3);
inflate3.setVisibility(z2 ? 0 : 8);
View inflate4 = View.inflate(getContext(), R.layout.f57298name_res_0x7f0303b9, null);
a(3, 0, inflate4, "群活动", "", true);
this.f33102a[3] = inflate4;
new LinearLayout.LayoutParams(-1, -2).setMargins(0, UIUtils.m1705a(getContext(), 10.0f), 0, 0);
addView(inflate4);
inflate4.setVisibility(8);
addView(View.inflate(getContext(), R.layout.f57649name_res_0x7f030518, null));
View inflate5 = View.inflate(getContext(), R.layout.f57647name_res_0x7f030516, null);
this.f33102a[4] = inflate5;
addView(inflate5);
a(4, 0, inflate5, "成员概况", this.f33096a.wMemberNum + "人", true);
View inflate6 = View.inflate(getContext(), R.layout.f57035name_res_0x7f0302b2, null);
this.f33102a[5] = inflate6;
inflate6.setBackgroundResource(R.drawable.f41974common_strip_setting_bottom);
inflate6.setFocusable(true);
inflate6.setTag(5);
inflate6.setOnClickListener(this);
inflate6.setVisibility(8);
addView(inflate6);
addView(View.inflate(getContext(), R.layout.f57649name_res_0x7f030518, null));
View inflate7 = View.inflate(getContext(), R.layout.f57650name_res_0x7f030519, null);
this.f33102a[6] = inflate7;
this.f33102a[6].setBackgroundResource(R.drawable.f41969common_strip_setting_bg);
inflate7.setTag(6);
inflate7.setOnClickListener(this);
a(inflate7);
addView(inflate7);
((TextView) inflate7.findViewById(R.id.f50164name_res_0x7f090c10)).setText("管理员");
e();
}
}
private void e() {
QQAppInterface m8907a;
if (NetworkUtil.h(getContext()) && (m8907a = m8907a()) != null) {
this.f33100a = new vhr(this);
b(m8907a, this.f33096a.troopUin, this.f33100a);
if (this.f33101a) {
this.f33099a = new vhq(this);
a(m8907a, this.f33096a.troopUin, this.f33099a);
}
}
}
protected void a(View view) {
int[] iArr = {R.id.f53327name_res_0x7f09186c, R.id.f53328name_res_0x7f09186d, R.id.f53329name_res_0x7f09186e, R.id.f53330name_res_0x7f09186f, R.id.f53331name_res_0x7f091870, R.id.f53332name_res_0x7f091871};
this.f33098a = new ArrayList(6);
int min = Math.min(iArr.length, 6);
for (int i2 = 0; i2 < min; i2++) {
this.f33098a.add((ImageView) view.findViewById(iArr[i2]));
}
}
private void b(QQAppInterface qQAppInterface, String str, BusinessObserver businessObserver) {
if (!TextUtils.isEmpty(str)) {
try {
troop_member_distribute.ReqBody reqBody = new troop_member_distribute.ReqBody();
reqBody.uint64_group_code.set(Long.parseLong(str));
NewIntent newIntent = new NewIntent(qQAppInterface.getApp(), ProtoServlet.class);
newIntent.putExtra("cmd", "group_member_statistic.get_group_member_statistic");
newIntent.putExtra("data", reqBody.toByteArray());
newIntent.setObserver(businessObserver);
qQAppInterface.startServlet(newIntent);
} catch (NumberFormatException e2) {
}
}
}
public void a(int i2, ArrayList arrayList, boolean z, int i3, boolean z2) {
View view;
if (QLog.isColorLevel()) {
QLog.i(f33093c, 2, "updateClrTextItemView(), tag = " + i2 + ", info = " + arrayList + ", bShowArrow = " + z);
}
if (i2 < 0 || i2 >= this.f33102a.length) {
view = null;
} else {
view = this.f33102a[i2];
}
if (view != null) {
int a2 = AIOUtils.a(5.0f, getResources());
int a3 = AIOUtils.a(2.0f, getResources());
int a4 = AIOUtils.a(77.0f, getResources());
LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.f53319name_res_0x7f091864);
linearLayout.setPadding(linearLayout.getPaddingLeft(), a3, linearLayout.getPaddingRight(), linearLayout.getPaddingBottom());
linearLayout.removeAllViews();
if (arrayList != null) {
int i4 = 0;
while (true) {
int i5 = i4;
if (i5 >= arrayList.size() || i5 >= 3) {
break;
}
if (!TextUtils.isEmpty((CharSequence) arrayList.get(i5))) {
TextView textView = new TextView(getContext());
textView.setId(R.id.f47310name_res_0x7f0900e8);
if (i3 == 1) {
textView.setBackgroundResource(R.drawable.f43743name_res_0x7f020a6f);
} else if (i3 == 2) {
textView.setBackgroundResource(R.drawable.f43742name_res_0x7f020a6e);
} else {
textView.setBackgroundResource(R.drawable.f43742name_res_0x7f020a6e);
}
textView.setTextSize(1, 12.0f);
if (z2) {
textView.setMaxWidth(a4);
}
textView.setSingleLine();
textView.setTextColor(-1);
textView.setPadding(a2, a3, a2, a3);
textView.setGravity(17);
textView.setText((CharSequence) arrayList.get(i5));
textView.setEllipsize(TextUtils.TruncateAt.END);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
layoutParams.leftMargin = a2;
linearLayout.addView(textView, layoutParams);
}
i4 = i5 + 1;
}
View findViewById = view.findViewById(R.id.f48072name_res_0x7f0903e4);
if (z) {
view.setTag(Integer.valueOf(i2));
view.setOnClickListener(this);
findViewById.setVisibility(0);
return;
}
view.setTag(null);
view.setOnClickListener(null);
findViewById.setVisibility(8);
}
}
}
public static void a(QQAppInterface qQAppInterface, String str, BusinessObserver businessObserver) {
if (!TextUtils.isEmpty(str)) {
troopactivity.ActSSOReq actSSOReq = new troopactivity.ActSSOReq();
actSSOReq.cmd.set(1);
actSSOReq.group_code.set(Long.parseLong(str));
NewIntent newIntent = new NewIntent(qQAppInterface.getApp(), ProtoServlet.class);
newIntent.putExtra("cmd", "qqact.actvitylist");
newIntent.putExtra("data", actSSOReq.toByteArray());
newIntent.setObserver(businessObserver);
qQAppInterface.startServlet(newIntent);
}
}
public void a(troopactivity.GroupInfoCardResp groupInfoCardResp) {
if (groupInfoCardResp != null) {
int size = groupInfoCardResp.activitys.size();
String str = groupInfoCardResp.group_act_url.get();
if (!TextUtils.isEmpty(str)) {
this.f33103b = a(str, 0L, 0);
}
View view = this.f33102a[3];
if (view != null) {
View findViewById = view.findViewById(R.id.f51814name_res_0x7f091282);
TextView textView = (TextView) view.findViewById(R.id.f51816name_res_0x7f091284);
if (size > 0) {
troopactivity.Activity activity = (troopactivity.Activity) groupInfoCardResp.activitys.get(0);
String str2 = activity.str_name.get();
String str3 = activity.str_start_time.get();
groupInfoCardResp.being_act_num.get();
a(3, 0, findViewById, getContext().getString(R.string.f61037name_res_0x7f0a0a4a), getContext().getString(R.string.f61188name_res_0x7f0a0ae1), true);
textView.setText(str2 + "\n" + str3);
textView.setVisibility(0);
view.setVisibility(0);
} else if (groupInfoCardResp.history_act_num.get() > 0) {
a(3, 0, findViewById, getContext().getString(R.string.f61037name_res_0x7f0a0a4a), String.format(getContext().getString(R.string.f61189name_res_0x7f0a0ae2), Integer.valueOf(groupInfoCardResp.history_act_num.get())), true);
view.setVisibility(0);
textView.setVisibility(8);
} else {
view.setVisibility(8);
textView.setVisibility(8);
}
}
}
}
public void b() {
ThreadManager.a(new vht(this), 8, null, true);
}
public void a(List list) {
if (list != null) {
int size = list.size();
this.f33097a.clear();
for (int i2 = 0; i2 < size; i2++) {
oidb_0x899.memberlist memberlistVar = (oidb_0x899.memberlist) list.get(i2);
if (memberlistVar != null && memberlistVar.uint64_member_uin.has()) {
this.f33097a.add(String.valueOf(memberlistVar.uint64_member_uin.get()));
}
}
ThreadManager.m4817c().post(new vhv(this));
}
}
public void c() {
Activity a2;
if (!UIUtils.d() && (a2 = a()) != null) {
Intent a3 = TroopMemberListActivity.a(a2, this.f33096a.troopUin, 0);
a3.putExtra(AppConstants.Key.dG, this.f33096a.wMemberNum);
a2.startActivityForResult(a3, 100);
}
}
protected void a(int i2, int i3, View view, String str, String[] strArr, boolean z, int i4) {
TextView textView = (TextView) view.findViewById(R.id.f48073title);
if (str == null) {
str = "";
}
textView.setText(str);
view.findViewById(R.id.f48072name_res_0x7f0903e4).setVisibility(z ? 0 : 8);
if (z) {
view.setTag(Integer.valueOf(i2));
view.setOnClickListener(this);
} else {
view.setTag(null);
view.setOnClickListener(null);
}
switch (i3) {
case 0:
view.setBackgroundResource(R.drawable.f41969common_strip_setting_bg);
return;
case 1:
view.setBackgroundResource(R.drawable.f41990common_strip_setting_top);
return;
case 2:
view.setBackgroundResource(R.drawable.f41988common_strip_setting_middle);
return;
case 3:
view.setBackgroundResource(R.drawable.f41974common_strip_setting_bottom);
return;
default:
return;
}
}
protected void a(int i2, int i3, View view, String str, String str2, boolean z) {
if (z) {
view.setTag(Integer.valueOf(i2));
view.setOnClickListener(this);
} else {
view.setTag(null);
view.setOnClickListener(null);
}
switch (i3) {
case 0:
view.setBackgroundResource(R.drawable.f41969common_strip_setting_bg);
break;
case 1:
view.setBackgroundResource(R.drawable.f41990common_strip_setting_top);
break;
case 2:
view.setBackgroundResource(R.drawable.f41988common_strip_setting_middle);
break;
case 3:
view.setBackgroundResource(R.drawable.f41974common_strip_setting_bottom);
break;
}
TextView textView = (TextView) view.findViewById(R.id.f48073title);
TextView textView2 = (TextView) view.findViewById(R.id.f48074info);
View findViewById = view.findViewById(R.id.f48072name_res_0x7f0903e4);
if (str == null) {
str = "";
}
textView.setText(str);
textView2.setText(str2);
findViewById.setVisibility(z ? 0 : 8);
}
@Override
public void onClick(View view) {
Activity a2;
if (!UIUtils.d() && (a2 = a()) != null) {
Object tag = view.getTag();
if (tag instanceof Integer) {
switch (((Integer) tag).intValue()) {
case 0:
ThreadManager.a(new vhs(this), 8, null, true);
if (this.f33101a) {
TroopReportor.a(TroopReportor.f94467b, "grpData_visitor", "clk_tag", 0, 0, this.f33096a.troopUin, TroopReportor.a(this.f33096a));
return;
} else {
TroopReportor.a(TroopReportor.f94467b, "moreData", "clk_tag", 0, 0, this.f33096a.troopUin, TroopReportor.a(this.f33096a));
return;
}
case 1:
String format = String.format("https://qun.qq.com/certification/index.html?_wv=7&_bid=2589&gc=%1$s", this.f33096a.troopUin);
Intent intent = new Intent(a2, QQBrowserActivity.class);
intent.putExtra(VasWebviewConstants.KEY_OPEN_PAGE_TIME, System.currentTimeMillis());
intent.putExtra("url", format);
a2.startActivity(intent);
if (this.f33101a) {
TroopReportor.a(TroopReportor.f94467b, "grpData_visitor", "clk_certifiedInfo", 0, 0, this.f33096a.troopUin, TroopReportor.a(this.f33096a));
return;
} else {
TroopReportor.a(TroopReportor.f94467b, "moreData", "clk_certifiedInfo", 0, 0, this.f33096a.troopUin, TroopReportor.a(this.f33096a));
return;
}
case 2:
if (this.f33096a.pa == 15 || this.f33096a.pa == 10 || this.f33096a.pa == 11) {
}
if (!TextUtils.isEmpty(this.f33096a.troopLocation) && this.f33096a.troopLat != 0 && this.f33096a.troopLon != 0) {
Intent intent2 = new Intent(a2, QQBrowserActivity.class);
intent2.putExtra("url", String.format(TroopConstants.bN, String.valueOf(this.f33096a.troopLat / 1000000.0d), String.valueOf(this.f33096a.troopLon / 1000000.0d)));
a2.startActivity(intent2);
} else if (this.f33096a.isOwnerOrAdim()) {
TroopLocationModifyActivity.a(a2, this.f33096a.troopUin, this.f33096a.troopLocation, 99);
}
if (this.f33101a) {
TroopReportor.a(TroopReportor.f94467b, "grpData_visitor", "clk_grpMap", 0, 0, this.f33096a.troopUin, TroopReportor.a(this.f33096a));
return;
} else {
TroopReportor.a(TroopReportor.f94467b, "moreData", "clk_grpMap", 0, 0, this.f33096a.troopUin, TroopReportor.a(this.f33096a));
return;
}
case 3:
if (!TextUtils.isEmpty(this.f33103b)) {
Intent intent3 = new Intent(a2, QQBrowserActivity.class);
intent3.putExtra(VasWebviewConstants.KEY_OPEN_PAGE_TIME, System.currentTimeMillis());
intent3.putExtra("url", this.f33103b);
a2.startActivity(intent3);
return;
}
return;
case 4:
case 5:
Intent intent4 = new Intent(getContext(), PublicAccountBrowser.class);
intent4.putExtra("url", "http://web.qun.qq.com/statistics/index.html?_bid=149&_wv=3&gc=" + this.f33096a.troopUin);
getContext().startActivity(intent4);
if (this.f33101a) {
TroopReportor.a(TroopReportor.f94467b, "grpData_visitor", "clk_mberIntro", 0, 0, this.f33096a.troopUin, TroopReportor.a(this.f33096a));
return;
} else {
TroopReportor.a(TroopReportor.f94467b, "moreData", "clk_mberIntro", 0, 0, this.f33096a.troopUin, TroopReportor.a(this.f33096a));
return;
}
case 6:
if (this.f33101a) {
TroopReportor.a(TroopReportor.f94467b, "grpData_visitor", "clk_manaList", 0, 0, this.f33096a.troopUin, TroopReportor.a(this.f33096a));
}
if (!this.f33097a.isEmpty()) {
Intent intent5 = new Intent(a2, TroopAdminList.class);
intent5.putExtra("uin", this.f33096a.troopowneruin);
intent5.putStringArrayListExtra(AppConstants.Key.ds, this.f33097a);
if (a2.getIntent() != null) {
intent5.putExtra(TroopUtils.l, a2.getIntent().getIntExtra(TroopUtils.l, -1));
}
a2.startActivity(intent5);
return;
}
return;
default:
return;
}
}
}
}
private String a(String str, long j2, int i2) {
QQAppInterface m8907a;
String str2;
if (a() == null || (m8907a = m8907a()) == null) {
return "";
}
String currentAccountUin = m8907a.getCurrentAccountUin();
if (this.f33096a.bOwner) {
str2 = "0";
} else {
str2 = this.f33096a.bAdmin ? "1" : "2";
}
return str.replace("$GCODE$", this.f33096a.troopUin).replace("$CLIENTVER$", "android6.5.5").replace("$UIN$", currentAccountUin).replace("$LANG$", "zh_CN").replace("$GROUPAPPID$", Long.toString(j2)).replace("$ROLE$", str2).replace("$ENTERSOURCE$", this.f33101a ? "2" : "1").replace("$GNAME$", this.f33096a.troopName + "").replace("$GUIN$", this.f33096a.troopUin).replace("$UNREADNUM$", String.valueOf(i2));
}
}