正在查看: 95爱播免登录版 v3.1.9 应用的 MyFansActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 95爱播免登录版 v3.1.9 应用的 MyFansActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.showself.ui.activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mifeng.ui.R;
import com.r.b.m;
import com.r.b.m0;
import com.r.n.g;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.a.j;
import com.showself.domain.FriendInfo;
import com.showself.domain.LoginResultInfo;
import com.showself.event.HistoryRecordEvent;
import com.showself.ui.CardActivity;
import com.showself.utils.r0;
import com.showself.utils.u0;
import com.showself.view.ImmersiveStatusBar;
import com.sina.weibo.sdk.auth.Oauth2AccessToken;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONArray;
import org.json.JSONObject;
public class MyFansActivity extends com.showself.ui.c implements View.OnClickListener {
private SmartRefreshLayout a;
private RecyclerView b;
private ImageView c;
private LinearLayout d;
private ImmersiveStatusBar f2985e;
private m0 f2986f;
private List<FriendInfo> f2987g;
private int f2989i;
private int f2990j;
private LoginResultInfo l;
private int m;
private int f2988h = 0;
private boolean f2991k = false;
public Handler n = new a();
class a extends Handler {
a() {
}
@Override
public void handleMessage(Message message) {
MyFansActivity myFansActivity = MyFansActivity.this;
if (myFansActivity.n == null) {
return;
}
myFansActivity.refresh(Integer.valueOf(message.what), message.obj, Integer.valueOf(message.arg1));
}
}
class b implements com.scwang.smartrefresh.layout.c.e {
b() {
}
@Override
public void g(j jVar) {
if (MyFansActivity.this.f2991k) {
MyFansActivity.this.G();
} else {
MyFansActivity.this.a.r();
}
}
@Override
public void m(j jVar) {
MyFansActivity.this.f2988h = 0;
MyFansActivity.this.G();
}
}
class c implements m.c {
c() {
}
@Override
public void y(Object obj, int i2) {
FriendInfo friendInfo = (FriendInfo) MyFansActivity.this.f2987g.get(i2);
Intent intent = new Intent((Context) MyFansActivity.this, (Class<?>) CardActivity.class);
intent.putExtra("id", friendInfo.getUid());
MyFansActivity.this.startActivity(intent);
g j2 = g.j();
com.r.n.d c = com.r.n.d.c();
c.e("Me");
c.f("Fans");
c.d("User");
c.h(com.r.n.e.Click);
c.a(Oauth2AccessToken.KEY_UID, Integer.valueOf(friendInfo.getUid()));
j2.u(c.b());
}
}
class d implements com.r.c.d {
d() {
}
@Override
public void onRequestFinish(com.r.c.c cVar, Object obj) {
MyFansActivity.this.H(obj);
}
}
static class e {
static final int[] a;
static {
int[] iArr = new int[HistoryRecordEvent.Type.values().length];
a = iArr;
try {
iArr[HistoryRecordEvent.Type.FOLLOW.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
}
}
private void F(int i2, int i3, int i4) {
this.f2989i = i4;
this.f2990j = i2;
HashMap hashMap = new HashMap();
hashMap.put("fuid", Integer.valueOf(i3));
hashMap.put("type", Integer.valueOf(i2));
addTask(new com.showself.service.f(10052, hashMap), this, this.n);
}
public void G() {
new com.r.c.c(com.r.c.c.k(String.format(com.showself.net.e.p, Integer.valueOf(this.m)), 1) + "&startindex=" + this.f2988h + "&recordnum=20&type=2", new com.r.c.a(), new com.r.c.b(1), this).v(new d());
}
public void H(Object obj) {
this.a.s();
this.a.n();
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.f2991k = false;
this.f2987g.clear();
this.f2986f.notifyDataSetChanged();
this.d.setVisibility(0);
return;
}
JSONObject optJSONObject = jSONObject.optJSONObject("data");
JSONArray optJSONArray = optJSONObject.optJSONArray("members");
int optInt2 = optJSONObject.optInt("hasNext", -1);
if (optJSONArray == null || optJSONArray.length() <= 0) {
if (this.f2988h == 0) {
this.f2987g.clear();
}
this.f2991k = false;
} else {
ArrayList arrayList = new ArrayList();
for (int i2 = 0; i2 < optJSONArray.length(); i2++) {
FriendInfo jsonToFriendInfo2 = FriendInfo.jsonToFriendInfo2(optJSONArray.optJSONObject(i2).toString());
if (jsonToFriendInfo2 != null) {
arrayList.add(jsonToFriendInfo2);
}
}
if (arrayList.size() > 0) {
if (this.f2988h == 0) {
this.f2987g.clear();
}
if (optInt2 != -1) {
this.f2991k = true;
this.f2988h = optInt2;
} else {
this.f2991k = false;
}
this.f2987g.addAll(arrayList);
}
if (this.f2987g.size() > 0) {
this.d.setVisibility(8);
} else {
this.d.setVisibility(0);
}
}
this.f2986f.notifyDataSetChanged();
}
}
private void I() {
G();
}
private void J() {
this.f2987g = new ArrayList();
this.f2985e = (ImmersiveStatusBar) findViewById(2131298726);
this.a = (SmartRefreshLayout) findViewById(R.id.fans_refresh_layout);
this.b = findViewById(R.id.fans_recycler);
this.c = (ImageView) findViewById(R.id.iv_fans_back);
this.d = (LinearLayout) findViewById(R.id.ll_no_fans);
this.c.setOnClickListener(this);
this.a.J(new b());
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(1);
this.b.setLayoutManager(linearLayoutManager);
m0 m0Var = new m0(this, this.f2987g, this.m == this.l.getUserId(), 2);
this.f2986f = m0Var;
m0Var.g(new c());
this.b.setAdapter(this.f2986f);
}
private void K(String str, int i2, int i3, boolean z) {
g j2 = g.j();
com.r.n.d c2 = com.r.n.d.c();
c2.e("Me");
c2.f("Fans");
c2.d(str);
c2.h(com.r.n.e.Click);
c2.a(Oauth2AccessToken.KEY_UID, Integer.valueOf(this.l.getUserId()));
c2.a("touid", Integer.valueOf(i2));
c2.a("subtype", Integer.valueOf(i3));
c2.a("status", Boolean.valueOf(z));
j2.u(c2.b());
}
@Override
public void init() {
}
@Override
public void onClick(View view) {
if (view.getId() != 2131297128) {
return;
}
finish();
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_my_fans);
u0.q(this, null);
org.greenrobot.eventbus.c.c().o(this);
this.m = getIntent().getIntExtra("id", 0);
this.l = r0.y(this);
J();
I();
u0.i(this, this.f2985e, 2131099661, true);
}
@Override
protected void onDestroy() {
super.onDestroy();
org.greenrobot.eventbus.c.c().q(this);
}
@org.greenrobot.eventbus.m(threadMode = ThreadMode.MAIN)
public void onEvent(HistoryRecordEvent historyRecordEvent) {
if (e.a[historyRecordEvent.getType().ordinal()] != 1) {
return;
}
F(((Integer) historyRecordEvent.getValues()[0]).intValue(), ((Integer) historyRecordEvent.getValues()[1]).intValue(), ((Integer) historyRecordEvent.getValues()[2]).intValue());
}
@Override
public void refresh(Object... objArr) {
this.a.s();
this.a.n();
com.showself.service.g.i(this);
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();
if (intValue != 10052) {
return;
}
if (intValue2 == com.showself.net.e.m1 || intValue2 == -770) {
int relation = this.f2987g.get(this.f2989i).getRelation();
int i2 = this.f2990j;
if (i2 != 1) {
if (i2 == 2) {
if (relation == 3) {
relation = 1;
} else if (relation == 2) {
relation = 0;
}
}
} else if (relation == 1) {
relation = 3;
} else if (relation == 0) {
relation = 2;
}
this.f2987g.get(this.f2989i).setRelation(relation);
this.f2986f.notifyDataSetChanged();
K("Follow", this.f2987g.get(this.f2989i).getUid(), relation != 1 ? relation : 2, relation != 1);
}
}
}
}