整点视频 v3.3.0版本的 MD5 值为:cba0457dc37421eed445b30f92de25d3
以下内容为反编译后的 NewsFragment.java 源代码,内容仅作参考
package com.kc.openset.news;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.RelativeLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.kc.openset.OSETVideoContent;
import com.kc.openset.R;
import com.kc.openset.bean.e;
import com.kc.openset.listener.OSETNewsClickListener;
import com.kc.openset.util.m;
import com.kc.openset.util.q;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class NewsFragment extends BaseFragment {
private RelativeLayout a;
private RecyclerView b;
private c c;
private List<String> d;
private List<String> e;
private String g;
private int h;
private String i;
private String j;
private String k;
private Activity l;
private OSETNewsClickListener m;
private ArrayList<Fragment> f = new ArrayList<>();
private StartTimeListener n = new b();
class a implements RecycleItemListener {
a() {
}
@Override
public void onItemClick(int i) {
NewsFragment.this.c.a(i);
NewsFragment.this.a(i);
}
}
class b implements StartTimeListener {
b() {
}
@Override
public void onStopScroll() {
}
@Override
public void start() {
}
@Override
public void startActivityDetials(e eVar) {
Intent intent = new Intent(NewsFragment.this.l, OSETNewsWebViewActivity.class);
intent.putExtra("url", eVar.h());
intent.putExtra("html_data", eVar.c());
intent.putExtra("maxTime", 0);
intent.putExtra("insertId", NewsFragment.this.j);
intent.putExtra("bannerId", NewsFragment.this.k);
NewsFragment.this.l.startActivity(intent);
}
}
private void a() {
this.d = new ArrayList();
this.e = new ArrayList();
this.d.add("推荐");
this.e.add("top");
this.f.add(new NewsTypeFragment().a(this.m).a("top", this.g, this.h, this.i, this.n));
this.d.add("社会");
this.e.add("shehui");
this.f.add(new NewsTypeFragment().a(this.m).a("shehui", this.g, this.h, this.i, this.n));
this.d.add("国内");
this.e.add("guonei");
this.f.add(new NewsTypeFragment().a(this.m).a("guonei", this.g, this.h, this.i, this.n));
this.d.add("国际");
this.e.add("guoji");
this.f.add(new NewsTypeFragment().a(this.m).a("guoji", this.g, this.h, this.i, this.n));
this.d.add("娱乐");
this.e.add("yule");
this.f.add(new NewsTypeFragment().a(this.m).a("yule", this.g, this.h, this.i, this.n));
this.d.add("体育");
this.e.add("tiyu");
this.f.add(new NewsTypeFragment().a(this.m).a("tiyu", this.g, this.h, this.i, this.n));
this.d.add("军事");
this.e.add("junshi");
this.f.add(new NewsTypeFragment().a(this.m).a("junshi", this.g, this.h, this.i, this.n));
this.d.add("科技");
this.e.add("keji");
this.f.add(new NewsTypeFragment().a(this.m).a("keji", this.g, this.h, this.i, this.n));
this.d.add("财经");
this.e.add("caijing");
this.f.add(new NewsTypeFragment().a(this.m).a("caijing", this.g, this.h, this.i, this.n));
this.d.add("时尚");
this.e.add("shishang");
this.f.add(new NewsTypeFragment().a(this.m).a("shishang", this.g, this.h, this.i, this.n));
}
private void b() {
this.b.setLayoutManager(new LinearLayoutManager(getContext(), 0, false));
}
public NewsFragment a(Activity activity, String str, int i, String str2, String str3, String str4) {
if (i > 10) {
this.h = 10;
} else if (i < 5) {
this.h = 5;
} else {
this.h = i;
}
this.g = str;
this.i = str2;
this.j = str3;
this.k = str4;
this.l = activity;
m.f("NewsFragment", String.format("setData 咨询页绑定数据 posId=%s bannerId=%s insertId=%s videoPosId=%s adInterval=%s", str, str4, str3, str2, Integer.valueOf(i)));
return this;
}
public NewsFragment a(OSETNewsClickListener oSETNewsClickListener) {
this.m = oSETNewsClickListener;
return this;
}
public void a(int i) {
FragmentTransaction beginTransaction = getChildFragmentManager().beginTransaction();
for (Fragment fragment : getChildFragmentManager().getFragments()) {
if (fragment != null) {
beginTransaction.hide(fragment);
}
}
beginTransaction.commit();
if (!this.f.get(i).isAdded()) {
getChildFragmentManager().beginTransaction().add(R.id.fl_news, this.f.get(i), "" + i).commit();
return;
}
FragmentManager childFragmentManager = getChildFragmentManager();
Fragment findFragmentByTag = childFragmentManager.findFragmentByTag("" + i);
FragmentTransaction beginTransaction2 = getChildFragmentManager().beginTransaction();
beginTransaction2.show(findFragmentByTag);
beginTransaction2.commit();
}
@Override
public int getLayoutId() {
return R.layout.oset_activity_news;
}
@Override
public void initView(View view) {
m.f("NewsFragment", "initView 资讯页绑定数据");
m.b();
RelativeLayout relativeLayout = (RelativeLayout) view.findViewById(R.id.rl_title);
this.a = relativeLayout;
relativeLayout.setVisibility(8);
HashMap hashMap = new HashMap();
hashMap.put("adSpotId", this.g);
hashMap.put("deviceId", q.c(getContext()));
com.kc.openset.b.a(getContext(), "http://track.shenshiads.com/track/content/tt/open", hashMap);
this.b = (RecyclerView) view.findViewById(R.id.rv);
a();
c cVar = new c(getContext(), this.d, new a());
this.c = cVar;
this.b.setAdapter(cVar);
b();
a(0);
}
@Override
public void onDestroyView() {
super.onDestroyView();
OSETVideoContent.getInstance().destroy();
}
}