OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.discover.detail;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.excelliance.kxqp.gs.discover.detail.c;
import com.excelliance.kxqp.gs.discover.model.CommentItem;
import com.excelliance.kxqp.gs.discover.model.MediaDetail;
import com.excelliance.kxqp.gs.discover.model.ResponseData;
import com.excelliance.kxqp.gs.listener.g;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.cn;
import com.excelliance.kxqp.task.g.f;
import java.util.List;
import org.json.JSONObject;
public class b implements com.excelliance.kxqp.gs.base.e {
private Context f5514a;
private Handler f5515b;
private Handler c;
private RecommendDetailFragment d;
private c e;
@Override
public void initData() {
}
public b(RecommendDetailFragment recommendDetailFragment, Context context) {
this.f5514a = context;
this.d = recommendDetailFragment;
HandlerThread handlerThread = new HandlerThread("RecommendDetailPresenter");
handlerThread.start();
this.f5515b = new Handler(handlerThread.getLooper());
this.c = new Handler(Looper.getMainLooper());
this.e = c.a(this.f5514a);
}
public void a(final String str) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
final List<c.a> b2 = b.this.e.b(str);
b.this.c.post(new Runnable() {
@Override
public void run() {
if (b.this.d != null) {
b.this.d.b(b2);
}
}
});
}
});
}
public void a() {
this.d = null;
this.f5515b.getLooper().quit();
}
public void b(final String str) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
ResponseData<MediaDetail> a2 = b.this.e.a(str);
if (a2.code != 0) {
b.this.b();
Toast.makeText(b.this.f5514a, a2.msg, 0).show();
return;
}
final MediaDetail mediaDetail = a2.data;
if (mediaDetail == null) {
b.this.b();
Toast.makeText(b.this.f5514a, com.excelliance.kxqp.swipe.a.a.getString(b.this.f5514a, "server_wrong"), 0).show();
} else {
if (mediaDetail.content != null) {
b.this.a(mediaDetail.content);
}
b.this.c.post(new Runnable() {
@Override
public void run() {
if (b.this.d != null) {
b.this.d.b();
b.this.d.a(mediaDetail);
}
}
});
}
}
});
}
public void b() {
this.c.post(new Runnable() {
@Override
public void run() {
if (b.this.d != null) {
b.this.d.b();
}
}
});
}
public void c(final String str) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
ResponseData a2 = b.this.e.a(str, 1);
if (a2.code == 0) {
b.this.c.post(new Runnable() {
@Override
public void run() {
if (b.this.d != null) {
b.this.d.c();
}
}
});
} else {
Toast.makeText(b.this.f5514a, a2.msg, 0).show();
}
}
});
}
public void d(final String str) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
ResponseData a2 = b.this.e.a(str, 2);
if (a2.code == 0) {
b.this.c.post(new Runnable() {
@Override
public void run() {
if (b.this.d != null) {
b.this.d.d();
}
}
});
} else {
Toast.makeText(b.this.f5514a, a2.msg, 0).show();
}
}
});
}
public void e(final String str) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
ResponseData b2 = b.this.e.b(str, 1);
if (b2.code == 0) {
b.this.c.post(new Runnable() {
@Override
public void run() {
if (b.this.d != null) {
b.this.d.e();
}
}
});
} else {
Toast.makeText(b.this.f5514a, b2.msg, 0).show();
}
}
});
}
public void f(final String str) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
ResponseData b2 = b.this.e.b(str, 2);
if (b2.code == 0) {
b.this.c.post(new Runnable() {
@Override
public void run() {
if (b.this.d != null) {
b.this.d.f();
}
}
});
} else {
Toast.makeText(b.this.f5514a, b2.msg, 0).show();
}
}
});
}
public String g(String str) {
return this.e.c(str);
}
public void a(final String str, final int i, final int i2, final int i3) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
ResponseData<List<CommentItem>> a2 = b.this.e.a(str, i, i2, i3);
if (a2.code != 0) {
Toast.makeText(b.this.f5514a, a2.msg, 0).show();
return;
}
final List<CommentItem> list = a2.data;
if (list != null) {
b.this.c.post(new Runnable() {
@Override
public void run() {
if (b.this.d != null) {
b.this.d.a(list);
}
}
});
} else {
Toast.makeText(b.this.f5514a, a2.msg, 0).show();
}
}
});
}
public void a(final String str, final int i, final int i2) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
ResponseData b2 = com.excelliance.kxqp.gs.discover.comment.b.a(b.this.f5514a.getApplicationContext()).b(str, i, i2);
if (b2.code == 0) {
return;
}
Toast.makeText(b.this.f5514a, b2.msg, 0).show();
}
});
}
public void a(final String str, final String str2) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
ResponseData a2 = com.excelliance.kxqp.gs.discover.comment.b.a(b.this.f5514a.getApplicationContext()).a(str, str2, 1);
if (a2.code == 0) {
b.this.c.post(new Runnable() {
@Override
public void run() {
if (b.this.d != null) {
b.this.d.a(str2);
}
}
});
} else {
Toast.makeText(b.this.f5514a, a2.msg, 0).show();
}
}
});
}
public void b(final String str, final String str2) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
final CharSequence b2 = com.excelliance.kxqp.gs.discover.comment.b.a(b.this.f5514a).b(str2);
if (b2 != null) {
b.this.c.post(new Runnable() {
@Override
public void run() {
if (b.this.d != null) {
b.this.d.a(str, b2);
}
}
});
}
}
});
}
public String h(String str) {
return this.e.d(str);
}
public void a(final g gVar) {
tp.f(new Runnable() {
@Override
public void run() {
JSONObject e = com.excelliance.kxqp.task.g.g.e(b.this.f5514a);
try {
e.put("tasktype", 18);
az.d("RecommendDetailPresenter", "request:" + e.toString());
String a2 = bd.a("http://api.ourplay.com.cn/task/task", e.toString());
if (cd.a(a2)) {
az.d("RecommendDetailPresenter", "respone is empty");
return;
}
az.d("RecommendDetailPresenter", "encry response:" + a2);
String a3 = cn.a(a2);
az.d("RecommendDetailPresenter", "response:" + a3);
JSONObject jSONObject = new JSONObject(a3);
int optInt = jSONObject.optInt("code");
JSONObject optJSONObject = jSONObject.optJSONObject("data");
if (optInt != 1) {
az.d("RecommendDetailPresenter", "post view fail");
} else if (optJSONObject != null) {
f.b bVar = new f.b();
bVar.d = optJSONObject.optInt("state");
gVar.a(bVar, new Object[0]);
}
} catch (Exception e2) {
az.d("RecommendDetailPresenter", "post view fail");
az.d("RecommendDetailPresenter", e2.getMessage());
e2.printStackTrace();
}
}
});
}
public void i(final String str) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
ResponseData e = b.this.e.e(str);
if (e.code == 0) {
b.this.c.post(new Runnable() {
@Override
public void run() {
if (b.this.d != null) {
b.this.d.b(str);
}
}
});
} else {
Toast.makeText(b.this.f5514a, e.msg, 0).show();
}
}
});
}
public void a(final ImageView imageView, final LinearLayout linearLayout, final String str) {
this.f5515b.post(new Runnable() {
@Override
public void run() {
final Drawable c = com.excelliance.kxqp.gs.discover.comment.b.a(b.this.f5514a).c(str);
if (c != null) {
b.this.c.post(new Runnable() {
@Override
public void run() {
if (imageView == null || linearLayout == null) {
return;
}
imageView.setImageDrawable(c);
linearLayout.addView(imageView, new LinearLayout.LayoutParams(-1, -2));
}
});
}
}
});
}
}