正在查看: 饼干视频 v4.1.0 应用的 NewsTypeFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 饼干视频 v4.1.0 应用的 NewsTypeFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.kc.openset.news;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.View;
import android.widget.Toast;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.jiagu.sdk.OSETSDKProtected;
import com.kc.openset.R;
import com.kc.openset.ad._native.OSETNative;
import com.kc.openset.ad._native.OSETNativeAd;
import com.kc.openset.ad.listener.OSETNativeAdLoadListener;
import com.kc.openset.ad.listener.OSETNativeListener;
import com.kc.openset.listener.OSETNewsClickListener;
import com.kc.openset.view.srl.api.RefreshLayout;
import com.kc.openset.view.srl.listener.OnLoadMoreListener;
import com.kc.openset.view.srl.listener.OnRefreshListener;
import com.qihoo.SdkProtected.OSETSDK.ईऌओओआऊउउईउ;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
@ईऌओओआऊउउईउ
public class NewsTypeFragment extends BaseFragment {
private RecyclerView a;
private String b;
private NewsRecycerAdapter d;
private String f;
private RefreshLayout g;
private int h;
private String i;
private StartTimeListener j;
private int k;
private int l;
private OSETNewsClickListener m;
private int s;
private List<com.kc.openset.bean.f> c = new ArrayList();
private int e = 0;
private boolean n = false;
private Timer o = new Timer();
private final Handler p = new i(Looper.getMainLooper());
private final Handler q = new j(Looper.getMainLooper());
public final Handler r = new k(Looper.getMainLooper());
private List<OSETNativeAd> t = new ArrayList();
@ईऌओओआऊउउईउ
public class a implements OSETNativeAdLoadListener {
public final boolean a;
static {
OSETSDKProtected.interface11(850);
}
public a(boolean z) {
this.a = z;
}
@Override
public native void onLoadFail(String str, String str2);
@Override
public native void onLoadSuccess(OSETNativeAd oSETNativeAd);
}
@ईऌओओआऊउउईउ
public class b implements OSETNativeListener {
public final boolean a;
static {
OSETSDKProtected.interface11(851);
}
public b(boolean z) {
this.a = z;
}
@Override
public native void onClick(View view);
@Override
public native void onClose(View view);
@Override
public native void onError(String str, String str2);
@Override
public native void onRenderSuccess(View view);
@Override
public native void onShow(View view);
}
@ईऌओओआऊउउईउ
public class c implements OnRefreshListener {
static {
OSETSDKProtected.interface11(852);
}
public c() {
}
@Override
public native void onRefresh(RefreshLayout refreshLayout);
}
@ईऌओओआऊउउईउ
public class d implements OnLoadMoreListener {
static {
OSETSDKProtected.interface11(853);
}
public d() {
}
@Override
public native void onLoadMore(RefreshLayout refreshLayout);
}
@ईऌओओआऊउउईउ
public class e implements RecycleItemListener {
static {
OSETSDKProtected.interface11(854);
}
public e() {
}
@Override
public native void onItemClick(int i);
}
@ईऌओओआऊउउईउ
public class f extends RecyclerView.OnScrollListener {
public f() {
}
public void onScrollStateChanged(RecyclerView recyclerView, int i) {
super.onScrollStateChanged(recyclerView, i);
if (i != 0) {
NewsTypeFragment.this.j.start();
NewsTypeFragment.this.c();
}
}
}
@ईऌओओआऊउउईउ
public class g extends TimerTask {
public g() {
}
@Override
public void run() {
NewsTypeFragment.this.j.onStopScroll();
}
}
@ईऌओओआऊउउईउ
public class h implements Callback {
public final boolean a;
static {
OSETSDKProtected.interface11(857);
}
public h(boolean z) {
this.a = z;
}
public native void onFailure(Call call, IOException iOException);
public native void onResponse(Call call, Response response);
}
@ईऌओओआऊउउईउ
public class i extends Handler {
public i(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message message) {
super.handleMessage(message);
Toast.makeText(NewsTypeFragment.this.context, message.obj.toString(), 0);
NewsTypeFragment.this.n = false;
NewsTypeFragment.this.g.finishLoadMore();
NewsTypeFragment.this.g.finishRefresh();
}
}
@ईऌओओआऊउउईउ
public class j extends Handler {
public j(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message message) {
super.handleMessage(message);
NewsTypeFragment.this.a();
}
}
@ईऌओओआऊउउईउ
public class k extends Handler {
public k(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message message) {
super.handleMessage(message);
int i = message.what;
if (i == 1) {
if ("".equals(NewsTypeFragment.this.i)) {
NewsTypeFragment.this.r.sendEmptyMessage(2);
return;
}
return;
}
if (i == 2) {
NewsTypeFragment.this.n = false;
NewsTypeFragment.this.g.finishLoadMore();
NewsTypeFragment.this.g.finishRefresh();
} else {
if (i == 3) {
NewsTypeFragment.this.d.notifyDataSetChanged();
return;
}
if (i != 5) {
return;
}
StringBuilder sb = new StringBuilder();
sb.append("beginIndex, ");
sb.append(NewsTypeFragment.this.k);
sb.append("---data.size() - beginIndex");
sb.append(NewsTypeFragment.this.c.size() - NewsTypeFragment.this.k);
NewsTypeFragment.this.d.notifyItemRangeChanged(NewsTypeFragment.this.k, NewsTypeFragment.this.c.size() - NewsTypeFragment.this.k);
}
}
}
public void a() {
boolean z = this.l / this.h == 0;
this.s = 0;
((OSETNative) ((OSETNative) OSETNative.getInstance().setContext(getActivity())).setPosId(this.f)).loadAd(new a(z));
}
public void a(OSETNativeAd oSETNativeAd, boolean z) {
oSETNativeAd.render(requireActivity(), new b(z));
}
public void a(boolean z) {
if (this.n) {
return;
}
if (z) {
System.gc();
}
this.n = true;
HashMap hashMap = new HashMap();
hashMap.put("category", this.b);
hashMap.put("batch", Integer.valueOf(this.e));
hashMap.put("appKey", com.kc.openset.config.d.l());
hashMap.put("ModuleId", this.f);
com.kc.openset.b.a("http://content-api.shenshiads.com/content/toutiao", hashMap, new h(z));
}
public static int b(NewsTypeFragment newsTypeFragment, int i2) {
int i3 = newsTypeFragment.k + i2;
newsTypeFragment.k = i3;
return i3;
}
private void b() {
this.a.setLayoutManager(new LinearLayoutManager(getContext(), 1, false));
}
public void c() {
try {
this.o.cancel();
} catch (Exception unused) {
}
Timer timer = new Timer();
this.o = timer;
timer.schedule(new g(), 3000L);
}
public static int h(NewsTypeFragment newsTypeFragment) {
int i2 = newsTypeFragment.s;
newsTypeFragment.s = i2 + 1;
return i2;
}
public NewsTypeFragment a(OSETNewsClickListener oSETNewsClickListener) {
this.m = oSETNewsClickListener;
return this;
}
public NewsTypeFragment a(String str, String str2, int i2, String str3, StartTimeListener startTimeListener) {
this.f = str2;
this.b = str;
this.h = i2;
this.i = str3;
this.j = startTimeListener;
return this;
}
@Override
public int getLayoutId() {
return R.layout.oset_fragment_item_information_type;
}
@Override
public void initView(View view) {
this.a = view.findViewById(R.id.lv);
RefreshLayout refreshLayout = (RefreshLayout) view.findViewById(R.id.srl);
this.g = refreshLayout;
refreshLayout.setOnRefreshListener(new c());
this.g.setOnLoadMoreListener(new d());
NewsRecycerAdapter newsRecycerAdapter = new NewsRecycerAdapter(getContext(), this.c, new e());
this.d = newsRecycerAdapter;
this.a.setAdapter(newsRecycerAdapter);
b();
this.a.addOnScrollListener(new f());
a(true);
}
public void onDestroyView() {
super.onDestroyView();
for (OSETNativeAd oSETNativeAd : this.t) {
if (oSETNativeAd != null) {
oSETNativeAd.destroy();
}
}
this.t.clear();
}
}