柬埔寨通 v6.1.5版本的 MD5 值为:9b68581ac30883219d6a25858a099d6b
以下内容为反编译后的 RollingNoticeActivity.java 源代码,内容仅作参考
package net.duohuo.magappx.common.activity;
import android.os.Bundle;
import android.widget.ListAdapter;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jianpuzhaitong.forum.R;
import java.util.List;
import net.duohuo.core.adapter.DataPage;
import net.duohuo.core.adapter.DataPageAdapter;
import net.duohuo.core.annotation.Extra;
import net.duohuo.core.net.Task;
import net.duohuo.magappx.common.base.MagBaseActivity;
import net.duohuo.magappx.common.util.FilterUtil;
import net.duohuo.magappx.common.view.MagListView;
import net.duohuo.magappx.info.dataview.InfoHeadDataView;
import net.duohuo.magappx.info.model.InfoHeadItem;
import net.duohuo.magappx.info.model.InfoItem;
public class RollingNoticeActivity extends MagBaseActivity implements DataPage.OnLoadSuccessCallBack {
DataPageAdapter adapter;
@Extra(def = "cat_id")
String catId;
InfoHeadDataView infoHeadDataView;
@BindView(R.id.listview)
MagListView listview;
private JSONArray totalArray;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.rolling_notice_activity);
ButterKnife.bind(this);
InfoHeadDataView infoHeadDataView = new InfoHeadDataView(getActivity());
this.infoHeadDataView = infoHeadDataView;
this.listview.addHeaderView(infoHeadDataView.getRootView());
init();
}
private void init() {
DataPageAdapter dataPageAdapter = new DataPageAdapter(this, "https://app.jpztong.com/mag/info/v3/info/infoListByCatId", "info_item");
this.adapter = dataPageAdapter;
dataPageAdapter.setOnLoadPageListener(new DataPage.OnLoadPageListener() {
@Override
public void onLoadPageListener(int i) {
if (i != 1) {
RollingNoticeActivity.this.adapter.param("content_id", FilterUtil.filterVideoIds(i, RollingNoticeActivity.this.totalArray));
}
}
});
this.adapter.param("cat_id", this.catId);
this.adapter.addOnLoadSuccessCallBack(this);
this.adapter.cache();
this.adapter.next();
this.listview.setAdapter((ListAdapter) this.adapter);
}
@Override
public void onLoadSuccess(Task task, int i) {
JSONObject json;
if (task.getResult().success()) {
if (i == 1) {
this.totalArray = (JSONArray) task.getResult().get("totalList");
}
String catName = ((InfoItem) JSON.parseObject(task.getResult().plain(), InfoItem.class)).getCatName();
getNavigator().setTitle(catName + "");
if (i == 1 && (json = task.getResult().json()) != null && json.containsKey("toppics")) {
List parseArray = JSON.parseArray(json.getString("toppics"), InfoHeadItem.class);
if (parseArray != null && parseArray.size() > 0) {
this.infoHeadDataView.setData((InfoHeadItem) parseArray.get(0));
} else {
this.infoHeadDataView.setData(null);
}
}
}
}
@Override
public void onDestroy() {
super.onDestroy();
InfoHeadDataView infoHeadDataView = this.infoHeadDataView;
if (infoHeadDataView != null) {
infoHeadDataView.removeAllMsg();
}
}
}