OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 RecommendDetailFragment.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.discover.detail;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.http.SslError;
import android.os.Build;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import com.bumptech.glide.i;
import com.excelliance.kxqp.community.ui.AppDetailActivity;
import com.excelliance.kxqp.gs.discover.comment.CommentActivity;
import com.excelliance.kxqp.gs.discover.comment.SubCommentActivity;
import com.excelliance.kxqp.gs.discover.common.ImagePreviewActivity;
import com.excelliance.kxqp.gs.discover.common.ImagePreviewFragment;
import com.excelliance.kxqp.gs.discover.detail.c;
import com.excelliance.kxqp.gs.discover.detail.d;
import com.excelliance.kxqp.gs.discover.model.CommentItem;
import com.excelliance.kxqp.gs.discover.model.MediaDetail;
import com.excelliance.kxqp.gs.discover.user.UserActivity;
import com.excelliance.kxqp.gs.ui.share.core.config.SocializeMedia;
import com.excelliance.kxqp.gs.ui.share.core.helper.ShareHelper;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.bf;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.cg;
import com.excelliance.kxqp.gs.util.w;
import com.excelliance.kxqp.gs.util.z;
import com.excelliance.kxqp.gs.view.refresh.PullToRefreshView;
import com.excelliance.kxqp.task.g.f;
import com.excelliance.kxqp.task.g.g;
import com.tencent.open.SocialConstants;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import org.apache.http.cookie.ClientCookie;
public class RecommendDetailFragment extends Fragment {
private LinearLayout A;
private LinearLayout B;
private TextView C;
private ImageView D;
private TextView E;
private TextView F;
private TextView G;
private TextView H;
private TextView I;
private ImageView J;
private TextView K;
private TextView L;
private TextView M;
private DisplayMetrics N;
private ImageView O;
private ImageView P;
private TextView Q;
private TextView R;
private ImageView S;
private ImageView T;
private TextView U;
private TextView V;
private ImageView W;
private ImageView X;
private d Y;
private ImageView Z;
private b f5451a;
private View aa;
private View ab;
private ListView ac;
private com.excelliance.kxqp.gs.discover.detail.a ad;
private View ae;
private View af;
private View ag;
private TextView ah;
private TextView ai;
private TextView aj;
private TextView ak;
private View al;
private TextView am;
private TextView an;
private View ao;
private PullToRefreshView ap;
private View aq;
private View ar;
private View as;
private View at;
private View au;
private View av;
private View aw;
private String f5452b;
private String c;
private String d;
private e p;
private String r;
private String s;
private String t;
private String u;
private String v;
private TextView w;
private TextView x;
private LinearLayout y;
private WebView z;
private List<MediaTextureView> e = new ArrayList();
private List<CommentItem> f = new ArrayList();
private boolean g = false;
private boolean h = false;
private boolean i = false;
private boolean j = true;
private boolean k = false;
private int l = 0;
private int m = 0;
private int n = 1;
private int o = 11;
private int q = 0;
private d.a ax = new d.a() {
@Override
public void a(int i) {
RecommendDetailFragment.this.a(i);
}
};
public String v() {
return "function()\n{\n var imgs = document.getElementsByTagName(\"img\");\n for(var i = 0; i < imgs.length; i++)\n {\n imgs[i].onclick = function()\n {\n imagePreview.startImagePreviewActivity(this.src);\n }\n }\n}";
}
@Override
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
this.f5451a = new b(this, getActivity());
this.p = e.a();
Bundle arguments = getArguments();
this.f5452b = arguments.getString("media_id");
this.t = arguments.getString("web_tag");
this.u = arguments.getString("cover_image");
View inflate = layoutInflater.inflate(com.excelliance.kxqp.swipe.a.a.a(getActivity(), "recommend_fragment_detail_list"), viewGroup, false);
a(inflate);
j();
if (!bf.e(getActivity())) {
Toast.makeText(getActivity(), w.e(getActivity(), "net_unusable"), 0).show();
} else {
i();
}
return inflate;
}
private void a(View view) {
this.ap = (PullToRefreshView) com.excelliance.kxqp.ui.util.b.a("ptrv_refresh", view);
this.w = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_titlebar_text", view);
this.Z = (ImageView) com.excelliance.kxqp.ui.util.b.a("iv_back", view);
this.x = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_share", view);
this.y = (LinearLayout) com.excelliance.kxqp.ui.util.b.a("ll_share", view);
this.au = com.excelliance.kxqp.ui.util.b.a("iv_menu_button", view);
this.ar = com.excelliance.kxqp.ui.util.b.a("ll_operation_menu", view);
this.as = com.excelliance.kxqp.ui.util.b.a("tv_menu_share", view);
this.at = com.excelliance.kxqp.ui.util.b.a("tv_menu_delete", view);
this.aw = com.excelliance.kxqp.ui.util.b.a("iv_title_share", view);
this.av = com.excelliance.kxqp.ui.util.b.a("tv_share_tip", view);
this.ac = (ListView) com.excelliance.kxqp.ui.util.b.a("lv_detail", view);
this.ab = com.excelliance.kxqp.swipe.a.a.getLayout(getActivity(), "recommend_detail_content_title");
this.ae = com.excelliance.kxqp.swipe.a.a.getLayout(getActivity(), "recommend_detail_content");
this.af = com.excelliance.kxqp.swipe.a.a.getLayout(getActivity(), "recommend_comment_header");
this.aa = com.excelliance.kxqp.ui.util.b.a("rl_list_header", view);
this.am = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_reply_num", view);
this.ai = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_hot_button", view);
this.ai.setVisibility(0);
this.ak = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_date_button", view);
this.ak.setVisibility(0);
this.an = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_reply_num", this.af);
this.ah = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_hot_button", this.af);
this.ah.setVisibility(0);
this.aj = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_date_button", this.af);
this.aj.setVisibility(0);
this.ag = com.excelliance.kxqp.ui.util.b.a("rl_bottom_float", view);
this.P = (ImageView) com.excelliance.kxqp.ui.util.b.a("iv_comment_like", view);
this.R = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_comment_liked_num", view);
this.T = (ImageView) com.excelliance.kxqp.ui.util.b.a("iv_comment_collect", view);
this.V = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_comment_collected_num", view);
this.X = (ImageView) com.excelliance.kxqp.ui.util.b.a("iv_comment_share", view);
this.ao = com.excelliance.kxqp.ui.util.b.a("rl_reply", view);
this.ad = new com.excelliance.kxqp.gs.discover.detail.a(this, getActivity(), this.f5451a, this.f5452b);
this.ac.addHeaderView(this.ab);
this.ac.addHeaderView(this.ae);
this.ac.addHeaderView(this.af);
this.ac.setAdapter((ListAdapter) this.ad);
b(this.ae);
if (com.excelliance.kxqp.gs.newappstore.b.c.a(getActivity())) {
com.excelliance.kxqp.ui.util.b.a("title_bar", view).setBackgroundColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
}
}
private void b(View view) {
this.C = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_title", this.ab);
this.D = (ImageView) com.excelliance.kxqp.ui.util.b.a("iv_author_icon", view);
this.E = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_author_name", view);
this.al = com.excelliance.kxqp.ui.util.b.a("iv_vip", view);
this.F = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_num_look", view);
this.G = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_num_comment", view);
this.H = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_author_sig", view);
this.I = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_date", view);
this.J = (ImageView) com.excelliance.kxqp.ui.util.b.a("iv_game_icon", view);
this.K = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_game_name", view);
this.L = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_game_owner", view);
this.M = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_game_rank", view);
this.B = (LinearLayout) com.excelliance.kxqp.ui.util.b.a("ll_content", view);
this.O = (ImageView) com.excelliance.kxqp.ui.util.b.a("iv_like", view);
this.Q = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_liked_num", view);
this.S = (ImageView) com.excelliance.kxqp.ui.util.b.a("iv_collect", view);
this.U = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_collected_num", view);
this.W = (ImageView) com.excelliance.kxqp.ui.util.b.a("iv_share", view);
this.A = (LinearLayout) com.excelliance.kxqp.ui.util.b.a("wv_container", view);
this.aq = com.excelliance.kxqp.ui.util.b.a("rl_game", view);
}
public void i() {
this.A.removeAllViews();
this.B.removeAllViews();
this.f.clear();
this.p.b();
this.p.a(null);
this.e.clear();
this.ad.a(this.f);
this.f5451a.b(this.f5452b);
this.f5451a.a(this.f5452b, this.n, 10, 11);
this.i = bx.a().b(getActivity());
c(this.f5451a.g(this.f5452b));
}
private void j() {
this.ap.setOnRefreshListener(new PullToRefreshView.a() {
@Override
public void a() {
if (bf.e(RecommendDetailFragment.this.getActivity())) {
RecommendDetailFragment.this.i();
} else {
Toast.makeText(RecommendDetailFragment.this.getActivity(), w.e(RecommendDetailFragment.this.getActivity(), "net_unusable"), 0).show();
RecommendDetailFragment.this.b();
}
}
});
this.ac.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView absListView, int i) {
if (!RecommendDetailFragment.this.j || i != 0) {
if (RecommendDetailFragment.this.ac.getLayerType() != 2) {
RecommendDetailFragment.this.ac.setLayerType(2, null);
}
} else {
if ((RecommendDetailFragment.this.ad.getCount() - 1) + 3 == absListView.getLastVisiblePosition()) {
RecommendDetailFragment.this.n();
}
if (RecommendDetailFragment.this.ac.getLayerType() != 1) {
RecommendDetailFragment.this.ac.setLayerType(1, null);
}
}
}
@Override
public void onScroll(AbsListView absListView, int i, int i2, int i3) {
if (i < 1) {
RecommendDetailFragment.this.w.setText(com.excelliance.kxqp.swipe.a.a.getString(RecommendDetailFragment.this.getActivity(), "recommend_detail"));
RecommendDetailFragment.this.x.setVisibility(0);
} else {
RecommendDetailFragment.this.w.setText(RecommendDetailFragment.this.c);
RecommendDetailFragment.this.x.setVisibility(8);
}
if (i >= 2) {
RecommendDetailFragment.this.aa.setVisibility(0);
} else {
RecommendDetailFragment.this.aa.setVisibility(8);
}
}
});
this.O.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
if (bx.a().b(RecommendDetailFragment.this.getActivity())) {
if (RecommendDetailFragment.this.g) {
RecommendDetailFragment.this.f5451a.d(RecommendDetailFragment.this.f5452b);
return;
} else {
RecommendDetailFragment.this.f5451a.c(RecommendDetailFragment.this.f5452b);
return;
}
}
com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(RecommendDetailFragment.this.getActivity());
}
});
this.S.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
if (bx.a().b(RecommendDetailFragment.this.getActivity())) {
if (RecommendDetailFragment.this.h) {
RecommendDetailFragment.this.f5451a.f(RecommendDetailFragment.this.f5452b);
return;
} else {
RecommendDetailFragment.this.f5451a.e(RecommendDetailFragment.this.f5452b);
return;
}
}
com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(RecommendDetailFragment.this.getActivity());
}
});
this.W.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RecommendDetailFragment.this.o().d();
}
});
this.aw.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RecommendDetailFragment.this.o().d();
RecommendDetailFragment.this.av.setVisibility(8);
}
});
this.P.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
if (bx.a().b(RecommendDetailFragment.this.getActivity())) {
if (RecommendDetailFragment.this.g) {
RecommendDetailFragment.this.f5451a.d(RecommendDetailFragment.this.f5452b);
return;
} else {
RecommendDetailFragment.this.f5451a.c(RecommendDetailFragment.this.f5452b);
return;
}
}
com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(RecommendDetailFragment.this.getActivity());
}
});
this.T.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
if (bx.a().b(RecommendDetailFragment.this.getActivity())) {
if (RecommendDetailFragment.this.h) {
RecommendDetailFragment.this.f5451a.f(RecommendDetailFragment.this.f5452b);
return;
} else {
RecommendDetailFragment.this.f5451a.e(RecommendDetailFragment.this.f5452b);
return;
}
}
com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(RecommendDetailFragment.this.getActivity());
}
});
this.X.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RecommendDetailFragment.this.o().d();
}
});
this.y.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
}
});
this.au.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (RecommendDetailFragment.this.k) {
RecommendDetailFragment.this.ar.setVisibility(8);
RecommendDetailFragment.this.k = false;
return;
}
String d = com.excelliance.kxqp.gs.discover.a.d(RecommendDetailFragment.this.getActivity());
if (d == null || !d.equals(RecommendDetailFragment.this.d)) {
RecommendDetailFragment.this.at.setVisibility(8);
} else {
RecommendDetailFragment.this.at.setVisibility(0);
}
RecommendDetailFragment.this.ar.setVisibility(0);
RecommendDetailFragment.this.k = true;
}
});
this.as.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RecommendDetailFragment.this.o().d();
RecommendDetailFragment.this.ar.setVisibility(8);
RecommendDetailFragment.this.k = false;
}
});
this.at.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RecommendDetailFragment.this.ar.setVisibility(8);
RecommendDetailFragment.this.k = false;
z.a((Context) RecommendDetailFragment.this.getActivity(), com.excelliance.kxqp.swipe.a.a.getString(RecommendDetailFragment.this.getActivity(), "delete_confirm"), false, com.excelliance.kxqp.swipe.a.a.getString(RecommendDetailFragment.this.getActivity(), "cancel"), com.excelliance.kxqp.swipe.a.a.getString(RecommendDetailFragment.this.getActivity(), "confirm"), new z.b() {
@Override
public void a(Dialog dialog) {
dialog.dismiss();
}
@Override
public void b(Dialog dialog) {
RecommendDetailFragment.this.f5451a.i(RecommendDetailFragment.this.f5452b);
dialog.dismiss();
}
}).show();
}
});
this.Z.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RecommendDetailFragment.this.getActivity().finish();
}
});
this.ac.setOnItemClickListener(new com.excelliance.kxqp.gs.discover.common.e() {
@Override
protected void a(AdapterView<?> adapterView, View view, int i, long j) {
int i2;
if (i <= 2 || i - 3 >= RecommendDetailFragment.this.f.size()) {
return;
}
CommentItem commentItem = (CommentItem) RecommendDetailFragment.this.f.get(i2);
Intent intent = new Intent(RecommendDetailFragment.this.getActivity(), (Class<?>) SubCommentActivity.class);
intent.putExtra("media_id", RecommendDetailFragment.this.f5452b);
intent.putExtra("comment_id", commentItem.commentId);
RecommendDetailFragment.this.startActivity(intent);
RecommendDetailFragment.this.getActivity().overridePendingTransition(w.i(RecommendDetailFragment.this.getActivity(), "slide_right_in"), w.i(RecommendDetailFragment.this.getActivity(), "slide_left_out"));
}
});
this.ag.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
return true;
}
});
this.ao.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
if (bx.a().b(RecommendDetailFragment.this.getActivity())) {
Intent intent = new Intent(RecommendDetailFragment.this.getActivity(), (Class<?>) CommentActivity.class);
intent.putExtra("type", 1);
intent.putExtra("layout_id", "recommend_comment_edit_big");
intent.putExtra("media_id", RecommendDetailFragment.this.f5452b);
RecommendDetailFragment.this.startActivityForResult(intent, 11);
RecommendDetailFragment.this.getActivity().overridePendingTransition(w.i(RecommendDetailFragment.this.getActivity(), "bottom_ok_in"), 0);
return;
}
com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(RecommendDetailFragment.this.getActivity());
}
});
this.ah.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
RecommendDetailFragment.this.m();
}
});
this.ai.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
RecommendDetailFragment.this.m();
}
});
this.aj.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
RecommendDetailFragment.this.l();
}
});
this.ak.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
RecommendDetailFragment.this.l();
}
});
this.aa.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
return true;
}
});
this.E.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
RecommendDetailFragment.this.k();
}
});
this.D.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
RecommendDetailFragment.this.k();
}
});
this.aq.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
if (RecommendDetailFragment.this.v != null) {
AppDetailActivity.a(RecommendDetailFragment.this.getActivity(), RecommendDetailFragment.this.v, "other");
}
}
});
}
public void k() {
Intent intent = new Intent(getActivity(), (Class<?>) UserActivity.class);
intent.putExtra("user_id", this.d);
startActivity(intent);
}
public void l() {
if (this.o == 12) {
this.ai.setTextColor(Color.parseColor("#999999"));
this.ah.setTextColor(Color.parseColor("#999999"));
this.ak.setTextColor(Color.parseColor("#0F9D58"));
this.aj.setTextColor(Color.parseColor("#0F9D58"));
this.ac.smoothScrollToPosition(2);
this.n = 1;
this.f5451a.a(this.f5452b, this.n, 10, 11);
this.o = 11;
}
}
public void m() {
if (this.o == 11) {
this.ai.setTextColor(Color.parseColor("#0F9D58"));
this.ah.setTextColor(Color.parseColor("#0F9D58"));
this.ak.setTextColor(Color.parseColor("#999999"));
this.aj.setTextColor(Color.parseColor("#999999"));
this.ac.smoothScrollToPosition(2);
this.n = 1;
this.f5451a.a(this.f5452b, this.n, 10, 12);
this.o = 12;
}
}
@Override
public void onViewCreated(View view, Bundle bundle) {
super.onViewCreated(view, bundle);
}
@Override
public void onResume() {
super.onResume();
boolean b2 = bx.a().b(getActivity());
if (b2 != this.i) {
if (bf.e(getActivity())) {
this.B.removeAllViews();
this.f5451a.b(this.f5452b);
}
this.i = b2;
}
if (this.f5451a == null || !g.a(getActivity())) {
return;
}
this.f5451a.a(new com.excelliance.kxqp.gs.listener.g<f.b>() {
@Override
public void a() {
}
@Override
public void a(String str) {
}
@Override
public void g_() {
}
@Override
public void a(final f.b bVar, Object... objArr) {
RecommendDetailFragment.this.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
f.INSTANCE.B.d = bVar.d;
f.INSTANCE.a();
}
});
}
});
}
@Override
public void onStop() {
super.onStop();
this.p.b();
}
@Override
public void onDestroyView() {
super.onDestroyView();
this.A.removeAllViews();
this.f5451a.a();
this.f5451a = null;
for (MediaTextureView mediaTextureView : this.e) {
if (mediaTextureView != null) {
mediaTextureView.h();
}
}
this.p.a(null);
this.e.clear();
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
if (i == 11 && i2 == -1) {
TextView textView = this.G;
int i3 = this.q + 1;
this.q = i3;
textView.setText(String.valueOf(i3));
this.n = 1;
this.j = true;
this.f.clear();
this.f5451a.a(this.f5452b, this.n, 10, this.o);
return;
}
if (i == 13 && i2 == -1 && intent != null) {
String stringExtra = intent.getStringExtra(ClientCookie.COMMENT_ATTR);
String stringExtra2 = intent.getStringExtra("comment_id");
Iterator<CommentItem> it = this.f.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
CommentItem next = it.next();
if (next.commentId.equals(stringExtra2)) {
next.comment = stringExtra;
next.spanComment = null;
break;
}
}
this.ad.a(this.f);
}
}
public void a(String str) {
Iterator<CommentItem> it = this.f.iterator();
while (true) {
if (!it.hasNext()) {
break;
} else if (str.equals(it.next().commentId)) {
it.remove();
break;
}
}
this.ad.a(this.f);
}
public void n() {
if (!bf.e(getActivity())) {
Toast.makeText(getActivity(), w.e(getActivity(), "net_unusable"), 0).show();
return;
}
b bVar = this.f5451a;
String str = this.f5452b;
int i = this.n + 1;
this.n = i;
bVar.a(str, i, 10, this.o);
}
public void a(List<CommentItem> list) {
this.f.clear();
this.f.addAll(list);
this.ad.a(this.f);
if (list.size() < 10) {
this.j = false;
this.ad.a();
}
a();
}
public void a() {
this.ad.b();
}
public d o() {
if (this.Y == null) {
this.Y = new d(getActivity(), this.c);
this.Y.a(this.ax);
this.Y.a();
}
return this.Y;
}
public void b() {
this.ap.setRefreshing(false);
}
public void a(MediaDetail mediaDetail) {
this.v = mediaDetail.appPackageName;
this.c = mediaDetail.title;
this.d = mediaDetail.userId;
if (mediaDetail.title != null) {
this.C.setText(mediaDetail.title);
}
if (mediaDetail.userName != null) {
this.E.setText(mediaDetail.userName);
}
if (mediaDetail.signature != null) {
this.H.setText(mediaDetail.signature);
}
if (mediaDetail.vipTag == 0) {
this.al.setVisibility(8);
} else {
this.al.setVisibility(0);
}
if (mediaDetail.lookNum != null) {
this.F.setText(mediaDetail.lookNum);
}
if (mediaDetail.commentNum != null) {
this.q = Integer.valueOf(mediaDetail.commentNum).intValue();
this.G.setText(mediaDetail.commentNum);
}
if (mediaDetail.time != null) {
this.I.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA).format(new Date(Long.valueOf(Long.valueOf(mediaDetail.time).longValue() * 1000).longValue())));
}
if (mediaDetail.rankName != null) {
this.K.setText(mediaDetail.rankName);
}
if (mediaDetail.publisher != null) {
this.L.setText(mediaDetail.publisher);
}
if (mediaDetail.rankStar != null) {
this.M.setText(String.format(com.excelliance.kxqp.swipe.a.a.getString(getActivity(), "game_score"), mediaDetail.rankStar));
}
i.a(this).a(mediaDetail.header).a(new com.bumptech.glide.d.d.a.e(getActivity()), new com.excelliance.kxqp.gs.discover.common.b(getActivity())).d(com.excelliance.kxqp.swipe.a.a.getDrawable(getActivity(), "me_head")).a(this.D);
if (mediaDetail.rankIcon != null) {
i.a(this).a(mediaDetail.rankIcon).a(new com.bumptech.glide.d.d.a.e(getActivity()), new com.excelliance.kxqp.gs.discover.common.f(getActivity(), 20)).a(this.J);
}
if (mediaDetail.appId != null) {
this.aq.setVisibility(0);
} else {
this.aq.setVisibility(8);
}
if ("0".equals(mediaDetail.webTag)) {
t();
} else if ("1".equals(mediaDetail.webTag) && this.z == null) {
this.B.setVisibility(8);
this.A.setVisibility(0);
}
this.l = Integer.valueOf(mediaDetail.likeNum).intValue();
this.Q.setText(mediaDetail.likeNum);
this.R.setText(mediaDetail.likeNum);
this.m = Integer.valueOf(mediaDetail.collectNum).intValue();
this.U.setText(mediaDetail.collectNum);
this.V.setText(mediaDetail.collectNum);
if ("0".equals(mediaDetail.liked)) {
q();
} else {
p();
}
if ("0".equals(mediaDetail.collected)) {
r();
} else {
s();
}
if (com.excelliance.kxqp.gs.discover.a.a(mediaDetail.shareTag) && g.a(getActivity())) {
this.aw.setVisibility(0);
this.av.setVisibility(0);
} else {
this.aw.setVisibility(8);
this.av.setVisibility(8);
}
this.s = mediaDetail.shareDescript;
}
public void c() {
int i = this.l + 1;
this.l = i;
this.Q.setText(String.valueOf(i));
this.R.setText(String.valueOf(i));
p();
}
public void d() {
int i = this.l - 1;
this.l = i;
this.Q.setText(String.valueOf(i));
this.R.setText(String.valueOf(i));
q();
}
private void p() {
this.O.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(getActivity(), "recommend_icon_liked"));
this.P.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(getActivity(), "recommend_icon_liked"));
this.g = true;
}
private void q() {
this.O.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(getActivity(), "recommend_icon_unlike"));
this.P.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(getActivity(), "recommend_icon_unlike"));
this.g = false;
}
public void e() {
int i = this.m + 1;
this.m = i;
this.U.setText(String.valueOf(i));
this.V.setText(String.valueOf(i));
s();
}
public void f() {
int i = this.m - 1;
this.m = i;
this.U.setText(String.valueOf(i));
this.V.setText(String.valueOf(i));
r();
}
private void r() {
this.S.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(getActivity(), "recommend_icon_uncollect"));
this.T.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(getActivity(), "recommend_icon_uncollect"));
this.h = false;
}
private void s() {
this.S.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(getActivity(), "recommend_icon_collected"));
this.T.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(getActivity(), "recommend_icon_collected"));
this.h = true;
}
private void t() {
this.B.setVisibility(0);
this.A.setVisibility(8);
}
private void c(String str) {
if (str == null) {
return;
}
if (this.z == null) {
this.z = u();
}
this.z.loadUrl(str);
this.A.addView(this.z, new LinearLayout.LayoutParams(-1, -2));
}
public DisplayMetrics g() {
if (this.N == null && getActivity() != null) {
this.N = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(this.N);
}
return this.N;
}
public int a(int i, int i2) {
return (int) TypedValue.applyDimension(i, i2, g());
}
public void b(List<c.a> list) {
for (c.a aVar : list) {
String str = aVar.f5573b;
final String str2 = aVar.f5572a;
if ("p".equals(str)) {
TextView textView = new TextView(getActivity());
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
layoutParams.setMargins(a(1, 17), a(1, 17), a(1, 17), a(1, 17));
textView.setTextColor(Color.parseColor("#ff333333"));
textView.setTextSize(2, 15.0f);
textView.setLayoutParams(layoutParams);
textView.setText(str2);
this.B.addView(textView);
} else if (SocialConstants.PARAM_IMG_URL.equals(str)) {
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-1, -2);
layoutParams2.setMargins(a(1, 17), a(1, 17), a(1, 17), a(1, 17));
ImageView imageView = new ImageView(getActivity());
imageView.setMaxWidth(com.excelliance.kxqp.gs.discover.a.c(getActivity()));
imageView.setAdjustViewBounds(true);
LinearLayout linearLayout = new LinearLayout(getActivity());
this.B.addView(linearLayout, layoutParams2);
imageView.setOnClickListener(new com.excelliance.kxqp.gs.discover.common.d() {
@Override
protected void a(View view) {
RecommendDetailFragment.this.d(str2);
}
});
this.f5451a.a(imageView, linearLayout, str2);
} else if ("video".equals(str)) {
RelativeLayout relativeLayout = new RelativeLayout(getActivity());
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-1, -2);
layoutParams3.height = a(1, 202);
layoutParams3.setMargins(a(1, 17), a(1, 17), a(1, 17), a(1, 17));
MediaTextureView mediaTextureView = new MediaTextureView(getActivity());
mediaTextureView.setDataSource(str2);
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(-1, -1);
layoutParams4.addRule(13, 1);
relativeLayout.addView(mediaTextureView, layoutParams4);
VideoController videoController = new VideoController(getActivity());
videoController.setVideoView(mediaTextureView);
videoController.setPresenter(this.f5451a);
mediaTextureView.setController(videoController);
mediaTextureView.i();
this.e.add(mediaTextureView);
this.B.addView(relativeLayout, layoutParams3);
}
}
}
public void d(String str) {
ImagePreviewFragment imagePreviewFragment = new ImagePreviewFragment();
Bundle bundle = new Bundle();
bundle.putString("image", str);
imagePreviewFragment.setArguments(bundle);
getFragmentManager().beginTransaction().add(com.excelliance.kxqp.swipe.a.a.getId(getActivity(), "fl_content"), imagePreviewFragment).addToBackStack(null).commit();
}
public void a(int i) {
if (i == 2) {
if (as.i(getActivity(), "com.tencent.mm")) {
a(SocializeMedia.WEIXIN_MONMENT);
return;
} else {
cg.a(getActivity(), w.e(getActivity(), "share_sdk_not_install_wechat"));
return;
}
}
if (i == 4) {
if (as.i(getActivity(), "com.tencent.mm")) {
a(SocializeMedia.WEIXIN);
return;
} else {
cg.a(getActivity(), w.e(getActivity(), "share_sdk_not_install_wechat"));
return;
}
}
if (i == 8) {
if (as.i(getActivity(), "com.tencent.mobileqq") || as.i(getActivity(), "com.tencent.tim")) {
a(SocializeMedia.QZONE);
return;
} else {
cg.a(getActivity(), w.e(getActivity(), "share_sdk_not_install_qq"));
return;
}
}
if (i == 16) {
if (as.i(getActivity(), "com.tencent.mobileqq") || as.i(getActivity(), "com.tencent.tim")) {
a(SocializeMedia.QQ);
return;
} else {
cg.a(getActivity(), w.e(getActivity(), "share_sdk_not_install_qq"));
return;
}
}
if (i != 32) {
if (i != 64) {
return;
}
a(SocializeMedia.MORESHARE);
} else if (as.i(getActivity(), "com.sina.weibo")) {
a(SocializeMedia.SINA);
} else {
cg.a(getActivity(), w.e(getActivity(), "share_sdk_not_install_wb"));
}
}
private void a(SocializeMedia socializeMedia) {
ShareHelper instance = ShareHelper.instance(getActivity());
instance.setCallBack(new ShareHelper.Callback() {
@Override
public void onDismiss(SocializeMedia socializeMedia2) {
}
@Override
public void onShareComplete(SocializeMedia socializeMedia2, int i, Bundle bundle) {
}
@Override
public void onShareStart(SocializeMedia socializeMedia2) {
}
});
this.r = this.u;
if (this.r == null) {
this.r = "https://cdn.ourplay.com.cn/xspace/xspacelogo.png";
}
instance.shareMediaTo(socializeMedia, this.c, this.s, this.r, this.f5451a.h(this.f5452b));
this.Y.c();
}
public boolean h() {
return this.p.c();
}
public void a(String str, CharSequence charSequence) {
Iterator<CommentItem> it = this.f.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
CommentItem next = it.next();
if (next.commentId.equals(str)) {
next.spanComment = charSequence;
break;
}
}
this.ad.a(this.f);
}
public void b(String str) {
Toast.makeText(getActivity(), com.excelliance.kxqp.swipe.a.a.getString(getActivity(), "has_delete"), 0).show();
getActivity().onBackPressed();
}
private WebView u() {
WebView webView = new WebView(getActivity());
webView.setHorizontalScrollBarEnabled(false);
webView.setVerticalScrollBarEnabled(false);
if (Build.VERSION.SDK_INT > 17) {
webView.addJavascriptInterface(new a(), "imagePreview");
}
this.z.removeJavascriptInterface("searchBoxJavaBridge_");
this.z.removeJavascriptInterface("accessibility");
this.z.removeJavascriptInterface("accessibilityTraversal");
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setPluginState(WebSettings.PluginState.ON);
settings.setAllowFileAccess(true);
settings.setLoadWithOverviewMode(true);
settings.setUseWideViewPort(true);
settings.setCacheMode(-1);
settings.setDomStorageEnabled(true);
if (Build.VERSION.SDK_INT >= 26) {
settings.setSafeBrowsingEnabled(false);
}
webView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedError(WebView webView2, WebResourceRequest webResourceRequest, WebResourceError webResourceError) {
super.onReceivedError(webView2, webResourceRequest, webResourceError);
Log.e("RecommendDetailFragment", "RecommendDetailFragment/onReceivedError:" + webResourceError.toString());
}
@Override
public void onReceivedSslError(WebView webView2, SslErrorHandler sslErrorHandler, SslError sslError) {
super.onReceivedSslError(webView2, sslErrorHandler, sslError);
Log.e("RecommendDetailFragment", "RecommendDetailFragment/onReceivedSslError:" + sslError.toString());
}
@Override
public void onPageFinished(WebView webView2, String str) {
RecommendDetailFragment.this.z.loadUrl("javascript:(" + RecommendDetailFragment.this.v() + ")()");
}
});
return webView;
}
public class a {
private a() {
}
@JavascriptInterface
public void startImagePreviewActivity(String str) {
Intent intent = new Intent(RecommendDetailFragment.this.getActivity(), (Class<?>) ImagePreviewActivity.class);
intent.putExtra("image", str);
RecommendDetailFragment.this.startActivity(intent);
}
}
}