正在查看: 95爱播免登录版 v3.1.9 应用的 ChatActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 95爱播免登录版 v3.1.9 应用的 ChatActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.showself.ui.notificationbox;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.ClipboardManager;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.viewpager.widget.ViewPager;
import chat.Emoji.SJEmoji.view.EmojiView;
import chat.entity.MessageInfo;
import chat.entity.MessageUserInfo;
import chat.entity.NotificationNumber;
import com.android.volley.toolbox.ImageLoader;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.mifeng.ui.R;
import com.opensource.svgaplayer.SVGAImageView;
import com.r.b.t;
import com.showself.domain.LoginResultInfo;
import com.showself.domain.MessageBaseInfo;
import com.showself.domain.PropInfo;
import com.showself.resource.ResourceManager;
import com.showself.show.bean.GiftBean;
import com.showself.ui.CardActivity;
import com.showself.ui.VIPActivity;
import com.showself.utils.Utils;
import com.showself.utils.k0;
import com.showself.utils.r0;
import com.showself.utils.w0;
import com.sina.weibo.sdk.auth.Oauth2AccessToken;
import com.tencent.tauth.AuthActivity;
import d.a.a.b.f;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.jivesoftware.smack.packet.PrivacyItem;
import org.json.JSONArray;
import org.json.JSONObject;
@SuppressLint({"InflateParams"})
public class ChatActivity extends com.showself.ui.c {
private Button A;
private ImageView A0;
private ImageView B;
private ImageView B0;
private List<PropInfo> C;
private ImageView C0;
private SVGAImageView D0;
private TextView E0;
private TextView F0;
private int G;
private MessageBaseInfo G0;
private LinearLayout H;
ImageLoader I;
private int J;
Thread J0;
private InputMethodManager K;
private int L;
Dialog L0;
private String M0;
private String N0;
private IntentFilter P;
private com.showself.provider.c Q;
private InputMethodManager Q0;
private d0 R;
private ChatActivity S;
private int X;
private int Y;
private long Z;
private com.showself.utils.j a;
private g0 b;
private int b0;
private LoginResultInfo c;
private ImageView f3185e;
private ImageView f3186f;
private TextView f3187g;
private ListView f3188h;
private LinearLayout h0;
private com.r.b.t f3189i;
private TextView i0;
private ViewPager j0;
private ImageView f3191k;
private Button k0;
private EditText l;
private RelativeLayout l0;
private Button m;
private TextView m0;
private ImageView n0;
private int o;
private RadioGroup o0;
private PopupWindow p0;
private ListView q0;
private String r;
private AbsListView.LayoutParams r0;
private RadioGroup.LayoutParams s0;
private View t0;
private EmojiView u;
private RelativeLayout u0;
private String v;
private String v0;
private String w0;
private com.showself.provider.f x;
private ImageView y;
private RelativeLayout y0;
private k0 z;
private ImageView z0;
String d = "{\"type\":4,\"_seq\":\"0\"}";
private List<MessageInfo> f3190j = new ArrayList();
private int n = 0;
private String p = "";
private String q = "";
private int s = 0;
private int t = 2;
String w = "";
private int M = 0;
private int N = 20;
private boolean O = true;
private int T = 0;
private int U = 1;
private int V = 0;
private int W = 0;
private int a0 = 0;
private boolean c0 = false;
private boolean d0 = false;
private LinkedHashMap<String, ArrayList<GiftBean>> e0 = new LinkedHashMap<>();
private ArrayList<f.d.b> f0 = new ArrayList<>();
private ArrayList<GiftBean> g0 = null;
private boolean x0 = false;
private Handler H0 = new k();
public Handler I0 = new u();
private boolean K0 = true;
String O0 = "【%s】送【%s】%d个【%s】";
String P0 = "恭喜【%s】喜中【%d】倍【%s】大奖,活的【%d】蜜钻!";
class a extends BaseAdapter {
a() {
}
@Override
public int getCount() {
return ChatActivity.this.C.size();
}
@Override
public Object getItem(int i2) {
return null;
}
@Override
public long getItemId(int i2) {
return 0L;
}
@Override
@SuppressLint({"ViewHolder"})
public View getView(int i2, View view, ViewGroup viewGroup) {
View inflate = View.inflate(ChatActivity.this, R.layout.prop_dialog_item, null);
ImageView imageView = (ImageView) inflate.findViewById(R.id.iv_prop_image);
ImageView imageView2 = (ImageView) inflate.findViewById(R.id.iv_vip_image);
TextView textView = (TextView) inflate.findViewById(R.id.tv_prop_count);
TextView textView2 = (TextView) inflate.findViewById(R.id.tv_prop_name);
inflate.setOnClickListener(ChatActivity.this.new h0(i2));
if (((PropInfo) ChatActivity.this.C.get(i2)).getVip_level() != 0) {
imageView2.setVisibility(0);
ChatActivity chatActivity = ChatActivity.this;
chatActivity.I.displayImage(chatActivity.x.k(((PropInfo) ChatActivity.this.C.get(i2)).getVip_level(), 0), imageView2);
}
ChatActivity chatActivity2 = ChatActivity.this;
chatActivity2.I.displayImage(((PropInfo) chatActivity2.C.get(i2)).getImage(), imageView);
if (((PropInfo) ChatActivity.this.C.get(i2)).getOwn_num() > 0) {
textView.setText(((PropInfo) ChatActivity.this.C.get(i2)).getOwn_num() + "");
} else {
textView.setVisibility(8);
}
textView2.setText(((PropInfo) ChatActivity.this.C.get(i2)).getName());
return inflate;
}
}
class a0 implements TextWatcher {
a0() {
}
@Override
public void afterTextChanged(Editable editable) {
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
if (ChatActivity.this.l.getText().toString() != null && !"".equals(ChatActivity.this.l.getText().toString())) {
ChatActivity.this.m.setVisibility(0);
} else {
if (ChatActivity.this.c == null || ChatActivity.this.c.getPriv_letter_upload_switch() != 0) {
return;
}
ChatActivity.this.m.setVisibility(8);
}
}
}
class b implements com.showself.utils.l {
final int a;
b(int i2) {
this.a = i2;
}
@Override
public void a(boolean z) {
if (z) {
ChatActivity.this.r1(this.a);
}
}
}
class b0 implements Runnable {
final Runnable a;
b0(Runnable runnable) {
this.a = runnable;
}
@Override
public void run() {
List<MessageInfo> e2 = ChatActivity.this.Q.e(ChatActivity.this.o, ChatActivity.this.n, ChatActivity.this.f3190j.size(), ChatActivity.this.N);
if (e2 != null) {
Collections.reverse(e2);
if (ChatActivity.this.M == 0) {
ChatActivity.this.f3190j.clear();
}
if (e2.size() < ChatActivity.this.N) {
ChatActivity.this.O = false;
} else {
ChatActivity.this.O = true;
}
ChatActivity chatActivity = ChatActivity.this;
chatActivity.M = chatActivity.f3190j.size() + e2.size();
Iterator<MessageInfo> it = e2.iterator();
while (it.hasNext()) {
d.a.a.b.b.b(it.next().getMessage());
}
ChatActivity.this.f3190j.addAll(0, e2);
Utils.n(ChatActivity.this);
Runnable runnable = this.a;
if (runnable != null) {
ChatActivity.this.runOnUiThread(runnable);
}
}
}
}
class c implements com.showself.utils.l {
final String a;
c(String str) {
this.a = str;
}
@Override
public void a(boolean z) {
if (z) {
if (ChatActivity.this.getString(R.string.get_money_free).equals(this.a)) {
com.showself.utils.c1.e.a(ChatActivity.this);
} else {
ChatActivity.this.startActivity(new Intent(ChatActivity.this.getApplicationContext(), (Class<?>) VIPActivity.class));
}
}
}
}
class c0 implements View.OnClickListener {
c0() {
}
@Override
public void onClick(View view) {
if (Utils.o0()) {
}
switch (view.getId()) {
case 2131296432:
if (ChatActivity.this.Y != 0) {
ChatActivity.this.L1();
break;
} else {
Toast.makeText((Context) ChatActivity.this.S, (CharSequence) "请选择礼物!", 0).show();
break;
}
case 2131297491:
case 2131299533:
case 2131299535:
com.showself.utils.c1.e.a(ChatActivity.this);
break;
case 2131298354:
ChatActivity.this.S1(view);
break;
}
}
}
class d extends Thread {
final String a;
final String b;
class a implements Runnable {
final String a;
a(String str) {
this.a = str;
}
@Override
public void run() {
ChatActivity.this.G1(this.a);
}
}
d(String str, String str2) {
this.a = str;
this.b = str2;
}
@Override
public void run() {
String E0 = Utils.E0(this.a, this.b);
if (ChatActivity.this.isFinishing()) {
return;
}
ChatActivity.this.runOnUiThread(new a(E0));
}
}
private class d0 implements View.OnClickListener {
class a implements f.b {
a() {
}
public void onSuccess() {
ChatActivity.this.f3189i.o(ChatActivity.this.f3190j, true);
ChatActivity.this.f3188h.setSelection(ChatActivity.this.f3189i.getCount());
}
}
private d0() {
}
@Override
public void onClick(View view) {
long j2;
switch (view.getId()) {
case 2131296420:
ChatActivity.this.f3188h.setSelection(ChatActivity.this.f3189i.getCount());
ChatActivity.this.m.setVisibility(8);
ChatActivity.this.l.setVisibility(0);
ChatActivity.this.H.setVisibility(8);
ChatActivity.this.u0.setVisibility(8);
ChatActivity.this.t0.setVisibility(8);
ChatActivity.this.y.setImageResource(R.drawable.icon_gift);
ChatActivity.this.K0 = true;
ChatActivity.this.K.hideSoftInputFromWindow(ChatActivity.this.l.getWindowToken(), 2);
ChatActivity.this.u.setVisibility(0);
ChatActivity.this.B.setImageResource(R.drawable.icon_emoji_pink);
break;
case R.id.btn_chat_add:
ChatActivity.this.K.hideSoftInputFromWindow(ChatActivity.this.l.getWindowToken(), 2);
ChatActivity.this.u.setVisibility(8);
if (!ChatActivity.this.K0) {
ChatActivity.this.K0 = true;
ChatActivity.this.H.setVisibility(8);
ChatActivity.this.A.setBackgroundResource(2131231775);
break;
} else {
ChatActivity.this.K0 = false;
ChatActivity.this.H.setVisibility(0);
ChatActivity.this.A.setBackgroundResource(2131231772);
ChatActivity.this.u0.setVisibility(8);
ChatActivity.this.t0.setVisibility(8);
ChatActivity.this.y.setImageResource(R.drawable.icon_gift);
break;
}
case 2131296460:
ChatActivity.this.u.setVisibility(8);
ChatActivity.this.B.setImageResource(R.drawable.icon_emoji);
long currentTimeMillis = System.currentTimeMillis() / 1000;
String obj = !TextUtils.isEmpty(ChatActivity.this.w) ? ChatActivity.this.w : ChatActivity.this.l.getText().toString();
if (obj != null && !obj.equals("") && !obj.matches("\\s*")) {
if (ChatActivity.this.x.t("4", ChatActivity.this.c.getUserId(), ChatActivity.this.n)) {
MessageInfo messageInfo = new MessageInfo(ChatActivity.this.o, ChatActivity.this.n, obj, 1, 0, currentTimeMillis, ChatActivity.this.o, "", 12.0d, 13.0d, ChatActivity.this.r, ChatActivity.this.c.getGender(), 0, "", "", (ChatActivity.this.f3190j == null || ChatActivity.this.f3190j.size() == 0) ? 0L : ((MessageInfo) ChatActivity.this.f3190j.get(ChatActivity.this.f3190j.size() - 1)).getSysdateline() + 1, ChatActivity.this.c.getUserName());
messageInfo.setState(2);
String F = Utils.F();
messageInfo.setMessageKey(F);
long j3 = -1;
try {
j3 = ChatActivity.this.Q.g(messageInfo);
} catch (Exception e2) {
e2.printStackTrace();
}
long j4 = j3;
if (j4 >= 0) {
if (ChatActivity.this.c != null) {
j2 = j4;
MessageUserInfo messageUserInfo = new MessageUserInfo(ChatActivity.this.o, ChatActivity.this.n, obj, 1, 2, currentTimeMillis, ChatActivity.this.o, ChatActivity.this.p, ChatActivity.this.c.getGender(), ChatActivity.this.q, ChatActivity.this.s, ChatActivity.this.n);
messageUserInfo.setIsOfficial(ChatActivity.this.w0);
messageUserInfo.setMessageKey(F);
if (TextUtils.isEmpty(ChatActivity.this.w)) {
ChatActivity.this.l.setText("");
}
try {
ChatActivity.this.Q.h(messageUserInfo, true);
} catch (Exception e3) {
e3.printStackTrace();
}
} else {
j2 = j4;
}
StringBuilder sb = new StringBuilder();
long j5 = j2;
sb.append(j5);
sb.append("");
messageInfo.setId(sb.toString());
String a2 = com.showself.utils.h.a(messageInfo, ChatActivity.this.c.getUserName(), ChatActivity.this.s);
ChatActivity.this.x.u(ChatActivity.this.o, ChatActivity.this.n, "4");
com.showself.ui.notificationbox.a.d(ChatActivity.this.getApplicationContext()).g(ChatActivity.this.n, j5, a2, ChatActivity.this.Q);
ChatActivity.this.f3190j.add(messageInfo);
com.r.n.g j6 = com.r.n.g.j();
com.r.n.d c = com.r.n.d.c();
c.e("Chat");
c.f("PrivateChat");
c.d("SendPrivate");
c.h(com.r.n.e.Click);
j6.u(c.b());
d.a.a.b.f.c(messageInfo.getMessage(), new a());
}
} else {
?? r0 = ChatActivity.this;
Utils.b1(r0, ((ChatActivity) r0).x.r(116, ChatActivity.this.t, ChatActivity.this.c.getGender(), "0"), ChatActivity.this.getString(2131689912), ChatActivity.this.getString(2131690001));
}
ChatActivity.this.w = "";
break;
}
break;
case R.id.et_chat_context:
com.r.n.g j7 = com.r.n.g.j();
com.r.n.d c2 = com.r.n.d.c();
c2.e("Chat");
c2.f("PrivateChat");
c2.d("PrivateMessage");
c2.h(com.r.n.e.Click);
j7.u(c2.b());
ChatActivity.this.l.setFocusable(true);
ChatActivity.this.l.setFocusableInTouchMode(true);
ChatActivity.this.l.requestFocus();
ChatActivity.this.A.setBackgroundResource(2131231775);
ChatActivity.this.u.setVisibility(8);
ChatActivity.this.B.setImageResource(R.drawable.icon_emoji);
ChatActivity.this.H.setVisibility(8);
ChatActivity.this.u0.setVisibility(8);
ChatActivity.this.t0.setVisibility(8);
ChatActivity.this.K.showSoftInput(ChatActivity.this.l, 0);
break;
case 2131297052:
ChatActivity.this.y1(1);
break;
case 2131297065:
if (ChatActivity.this.u0 != null && ChatActivity.this.u0.isShown()) {
ChatActivity.this.y.setImageResource(R.drawable.icon_gift);
ChatActivity.this.u0.setVisibility(8);
ChatActivity.this.t0.setVisibility(8);
break;
} else {
ChatActivity.this.B.setImageResource(R.drawable.icon_emoji);
if (!Utils.q0(ChatActivity.this.S)) {
Utils.Y0(ChatActivity.this.S, 2131690476);
break;
} else if (!ChatActivity.this.c0) {
ChatActivity.this.d0 = true;
ChatActivity.this.D1();
break;
} else {
ChatActivity.this.R1(0, true);
break;
}
}
break;
case R.id.iv_history_back:
ChatActivity.this.finish();
break;
case R.id.iv_input_emoji:
if (ChatActivity.this.u.getVisibility() != 0) {
ChatActivity.this.B.setImageResource(R.drawable.icon_emoji_pink);
ChatActivity.this.f3188h.setSelection(ChatActivity.this.f3189i.getCount());
ChatActivity.this.m.setVisibility(8);
ChatActivity.this.l.setVisibility(0);
ChatActivity.this.H.setVisibility(8);
ChatActivity.this.u0.setVisibility(8);
ChatActivity.this.t0.setVisibility(8);
ChatActivity.this.y.setImageResource(R.drawable.icon_gift);
ChatActivity.this.K0 = true;
ChatActivity.this.K.hideSoftInputFromWindow(ChatActivity.this.l.getWindowToken(), 2);
ChatActivity.this.u.setVisibility(0);
break;
} else {
ChatActivity.this.u.setVisibility(8);
ChatActivity.this.B.setImageResource(R.drawable.icon_emoji);
break;
}
case 2131298347:
Intent intent = new Intent((Context) ChatActivity.this, (Class<?>) CardActivity.class);
intent.putExtra("id", ChatActivity.this.n);
ChatActivity.this.startActivityForResult(intent, 100);
break;
case R.id.tv_clear_record:
ChatActivity.this.H1();
break;
}
}
d0(ChatActivity chatActivity, k kVar) {
this();
}
}
class e implements com.r.c.d {
e() {
}
@Override
public void onRequestFinish(com.r.c.c cVar, Object obj) {
ChatActivity.this.F1(obj);
}
}
class e0 implements View.OnClickListener {
e0() {
}
@Override
public void onClick(View view) {
if (Utils.o0()) {
return;
}
for (int i2 = 0; i2 < ChatActivity.this.h0.getChildCount(); i2++) {
ChatActivity.this.h0.getChildAt(i2).setBackgroundDrawable(null);
((Button) ChatActivity.this.h0.getChildAt(i2)).setTextColor(Color.parseColor("#b2b2b2"));
((Button) ChatActivity.this.h0.getChildAt(i2)).setBackgroundDrawable(null);
}
ChatActivity.this.Y = 0;
ChatActivity.this.o0.removeAllViews();
Button button = (Button) view;
button.setTextSize(0, com.showself.utils.r.b(ChatActivity.this, 13.0f));
button.setTextColor(Color.parseColor("#444444"));
button.setBackgroundResource(R.drawable.icon_gift_tab_bg);
ArrayList arrayList = (ArrayList) ((Map.Entry) view.getTag()).getValue();
if (arrayList.size() % 8 == 0) {
ChatActivity.this.a0 = arrayList.size() / 8;
} else {
ChatActivity.this.a0 = (arrayList.size() / 8) + 1;
}
ChatActivity chatActivity = ChatActivity.this;
chatActivity.q1(chatActivity.a0);
ChatActivity.this.j0.setOffscreenPageLimit(ChatActivity.this.a0);
}
}
class f implements com.showself.utils.l {
f() {
}
@Override
public void a(boolean z) {
if (!z || Utils.o0()) {
return;
}
com.showself.utils.c1.e.a(ChatActivity.this);
}
}
class f0 implements ViewPager.OnPageChangeListener {
f0() {
}
public void onPageScrollStateChanged(int i2) {
}
public void onPageScrolled(int i2, float f2, int i3) {
}
public void onPageSelected(int i2) {
((RadioButton) ChatActivity.this.o0.getChildAt(i2 % ChatActivity.this.a0)).setChecked(true);
}
}
class g implements com.showself.utils.l {
final String a;
g(String str) {
this.a = str;
}
@Override
public void a(boolean z) {
if (z) {
return;
}
((ClipboardManager) ChatActivity.this.getSystemService("clipboard")).setText(this.a);
Utils.Y0(ChatActivity.this.getApplicationContext(), R.string.copy_success);
}
}
public class g0 extends BroadcastReceiver {
class a implements f.b {
final List a;
a(List list) {
this.a = list;
}
public void onSuccess() {
ChatActivity.this.f3190j = this.a;
Collections.reverse(ChatActivity.this.f3190j);
ChatActivity.this.f3189i.o(ChatActivity.this.f3190j, true);
ChatActivity.this.f3188h.setSelection(ChatActivity.this.f3189i.getCount());
}
}
class b implements f.b {
final List a;
b(List list) {
this.a = list;
}
public void onSuccess() {
ChatActivity.this.f3190j = this.a;
Collections.reverse(ChatActivity.this.f3190j);
ChatActivity.this.f3189i.o(ChatActivity.this.f3190j, true);
ChatActivity.this.f3188h.setSelection(ChatActivity.this.f3189i.getCount());
}
}
public g0() {
}
@Override
public void onReceive(Context context, Intent intent) {
if ("com.showself.send_openfiremsg_success".equals(intent.getAction())) {
List<MessageInfo> e2 = ChatActivity.this.Q.e(ChatActivity.this.o, ChatActivity.this.n, 0, ChatActivity.this.f3190j.size());
if (e2 != null && e2.size() > 0) {
d.a.a.b.f.c(e2.get(0).getMessage(), new a(e2));
}
abortBroadcast();
return;
}
if ("com.showself.receive_openfiremsg".equals(intent.getAction())) {
Bundle extras = intent.getExtras();
String string = extras.getString(PrivacyItem.PrivacyRule.SUBSCRIPTION_FROM);
int i2 = extras.getInt("type");
if (Integer.parseInt(string) == ChatActivity.this.n) {
if (i2 != 4) {
com.showself.utils.j jVar = ChatActivity.this.a;
String str = ChatActivity.this.n + "";
?? r1 = ChatActivity.this;
jVar.i(str, r1.d, r1);
}
ChatActivity.this.Q.q(1, ChatActivity.this.n, ChatActivity.this.o);
}
if (ChatActivity.this.x.t("5", ChatActivity.this.c.getUserId(), ChatActivity.this.n)) {
ChatActivity.this.Q.o(ChatActivity.this.c.getUserId());
}
List<MessageInfo> e3 = ChatActivity.this.Q.e(ChatActivity.this.o, ChatActivity.this.n, 0, ChatActivity.this.f3190j.size() + 1);
if (e3 != null && e3.size() > 0) {
d.a.a.b.f.c(e3.get(0).getMessage(), new b(e3));
}
abortBroadcast();
return;
}
if (!"com.showself.action_openfire_msg_sendfail".equals(intent.getAction())) {
if ("com.showself.action_openfire_login_success".equals(intent.getAction())) {
ChatActivity.this.f3187g.setText(ChatActivity.this.q);
return;
} else {
if ("com.showself.action_openfire_connect_close".equals(intent.getAction())) {
ChatActivity.this.f3187g.setText("未连接");
return;
}
return;
}
}
if (ChatActivity.this.f3190j != null) {
long longExtra = intent.getLongExtra("msgid", -1L);
Iterator it = ChatActivity.this.f3190j.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
MessageInfo messageInfo = (MessageInfo) it.next();
if (longExtra == Long.parseLong(messageInfo.getId())) {
messageInfo.setState(4);
break;
}
}
}
Message obtainMessage = ChatActivity.this.H0.obtainMessage();
obtainMessage.obj = Float.valueOf(10.0f);
ChatActivity.this.H0.sendMessage(obtainMessage);
abortBroadcast();
}
}
class h implements com.showself.utils.l {
h() {
}
@Override
public void a(boolean z) {
ChatActivity chatActivity = ChatActivity.this;
chatActivity.O1(chatActivity.n, 1);
}
}
private class h0 implements View.OnClickListener {
private PropInfo a;
public h0(int i2) {
this.a = (PropInfo) ChatActivity.this.C.get(i2);
}
@Override
public void onClick(View view) {
ChatActivity.this.G = this.a.getCategory();
if (view.getId() != 2131296454) {
if (ChatActivity.this.z.v() < this.a.getVip_level()) {
String string = this.a.getVip_level() == 1 ? ChatActivity.this.getString(R.string.card_vip_level1) : this.a.getVip_level() == 2 ? ChatActivity.this.getString(R.string.card_vip_level2) : this.a.getVip_level() == 3 ? ChatActivity.this.getString(R.string.card_vip_level3) : null;
String str = ChatActivity.this.getString(R.string.card_prop_alert1) + string + ChatActivity.this.getString(R.string.card_prop_alert2) + string + ChatActivity.this.getString(R.string.card_prop_alert3);
?? r1 = ChatActivity.this;
r1.I1(str, r1.getString(R.string.card_prop_alert4), ChatActivity.this.getString(R.string.negative));
} else if (this.a.getOwn_num() <= 0) {
ChatActivity.this.s1(ChatActivity.this.x.g(134, this.a.getAdmin_pid() + "") + ChatActivity.this.getString(R.string.card_pay_alert1) + this.a.getSpend() + ChatActivity.this.getString(R.string.card_pay_alert2), this.a.getAdmin_pid());
}
}
ChatActivity.this.L0.dismiss();
ChatActivity.this.L0 = null;
}
}
class i implements com.showself.utils.l {
i() {
}
@Override
public void a(boolean z) {
ChatActivity chatActivity = ChatActivity.this;
chatActivity.Q1(0, chatActivity.n, 3, "");
}
}
class j implements View.OnClickListener {
j() {
}
@Override
public void onClick(View view) {
?? r2 = ChatActivity.this;
r2.u1(r2.getString(R.string.block_user_alert));
}
}
class k extends Handler {
k() {
}
@Override
public void handleMessage(Message message) {
if (((int) ((Float) message.obj).floatValue()) == 10) {
ChatActivity.this.f3189i.o(ChatActivity.this.f3190j, true);
ChatActivity.this.f3188h.setSelection(ChatActivity.this.f3189i.getCount());
}
}
}
class l implements View.OnClickListener {
l() {
}
@Override
public void onClick(View view) {
?? r2 = ChatActivity.this;
r2.w1(r2.getString(R.string.report_user_alert));
}
}
class m implements View.OnClickListener {
final com.showself.view.q a;
m(ChatActivity chatActivity, com.showself.view.q qVar) {
this.a = qVar;
}
@Override
public void onClick(View view) {
this.a.b();
}
}
class n implements View.OnClickListener {
n() {
}
@Override
public void onClick(View view) {
ChatActivity.this.u0.setVisibility(8);
ChatActivity.this.t0.setVisibility(8);
ChatActivity.this.y.setImageResource(R.drawable.icon_gift);
}
}
class o implements DialogInterface.OnDismissListener {
o() {
}
@Override
public void onDismiss(DialogInterface dialogInterface) {
ChatActivity.this.findViewById(2131297797).setVisibility(0);
}
}
class p implements Runnable {
final EditText a;
p(EditText editText) {
this.a = editText;
}
@Override
public void run() {
ChatActivity.this.Q0.showSoftInput(this.a, 0);
}
}
class q implements View.OnClickListener {
final EditText a;
final com.showself.view.q b;
q(EditText editText, com.showself.view.q qVar) {
this.a = editText;
this.b = qVar;
}
@Override
public void onClick(View view) {
String obj = this.a.getText().toString();
if (!TextUtils.isEmpty(obj)) {
if (Integer.parseInt(obj) > 3344) {
Utils.Z0(ChatActivity.this, "礼物数量至多3344");
return;
}
if (Integer.parseInt(obj) == 0) {
obj = "1";
}
ChatActivity.this.U = Integer.parseInt(obj);
ChatActivity.this.m0.setText("" + ChatActivity.this.U);
}
this.b.b();
}
}
class r implements TextWatcher {
final EditText a;
r(ChatActivity chatActivity, EditText editText) {
this.a = editText;
}
@Override
public void afterTextChanged(Editable editable) {
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
if (charSequence != null) {
String charSequence2 = charSequence.toString();
if (TextUtils.isEmpty(charSequence2) || Integer.parseInt(charSequence2) <= 3344) {
return;
}
this.a.setText("3344");
this.a.setSelection(4);
}
}
}
class s extends BaseAdapter {
class a implements View.OnClickListener {
a() {
}
@Override
public void onClick(View view) {
if (Utils.o0()) {
return;
}
f.d.b bVar = (f.d.b) view.getTag();
if (bVar != null) {
ChatActivity.this.V = bVar.a;
ChatActivity.this.U = bVar.b;
}
ChatActivity.this.p0.dismiss();
if (ChatActivity.this.U == 0) {
ChatActivity.this.P1();
return;
}
ChatActivity.this.m0.setText("" + ChatActivity.this.U);
}
}
s() {
}
@Override
public int getCount() {
return ChatActivity.this.S.f0.size();
}
@Override
public Object getItem(int i2) {
return ((f.d.b) ChatActivity.this.S.f0.get(i2)).c;
}
@Override
public long getItemId(int i2) {
return i2;
}
@Override
public View getView(int i2, View view, ViewGroup viewGroup) {
if (view == null) {
view = View.inflate(ChatActivity.this.S, R.layout.show_popup_item, null);
view.setLayoutParams(ChatActivity.this.r0);
}
TextView textView = (TextView) view;
if (((f.d.b) ChatActivity.this.S.f0.get(i2)).b == 0) {
textView.setText(((f.d.b) ChatActivity.this.S.f0.get(i2)).c);
} else {
textView.setText(((f.d.b) ChatActivity.this.S.f0.get(i2)).b + "");
}
textView.setTag(ChatActivity.this.S.f0.get(i2));
view.setOnClickListener(new a());
return view;
}
}
class t implements com.r.c.d {
t() {
}
@Override
public void onRequestFinish(com.r.c.c cVar, Object obj) {
ChatActivity.this.E1(obj);
}
}
class u extends Handler {
u() {
}
@Override
public void handleMessage(Message message) {
ChatActivity chatActivity = ChatActivity.this;
if (chatActivity.I0 == null) {
return;
}
chatActivity.refresh(Integer.valueOf(message.what), message.obj, Integer.valueOf(message.arg1));
}
}
class v extends Thread {
class a implements Runnable {
a() {
}
@Override
public void run() {
ChatActivity.this.f3187g.setText(ChatActivity.this.q);
}
}
class b implements Runnable {
b() {
}
@Override
public void run() {
ChatActivity.this.f3187g.setText("未连接");
}
}
v() {
}
@Override
public void run() {
androidx.fragment.app.b bVar;
Runnable bVar2;
androidx.fragment.app.b bVar3;
Runnable aVar;
try {
try {
ChatActivity.this.a.d(ChatActivity.this.c.getUserId());
com.showself.utils.j jVar = ChatActivity.this.a;
String str = ChatActivity.this.n + "";
?? r2 = ChatActivity.this;
jVar.i(str, r2.d, r2);
} catch (Exception e2) {
e2.printStackTrace();
if (ChatActivity.this.a.h()) {
bVar3 = ChatActivity.this;
aVar = new a();
} else {
bVar = ChatActivity.this;
bVar2 = new b();
}
}
if (ChatActivity.this.a.h()) {
bVar3 = ChatActivity.this;
aVar = new a();
bVar3.runOnUiThread(aVar);
} else {
bVar = ChatActivity.this;
bVar2 = new b();
bVar.runOnUiThread(bVar2);
}
} catch (Throwable th) {
if (ChatActivity.this.a.h()) {
ChatActivity.this.runOnUiThread(new a());
} else {
ChatActivity.this.runOnUiThread(new b());
}
throw th;
}
}
}
class w implements t.o {
w() {
}
@Override
public void a(int i2) {
ChatActivity.this.r1(i2);
}
@Override
public void b(String str, int i2, boolean z) {
ChatActivity.this.M1(str, i2, z);
}
@Override
public void c(String str, long j2) {
ChatActivity.this.Q.c(str, j2);
ChatActivity.this.t1(str);
}
}
class x implements Runnable {
x() {
}
@Override
public void run() {
?? r0 = ChatActivity.this;
((ChatActivity) r0).f3185e = (ImageView) r0.findViewById(R.id.iv_history_back);
?? r02 = ChatActivity.this;
((ChatActivity) r02).f3186f = (ImageView) r02.findViewById(R.id.tv_clear_record);
?? r03 = ChatActivity.this;
((ChatActivity) r03).y0 = (RelativeLayout) r03.findViewById(2131298347);
?? r04 = ChatActivity.this;
((ChatActivity) r04).z0 = (ImageView) r04.findViewById(2131297053);
?? r05 = ChatActivity.this;
((ChatActivity) r05).D0 = (SVGAImageView) r05.findViewById(2131298742);
?? r06 = ChatActivity.this;
((ChatActivity) r06).E0 = (TextView) r06.findViewById(2131299123);
?? r07 = ChatActivity.this;
((ChatActivity) r07).A0 = (ImageView) r07.findViewById(2131297136);
?? r08 = ChatActivity.this;
((ChatActivity) r08).B0 = (ImageView) r08.findViewById(2131297140);
?? r09 = ChatActivity.this;
((ChatActivity) r09).F0 = (TextView) r09.findViewById(2131299122);
?? r010 = ChatActivity.this;
((ChatActivity) r010).C0 = (ImageView) r010.findViewById(2131297052);
ChatActivity.this.f3185e.setOnClickListener(ChatActivity.this.R);
ChatActivity.this.f3186f.setVisibility(0);
ChatActivity.this.f3186f.setOnClickListener(ChatActivity.this.R);
ChatActivity.this.C0.setOnClickListener(ChatActivity.this.R);
ChatActivity.this.y0.setOnClickListener(ChatActivity.this.R);
ChatActivity.this.f3187g.setSelected(true);
?? r011 = ChatActivity.this;
r011.I = ImageLoader.getInstance(r011.getApplicationContext());
ChatActivity.this.init();
?? r012 = ChatActivity.this;
((ChatActivity) r012).H = (LinearLayout) r012.findViewById(2131297749);
ChatActivity.this.H.setVisibility(8);
if (!TextUtils.isEmpty(ChatActivity.this.v) && ChatActivity.this.L != 24) {
ChatActivity.this.l.setText(ChatActivity.this.v);
ChatActivity.this.m.performClick();
} else if (ChatActivity.this.L == 24 && !TextUtils.isEmpty(ChatActivity.this.v)) {
ChatActivity chatActivity = ChatActivity.this;
chatActivity.M1(chatActivity.v, ChatActivity.this.L, false);
}
?? r013 = ChatActivity.this;
((ChatActivity) r013).y = (ImageView) r013.findViewById(2131297065);
ChatActivity.this.y.setOnClickListener(ChatActivity.this.R);
if (ChatActivity.this.x.t("5", ChatActivity.this.c.getUserId(), ChatActivity.this.n)) {
ChatActivity.this.Q.o(ChatActivity.this.c.getUserId());
}
ChatActivity chatActivity2 = ChatActivity.this;
chatActivity2.K = (InputMethodManager) chatActivity2.l.getContext().getSystemService("input_method");
ChatActivity chatActivity3 = ChatActivity.this;
chatActivity3.B1(chatActivity3.n);
}
}
class y implements AbsListView.OnScrollListener {
class a implements Runnable {
a() {
}
@Override
public void run() {
ChatActivity.this.f3189i.o(ChatActivity.this.f3190j, true);
}
}
y() {
}
@Override
public void onScroll(AbsListView absListView, int i2, int i3, int i4) {
if (ChatActivity.this.J != 0 && i2 == 0 && ChatActivity.this.O) {
ChatActivity.this.C1(new a());
}
}
@Override
public void onScrollStateChanged(AbsListView absListView, int i2) {
ChatActivity.this.J = i2;
}
}
class z implements EmojiView.d {
z() {
}
public void a(String str) {
ChatActivity.this.l.append(d.a.a.b.e.b(str));
}
}
private String A1(String str, String str2, String str3, int i2) {
return String.format(this.O0, str, str2, Integer.valueOf(i2), str3);
}
public void B1(int i2) {
JSONArray jSONArray = new JSONArray();
jSONArray.put(i2);
com.r.c.a aVar = new com.r.c.a();
aVar.d("uids", jSONArray);
new com.r.c.c(com.r.c.c.k("v2/users/baseInfo", 1), aVar, new com.r.c.b(1), this).y(new t());
}
public void C1(Runnable runnable) {
Thread thread = this.J0;
if ((thread == null || !thread.isAlive()) && this.O) {
Utils.U0(this);
Thread thread2 = new Thread(new b0(runnable));
this.J0 = thread2;
thread2.start();
}
}
public void D1() {
new com.r.c.c(com.r.c.c.k(com.showself.net.e.P1, 1), new com.r.c.a(), new com.r.c.b(1), this).v(new e());
}
public void E1(Object obj) {
if (obj instanceof JSONObject) {
JSONObject jSONObject = (JSONObject) obj;
int optInt = jSONObject.optInt(com.showself.net.e.n1);
jSONObject.optString(com.showself.net.e.o1);
if (optInt != 0 || jSONObject.optJSONObject("data") == null) {
this.y0.setVisibility(8);
return;
}
ArrayList<MessageBaseInfo> arrayToBean = MessageBaseInfo.arrayToBean(jSONObject.optJSONObject("data").optJSONArray("entities"));
if (arrayToBean.size() <= 0) {
this.y0.setVisibility(8);
return;
}
if (this.n != arrayToBean.get(0).getUid()) {
this.y0.setVisibility(8);
return;
}
MessageBaseInfo messageBaseInfo = arrayToBean.get(0);
this.G0 = messageBaseInfo;
this.s = messageBaseInfo.getRelation();
if (this.G0.getRelation() != 0 && this.G0.getRelation() != 1) {
this.y0.setVisibility(8);
} else {
this.y0.setVisibility(0);
K1(this.G0);
}
}
}
public void F1(Object obj) {
if (obj instanceof JSONObject) {
JSONObject jSONObject = (JSONObject) obj;
int optInt = jSONObject.optInt(com.showself.net.e.n1);
String optString = jSONObject.optString(com.showself.net.e.o1);
if (optInt != 0) {
Utils.a1(optString);
return;
}
JSONObject optJSONObject = jSONObject.optJSONObject("data");
optJSONObject.optJSONArray("bag");
this.Z = optJSONObject.optLong("money");
p1(new LinkedHashMap<>());
if (this.d0) {
R1(0, true);
this.d0 = false;
}
int i2 = this.b0;
if (i2 == 0 || i2 != 2) {
return;
}
R1(0, true);
this.b0 = 0;
}
}
public void G1(String str) {
Utils.Q0(this, null, getString(R.string.check_ta_location) + str + getString(R.string.check_ta_location2), getString(R.string.copy_location), getResources().getColor(2131099757), getString(R.string.positive), getResources().getColor(2131099758), new g(str), true);
}
public void H1() {
com.showself.view.q qVar = new com.showself.view.q();
View inflate = LayoutInflater.from(this).inflate(R.layout.layout_chat_block_user, (ViewGroup) null);
((TextView) inflate.findViewById(2131298977)).setOnClickListener(new j());
((TextView) inflate.findViewById(2131299483)).setOnClickListener(new l());
((TextView) inflate.findViewById(2131298976)).setOnClickListener(new m(this, qVar));
qVar.k(this, inflate, 1.0f, 80, -1, com.showself.utils.r.a(152.0f), 2131755759);
}
public void I1(String str, String str2, String str3) {
Utils.Q0(this, null, str, str3, getResources().getColor(2131099757), str2, getResources().getColor(2131099758), new c(str2), true);
}
private void J1() {
List<PropInfo> list = this.C;
if (list == null || list.size() == 0) {
return;
}
this.L0 = new Dialog(this, 2131755755);
View inflate = View.inflate(this, R.layout.prop_dialog, null);
((GridView) inflate.findViewById(R.id.gv_prop_list)).setAdapter((ListAdapter) new a());
((Button) inflate.findViewById(R.id.btn_cancle)).setOnClickListener(new h0(0));
this.L0.setContentView(inflate);
this.L0.getWindow().setLayout(-1, -2);
this.L0.getWindow().setGravity(80);
this.L0.getWindow().setWindowAnimations(2131755745);
this.L0.setCanceledOnTouchOutside(true);
this.L0.show();
}
private void K1(MessageBaseInfo messageBaseInfo) {
if (messageBaseInfo != null) {
com.sjvangogh.a.g(this, messageBaseInfo.getAvatar(), 2131231470, 2131231470, this.z0);
this.E0.setText(messageBaseInfo.getNickname());
this.F0.setText(messageBaseInfo.getIntro());
if (TextUtils.isEmpty(messageBaseInfo.getAnchorLevelUrl())) {
this.A0.setVisibility(8);
} else {
this.A0.setVisibility(0);
com.sjvangogh.a.l(this.S, messageBaseInfo.getAnchorLevelUrl(), this.A0);
}
if (TextUtils.isEmpty(messageBaseInfo.getUserLevelUrl())) {
this.B0.setVisibility(8);
} else {
this.B0.setVisibility(0);
com.sjvangogh.a.l(this.S, messageBaseInfo.getUserLevelUrl(), this.B0);
}
if (!messageBaseInfo.isAnchor()) {
if (this.D0.k()) {
com.sjvangogh.a.t(this.D0);
}
this.D0.setVisibility(8);
} else if (messageBaseInfo.getLiveStatus() != 1) {
if (this.D0.k()) {
com.sjvangogh.a.t(this.D0);
}
this.D0.setVisibility(8);
} else {
this.D0.setVisibility(0);
if (this.D0.k()) {
return;
}
com.sjvangogh.a.r(this, "living.svga", this.D0);
}
}
}
private void N1(java.lang.String r38, java.lang.String r39, int r40, int r41, java.lang.String r42, java.lang.String r43, int r44, int r45, int r46) {
throw new UnsupportedOperationException("Method not decompiled: com.showself.ui.notificationbox.ChatActivity.N1(java.lang.String, java.lang.String, int, int, java.lang.String, java.lang.String, int, int, int):void");
}
public void O1(int i2, int i3) {
HashMap hashMap = new HashMap();
hashMap.put("fuid", Integer.valueOf(i2));
hashMap.put("type", Integer.valueOf(i3));
addTask(new com.showself.service.f(10059, hashMap), getApplicationContext());
}
public void P1() {
findViewById(2131297797).setVisibility(8);
View inflate = LayoutInflater.from(this).inflate(2131494255, (ViewGroup) null);
com.showself.view.q qVar = new com.showself.view.q();
qVar.l(this.S, inflate, 1.0f, 80, -1, -2, 0, 2131755759);
EditText editText = (EditText) inflate.findViewById(2131296691);
qVar.h(new o());
editText.setFocusable(true);
editText.setFocusableInTouchMode(true);
editText.requestFocus();
this.Q0 = (InputMethodManager) editText.getContext().getSystemService("input_method");
new Handler().postDelayed(new p(editText), 100L);
((TextView) inflate.findViewById(2131299082)).setOnClickListener(new q(editText, qVar));
editText.addTextChangedListener(new r(this, editText));
}
public void Q1(int i2, int i3, int i4, String str) {
HashMap hashMap = new HashMap();
hashMap.put("roomid", Integer.valueOf(i2));
hashMap.put("fuid", Integer.valueOf(i3));
hashMap.put(AuthActivity.ACTION_KEY, Integer.valueOf(i4));
hashMap.put("note", str);
if (i4 == 3) {
hashMap.put("flag", 0);
}
addTask(new com.showself.service.f(20004, hashMap), getApplicationContext());
}
public void S1(View view) {
ArrayList<f.d.b> arrayList;
ChatActivity chatActivity = this.S;
if (chatActivity == null || (arrayList = chatActivity.f0) == null || arrayList.size() <= 0) {
return;
}
if (this.p0 == null) {
View inflate = ((LayoutInflater) this.S.getSystemService("layout_inflater")).inflate(R.layout.group_list, (ViewGroup) null);
this.q0 = (ListView) inflate.findViewById(R.id.lv_show);
this.p0 = new PopupWindow(inflate, com.showself.utils.r.b(this.S, 108.0f), com.showself.utils.r.b(this.S, 163.0f));
}
if (this.r0 == null) {
this.r0 = new AbsListView.LayoutParams(-1, com.showself.utils.r.b(this.S, 33.0f));
}
this.q0.setAdapter((ListAdapter) new s());
this.p0.setFocusable(true);
this.p0.setOutsideTouchable(true);
this.p0.setBackgroundDrawable(new BitmapDrawable());
int[] iArr = new int[2];
view.getLocationInWindow(iArr);
this.p0.showAtLocation(view, 51, (iArr[0] + view.getWidth()) - this.p0.getWidth(), iArr[1] - this.p0.getHeight());
}
private List<PropInfo> T1(List<PropInfo> list) {
ArrayList arrayList = new ArrayList();
PropInfo propInfo = null;
PropInfo propInfo2 = null;
PropInfo propInfo3 = null;
for (PropInfo propInfo4 : list) {
if (propInfo4.getCategory() == 2) {
propInfo3 = propInfo4;
} else if (propInfo4.getCategory() == 3) {
propInfo2 = propInfo4;
} else if (propInfo4.getCategory() == 1) {
propInfo = propInfo4;
}
}
if (propInfo != null) {
arrayList.add(propInfo);
}
if (propInfo2 != null) {
arrayList.add(propInfo2);
}
if (propInfo3 != null) {
arrayList.add(propInfo3);
}
return arrayList;
}
private void p1(LinkedHashMap<String, ArrayList<GiftBean>> linkedHashMap) {
ArrayList<GiftBean> arrayList = new ArrayList<>();
if (linkedHashMap != null && linkedHashMap.containsKey(ResourceManager.BACKPACK)) {
arrayList.addAll(linkedHashMap.get(ResourceManager.BACKPACK));
}
if (this.e0.containsKey(ResourceManager.BACKPACK)) {
this.e0.remove(ResourceManager.BACKPACK);
}
this.e0.put(ResourceManager.BACKPACK, arrayList);
}
public void q1(int i2) {
if (i2 > 1) {
for (int i3 = 0; i3 < i2; i3++) {
RadioButton radioButton = new RadioButton(this);
radioButton.setButtonDrawable(new BitmapDrawable());
radioButton.setBackgroundResource(2131232947);
if (this.s0 == null) {
RadioGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(com.showself.utils.r.b(this, 6.0f), com.showself.utils.r.b(this, 6.0f));
this.s0 = layoutParams;
layoutParams.leftMargin = com.showself.utils.r.b(this, 6.0f);
}
radioButton.setLayoutParams(this.s0);
this.o0.addView(radioButton);
}
((RadioButton) this.o0.getChildAt(0)).setChecked(true);
}
}
public void u1(String str) {
Utils.Q0(this, getString(R.string.prompt), str, null, 0, getString(R.string.positive), getResources().getColor(2131099758), new h(), true);
}
private void v1(String str) {
Utils.Q0(this, getString(2131690737), str, getString(R.string.negative), getResources().getColor(2131099757), getString(R.string.get_money_free), getResources().getColor(2131099758), new f(), true);
}
public void w1(String str) {
Utils.Q0(this, getString(R.string.prompt), str, null, 0, getString(R.string.positive), getResources().getColor(2131099758), new i(), true);
}
private void x1() {
this.l.addTextChangedListener(new a0());
}
public void y1(int i2) {
if (this.x0) {
return;
}
this.x0 = true;
HashMap hashMap = new HashMap();
hashMap.put("fuid", Integer.valueOf(this.n));
hashMap.put("type", Integer.valueOf(i2));
addTask(new com.showself.service.f(10052, hashMap), this, this.I0);
}
private String z1(String str, int i2, String str2, int i3) {
return String.format(this.P0, str, Integer.valueOf(i2), str2, Integer.valueOf(i3));
}
public void L1() {
RelativeLayout relativeLayout = this.u0;
if (relativeLayout != null) {
relativeLayout.setVisibility(8);
this.y.setImageResource(R.drawable.icon_gift);
}
this.T = this.n;
if (this.V == 0) {
this.V = this.S.f0.get(0).a;
}
int i2 = this.W;
if (i2 <= 0) {
HashMap hashMap = new HashMap();
hashMap.put("fuid", Integer.valueOf(this.T));
hashMap.put("giftid", Integer.valueOf(this.Y));
hashMap.put("gifttpl_id", Integer.valueOf(this.V));
hashMap.put("giftcount", Integer.valueOf(this.U));
this.S.addTask(new com.showself.service.f(20026, hashMap), this);
return;
}
if (i2 < this.U) {
Utils.Y0(this.S, 2131690903);
return;
}
HashMap hashMap2 = new HashMap();
hashMap2.put("category", "999");
hashMap2.put("fuid", Integer.valueOf(this.T));
hashMap2.put("giftid", Integer.valueOf(this.Y));
hashMap2.put("gifttpl_id", Integer.valueOf(this.V));
hashMap2.put("giftcount", Integer.valueOf(this.U));
this.S.addTask(new com.showself.service.f(20026, hashMap2), this);
}
public void M1(String str, int i2, boolean z2) {
long j2;
MessageInfo messageInfo;
long j3;
String str2;
long currentTimeMillis = System.currentTimeMillis() / 1000;
List<MessageInfo> list = this.f3190j;
if (list == null || list.size() == 0) {
j2 = 0;
} else {
List<MessageInfo> list2 = this.f3190j;
j2 = list2.get(list2.size() - 1).getSysdateline() + 1;
}
int i3 = this.o;
MessageInfo messageInfo2 = new MessageInfo(i3, this.n, str, i2, 0, currentTimeMillis, i3, "", 12.0d, 13.0d, this.r, this.c.getGender(), 0, "", "", j2, this.c.getUserName());
messageInfo2.setState(2);
String F = Utils.F();
messageInfo2.setMessageKey(F);
this.f3190j.add(messageInfo2);
long j4 = -1;
try {
j4 = this.Q.g(messageInfo2);
} catch (Exception e2) {
e2.printStackTrace();
}
long j5 = j4;
if (j5 < 0) {
return;
}
LoginResultInfo loginResultInfo = this.c;
if (loginResultInfo != null) {
int i4 = this.o;
messageInfo = messageInfo2;
j3 = j5;
str2 = "";
MessageUserInfo messageUserInfo = new MessageUserInfo(i4, this.n, str, i2, 2, currentTimeMillis, i4, this.p, loginResultInfo.getGender(), this.q, this.s, this.n);
messageUserInfo.setMessageKey(F);
try {
this.Q.h(messageUserInfo, true);
} catch (Exception e3) {
e3.printStackTrace();
}
this.l.setText(str2);
} else {
messageInfo = messageInfo2;
j3 = j5;
str2 = "";
}
StringBuilder sb = new StringBuilder();
long j6 = j3;
sb.append(j6);
sb.append(str2);
MessageInfo messageInfo3 = messageInfo;
messageInfo3.setId(sb.toString());
LoginResultInfo loginResultInfo2 = this.c;
String a2 = loginResultInfo2 != null ? com.showself.utils.h.a(messageInfo3, loginResultInfo2.getUserName(), this.s) : str2;
this.x.u(this.o, this.n, "4");
com.showself.ui.notificationbox.a.d(getApplicationContext()).g(this.n, j6, a2, this.Q);
this.f3189i.o(this.f3190j, true);
this.f3188h.setSelection(this.f3189i.getCount());
if (z2) {
messageInfo3.setMessage(this.N0);
}
}
public void R1(int i2, boolean z2) {
this.t0.setOnClickListener(new n());
RelativeLayout relativeLayout = this.u0;
if (relativeLayout != null && relativeLayout.isShown()) {
this.y.setImageResource(R.drawable.icon_gift);
this.u0.setVisibility(8);
this.t0.setVisibility(8);
return;
}
this.y.setImageResource(R.drawable.icon_gift_pink);
this.T = i2;
this.V = 0;
this.U = 1;
this.h0 = (LinearLayout) findViewById(R.id.ll_show_addtab);
TextView textView = (TextView) findViewById(2131299533);
this.i0 = textView;
textView.setText(String.valueOf(this.Z));
this.j0 = findViewById(2131299827);
this.k0 = (Button) findViewById(2131296432);
this.l0 = (RelativeLayout) findViewById(2131298354);
TextView textView2 = (TextView) findViewById(2131299534);
this.m0 = textView2;
textView2.setText("1");
this.n0 = (ImageView) findViewById(2131297491);
this.o0 = (RadioGroup) findViewById(2131298225);
c0 c0Var = new c0();
findViewById(2131299535).setOnClickListener(c0Var);
this.i0.setOnClickListener(c0Var);
this.n0.setOnClickListener(c0Var);
this.l0.setOnClickListener(c0Var);
this.k0.setOnClickListener(c0Var);
e0 e0Var = new e0();
this.o0.removeAllViews();
w0.a(this.S);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
layoutParams.gravity = 16;
layoutParams.width = w0.a / 5;
Iterator<Map.Entry<String, ArrayList<GiftBean>>> it = this.S.e0.entrySet().iterator();
for (int i3 = 0; it.hasNext() && i3 <= 5; i3++) {
it.next().getKey();
}
this.Y = 0;
if (this.S.e0 != null) {
this.h0.removeAllViews();
for (Map.Entry<String, ArrayList<GiftBean>> entry : this.S.e0.entrySet()) {
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(com.showself.utils.r.b(this, 40.0f), com.showself.utils.r.b(this, 24.0f));
layoutParams2.gravity = 16;
layoutParams2.leftMargin = com.showself.utils.r.b(this, 6.0f);
layoutParams2.rightMargin = com.showself.utils.r.b(this, 6.0f);
String key = entry.getKey();
Button button = new Button(this.S);
button.setBackgroundDrawable(null);
button.setTextColor(Color.parseColor("#b2b2b2"));
button.setTextSize(0, com.showself.utils.r.b(this, 12.0f));
button.setText(key);
button.setSingleLine();
button.setTag(entry);
button.setGravity(17);
button.setOnClickListener(e0Var);
button.setPadding(0, 0, 0, 0);
this.h0.addView(button, layoutParams2);
}
Button button2 = (Button) this.h0.getChildAt(0);
button2.setTextSize(0, com.showself.utils.r.b(this, 13.0f));
button2.setTextColor(Color.parseColor("#444444"));
button2.setBackgroundResource(R.drawable.icon_gift_tab_bg);
ArrayList<GiftBean> arrayList = this.S.e0.get(button2.getText().toString());
if (arrayList.size() % 8 == 0) {
this.a0 = arrayList.size() / 8;
} else {
this.a0 = (arrayList.size() / 8) + 1;
}
q1(this.a0);
this.j0.setOnPageChangeListener(new f0());
this.j0.setOffscreenPageLimit(this.a0);
}
this.H.setVisibility(8);
this.t0.setVisibility(0);
this.u0.setVisibility(0);
this.K.hideSoftInputFromWindow(this.l.getWindowToken(), 2);
this.u.setVisibility(8);
}
@Override
public void init() {
this.f3188h.setAdapter((ListAdapter) this.f3189i);
this.f3189i.notifyDataSetChanged();
this.f3188h.setSelection(this.f3189i.getCount());
this.f3188h.setOnScrollListener(new y());
this.f3189i.p(this.w0);
ImageView imageView = (ImageView) findViewById(2131296420);
this.f3191k = imageView;
imageView.setOnClickListener(this.R);
EditText editText = (EditText) findViewById(R.id.et_chat_context);
this.l = editText;
editText.setFocusable(false);
this.l.setFocusableInTouchMode(false);
this.l.setOnClickListener(this.R);
Button button = (Button) findViewById(2131296460);
this.m = button;
button.setOnClickListener(this.R);
Button button2 = (Button) findViewById(R.id.btn_chat_add);
this.A = button2;
button2.setOnClickListener(this.R);
this.m.setVisibility(0);
x1();
EmojiView findViewById = findViewById(R.id.emoji_view);
this.u = findViewById;
findViewById.setOnEmojiClickListener(new z());
this.u.setVisibility(8);
}
@Override
protected void onActivityResult(int i2, int i3, Intent intent) {
RelativeLayout relativeLayout;
if (i3 == -1 && i2 == 100) {
int intExtra = intent.getIntExtra("followType", 0);
int intExtra2 = intent.getIntExtra("id", 0);
if (intExtra == 0 || intExtra2 == 0) {
return;
}
int i4 = this.n;
if (i4 == intExtra2 && (relativeLayout = this.y0) != null) {
if (intExtra == 1) {
this.s = 2;
relativeLayout.setVisibility(8);
} else if (intExtra == 2) {
B1(i4);
}
}
}
super.onActivityResult(i2, i3, intent);
}
public boolean onContextItemSelected(MenuItem menuItem) {
String charSequence = menuItem.getIntent().getExtras().getCharSequence(PushConstants.CONTENT).toString();
long j2 = menuItem.getIntent().getExtras().getLong("time");
String string = menuItem.getIntent().getExtras().getString("id");
int itemId = menuItem.getItemId();
if (itemId == 0) {
((ClipboardManager) getSystemService("clipboard")).setText(charSequence);
} else if (itemId == 1) {
this.Q.c(string, j2);
t1(string);
} else if (itemId == 2) {
this.w = charSequence;
this.m.performClick();
}
return true;
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.chat_new_tab);
this.S = this;
this.R = new d0(this, null);
this.Q = new com.showself.provider.c();
this.c = r0.y(this);
this.a = com.showself.utils.j.f();
this.f3188h = (ListView) findViewById(R.id.lv_chat_context);
this.u0 = (RelativeLayout) findViewById(2131298568);
this.t0 = findViewById(R.id.view_cover);
ImageView imageView = (ImageView) findViewById(R.id.iv_input_emoji);
this.B = imageView;
imageView.setOnClickListener(this.R);
this.u0.setVisibility(8);
this.t0.setVisibility(8);
this.f3187g = (TextView) findViewById(2131299036);
Bundle extras = getIntent().getExtras();
this.n = extras.getInt("fuid");
new v().start();
this.z = k0.k();
LoginResultInfo loginResultInfo = this.c;
if (loginResultInfo != null) {
this.o = loginResultInfo.getUserId();
this.r = this.c.getAvatar();
}
this.x = com.showself.provider.f.h();
IntentFilter intentFilter = new IntentFilter();
this.P = intentFilter;
intentFilter.addAction("com.showself.receive_openfiremsg");
this.P.addAction("com.showself.send_openfiremsg_success");
this.P.addAction("com.showself.action_openfire_msg_sendfail");
this.P.addAction("com.showself.action_openfire_login_success");
this.P.addAction("com.showself.action_openfire_connect_close");
this.P.setPriority(1000);
this.b = new g0();
this.p = extras.getString("favatar");
this.q = extras.getString("fnickname");
this.t = extras.getInt("f_gender");
this.b0 = extras.getInt("skip_type");
this.w0 = extras.getString("isOfficial");
if (extras.containsKey("autosend")) {
this.v = extras.getString("autosend");
}
if (extras.containsKey("type")) {
this.L = extras.getInt("type");
}
this.f3189i = new com.r.b.t(this, this.n, this.f3190j, this.p, new w());
C1(new x());
this.f0.addAll(ResourceManager.getGiftTplsListRemoveZeroData());
D1();
}
@Override
protected void onDestroy() {
super.onDestroy();
this.f3189i.r();
NotificationNumber.getShareNotificationNum().setChatNum(this.Q.d(this.c.getUserId()));
}
public boolean onKeyDown(int i2, KeyEvent keyEvent) {
if (i2 != 4 || keyEvent.getRepeatCount() != 0) {
return super/*android.app.Activity*/.onKeyDown(i2, keyEvent);
}
if (this.u.isShown()) {
this.u.setVisibility(8);
return false;
}
finish();
return false;
}
@Override
protected void onResume() {
this.Q.q(1, this.n, this.o);
NotificationNumber.getShareNotificationNum().setChatNum(this.Q.d(this.c.getUserId()));
sendBroadcast(new Intent(com.showself.utils.e0.b));
registerReceiver(this.b, this.P);
super.onResume();
}
@Override
protected void onStop() {
unregisterReceiver(this.b);
super.onStop();
}
public void r1(int i2) {
HashMap hashMap = new HashMap();
hashMap.put("admin_pid", Integer.valueOf(i2));
hashMap.put(Oauth2AccessToken.KEY_UID, Integer.valueOf(this.c.getUserId()));
hashMap.put("fuid", Integer.valueOf(this.n));
hashMap.put("used", 2);
addTask(new com.showself.service.f(10085, hashMap), this);
}
@Override
public void refresh(Object... objArr) {
Utils.n(this);
com.showself.service.g.i(this);
this.x0 = false;
int intValue = ((Integer) objArr[0]).intValue();
HashMap hashMap = (HashMap) objArr[1];
if (hashMap != null) {
int intValue2 = ((Integer) hashMap.get(com.showself.net.e.n1)).intValue();
String str = (String) hashMap.get(com.showself.net.e.o1);
if (intValue == 10052) {
if (intValue2 != com.showself.net.e.m1 && intValue2 != -770) {
Utils.Z0(this, str);
return;
}
com.r.n.g j2 = com.r.n.g.j();
com.r.n.d c2 = com.r.n.d.c();
c2.e("Chat");
c2.f("PrivateChat");
c2.d("Follow");
c2.h(com.r.n.e.Click);
j2.u(c2.b());
int i2 = this.s;
if (i2 == 1) {
this.s = 3;
} else if (i2 == 0) {
this.s = 2;
}
this.G0.setRelation(this.s);
this.y0.setVisibility(8);
Utils.Y0(this, R.string.affinity_focus_on);
return;
}
if (intValue == 10057) {
if (intValue2 == -300 || intValue2 == -310) {
I1(str, getString(R.string.get_money_free), getString(R.string.negative));
return;
}
if (intValue2 != 0) {
Utils.Z0(this, str);
return;
}
M1(this.M0, 22, true);
this.M0 = "";
this.N0 = "";
Utils.Z0(this, str);
return;
}
if (intValue == 10059) {
if (intValue2 == com.showself.net.e.m1) {
Utils.Y0(this, R.string.block_user_success);
return;
} else {
Utils.Z0(this, str);
return;
}
}
if (intValue != 10068) {
if (intValue == 10083) {
if (intValue2 != com.showself.net.e.m1) {
Utils.Z0(this, str);
return;
}
List list = (List) hashMap.get("props");
if (list == null || list.size() <= 0) {
return;
}
List<PropInfo> T1 = T1(list);
this.C = T1;
if (T1.size() > 0) {
J1();
return;
}
return;
}
if (intValue == 10085) {
if (intValue2 == -300) {
I1(str, getString(R.string.get_money_free), getString(R.string.negative));
return;
}
if (intValue2 != 0) {
Utils.Z0(this, str);
return;
} else if (this.G != 3) {
Utils.Z0(this, str);
return;
} else {
new d((String) hashMap.get("latitude"), (String) hashMap.get("longitude")).start();
return;
}
}
if (intValue != 20004) {
if (intValue == 20025) {
if (intValue2 != com.showself.net.e.m1) {
Utils.Z0(this, str);
return;
}
this.c0 = true;
this.Z = ((Integer) hashMap.get("money")).intValue();
return;
}
if (intValue != 20026) {
return;
}
if (intValue2 != com.showself.net.e.m1) {
if (intValue2 == -300 || intValue2 == -310) {
v1(str);
return;
} else {
Utils.Z0(this, str);
return;
}
}
this.X = ((Integer) hashMap.get("money")).intValue();
this.g0 = (ArrayList) hashMap.get("packagegifts");
String str2 = (String) hashMap.get("giftname");
String str3 = (String) hashMap.get("giftimage");
int intValue3 = ((Integer) hashMap.get("lotterycount")).intValue();
int intValue4 = ((Integer) hashMap.get("lotterygold")).intValue();
int intValue5 = ((Integer) hashMap.get("giftid")).intValue();
int intValue6 = ((Integer) hashMap.get("giftcount")).intValue();
this.Z = this.X;
if (ResourceManager.BACKPACK.equals(this.v0)) {
if (this.g0 != null) {
LinkedHashMap<String, ArrayList<GiftBean>> linkedHashMap = this.e0;
if (linkedHashMap != null && linkedHashMap.containsKey(ResourceManager.BACKPACK)) {
this.e0.remove(ResourceManager.BACKPACK);
this.e0.put(ResourceManager.BACKPACK, this.g0);
}
} else {
this.g0 = new ArrayList<>();
this.e0.remove(ResourceManager.BACKPACK);
this.e0.put(ResourceManager.BACKPACK, this.g0);
}
}
N1("", "", 25, 0, str3 + "||" + str2 + "||" + intValue5 + "||" + intValue6, str2, intValue6, 0, 0);
if (intValue3 != 0 && intValue4 != 0) {
N1("", "", 26, 0, this.c.getUserName() + "||" + intValue3 + "||" + str2 + "||" + str3 + "||" + intValue4, str2, 0, intValue3, intValue4);
}
String str4 = intValue3 + "";
String str5 = intValue4 + "";
return;
}
if (intValue2 == com.showself.net.e.m1) {
Utils.Z0(this, str);
} else {
Utils.Z0(this, str);
}
}
if (intValue2 == com.showself.net.e.m1) {
return;
}
Utils.Z0(this, str);
}
}
public void s1(String str, int i2) {
Utils.Q0(this, null, str, getString(R.string.negative), getResources().getColor(2131099757), getString(R.string.positive), getResources().getColor(2131099758), new b(i2), true);
}
public void t1(String str) {
if (str == null) {
return;
}
int size = this.f3190j.size();
for (int i2 = 0; i2 < size; i2++) {
if (str.equals(this.f3190j.get(i2).getId())) {
this.f3190j.remove(i2);
this.f3189i.o(this.f3190j, true);
this.f3188h.setSelection(this.f3189i.getCount());
return;
}
}
}
}