中建乐购 v3.2.3版本的 MD5 值为:3856d0da11f056931d64951d23a4b3b8
以下内容为反编译后的 ae.java 源代码,内容仅作参考
package com.shopex.westore.activity;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import cn.shopex.ecstore.libary.cache.common.EnhanceRecyclerView;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.shopex.westore.AgentApplication;
import com.shopex.westore.modle.ChildModel;
import com.shopex.westore.modle.MainModuleList;
import com.shopex.westore.modle.MainModules;
import com.shopex.westore.util.aj;
import com.zjsjtz.ecstore.R;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.http.cookie.ClientCookie;
import org.apache.http.util.EncodingUtils;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class ae extends com.shopex.westore.b implements SwipeRefreshLayout.b {
public static final Integer f8845a = 112233;
private static final int f8846m = 1;
private static final int f8847n = 3;
private static final int f8848o = 5;
private static final int f8849p = 4;
private static final int f8850q = 2;
private static final int f8851r = 6;
private static final int f8852s = 7;
private static final int f8853t = 8;
private static final int f8854u = 9;
private static final int f8855v = 10;
private static final int f8856w = 11;
private static final int f8857x = 1;
private static final int f8858y = 99;
private ImageView A;
private ImageView B;
String f8859b;
private SwipeRefreshLayout f8861d;
private RecyclerView.h f8862e;
private EnhanceRecyclerView f8863f;
private MainModuleList f8865h;
private RelativeLayout f8870z;
private i f8864g = null;
private List<MainModules> f8866i = new ArrayList();
private List<MainModules> f8867j = new ArrayList();
private MainModules f8868k = new MainModules();
private Boolean f8869l = false;
private aj.a C = null;
int f8860c = 0;
private com.shopex.westore.util.p D = null;
private com.shopex.westore.util.j E = null;
private com.shopex.westore.util.v F = null;
private com.shopex.westore.util.af G = null;
private int H = 0;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
org.greenrobot.eventbus.c.a().a(this);
}
@org.greenrobot.eventbus.l(a = ThreadMode.MAIN)
public void onEvent(Integer num) {
if (num == f8845a) {
a();
}
}
@Override
public void onDestroy() {
super.onDestroy();
org.greenrobot.eventbus.c.a().c(this);
}
@Override
@TargetApi(23)
public void init(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
this.mActionBar.setShowTitleBar(false);
this.mActionBar.setTitle("中建三局生态");
this.mActionBar.setShowHomeView(false);
this.rootView = layoutInflater.inflate(R.layout.fragment_shop_main, (ViewGroup) null);
this.f8861d = (SwipeRefreshLayout) this.rootView.findViewById(R.id.swipe_refresh);
this.f8861d.setColorSchemeResources(17170458, 17170459, 17170456, 17170454);
this.f8861d.setOnRefreshListener(this);
this.f8862e = new LinearLayoutManager(getActivity());
this.f8863f = (EnhanceRecyclerView) this.rootView.findViewById(R.id.mylist);
this.f8863f.setLayoutManager(this.f8862e);
this.f8870z = (RelativeLayout) this.rootView.findViewById(R.id.action_bar_titlebar);
this.f8863f.a(ImageLoader.getInstance(), false, true);
this.A = (ImageView) this.rootView.findViewById(R.id.to_top_imageview);
this.f8863f.setOnScrollListener(new RecyclerView.l() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int i2) {
super.onScrollStateChanged(recyclerView, i2);
}
@Override
public void onScrolled(RecyclerView recyclerView, int i2, int i3) {
super.onScrolled(recyclerView, i2, i3);
ae.this.H += i3;
if (ae.this.H >= 800) {
ae.this.A.setVisibility(0);
} else {
ae.this.A.setVisibility(8);
}
int bottom = ae.this.mActionBar.getBottom();
if (ae.this.H == 0 || ae.this.H > bottom) {
if (ae.this.H == 0) {
ae.this.f8870z.setBackgroundResource(R.drawable.bg_title_shouye);
return;
}
return;
}
float f2 = ((ae.this.H / bottom) * 255.0f * 2.0f) + 51.0f;
if (f2 <= 255.0f) {
ae.this.f8870z.setBackgroundColor(Color.argb((int) f2, 54, 54, 54));
} else {
ae.this.f8870z.setBackgroundColor(Color.argb(255, 54, 54, 54));
}
}
});
this.f8864g = new i();
this.B = (ImageView) this.rootView.findViewById(R.id.kefu_imageview);
this.B.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new go.b().a(ae.this.getActivity());
}
});
this.D = new com.shopex.westore.util.p();
this.E = new com.shopex.westore.util.j();
this.F = new com.shopex.westore.util.v();
this.G = new com.shopex.westore.util.af();
b();
this.A.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ae.this.H = 0;
ae.this.f8863f.a(0);
ae.this.f8870z.setBackgroundResource(R.drawable.bg_title_shouye);
}
});
((TextView) findViewById(R.id.qian_dao_tv)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ae.this.startActivity(AgentActivity.a(ae.this.mActivity, 801));
}
});
}
@Override
public void a() {
this.f8866i.clear();
this.f8864g.notifyDataSetChanged();
this.f8863f.setVisibility(4);
if (!this.f8869l.booleanValue()) {
b();
}
this.H = 0;
}
@Override
public void onResume() {
super.onResume();
if (AgentApplication.c(this.mActivity).c()) {
com.shopex.westore.k.a(new fu.d(), new f());
}
}
public class i extends RecyclerView.a {
public View f8890a;
private i() {
}
@Override
public RecyclerView.v onCreateViewHolder(ViewGroup viewGroup, int i2) {
new ChildModel();
View a2 = com.shopex.westore.util.w.a(i2, viewGroup, ae.this.getActivity());
if (i2 != 99) {
switch (i2) {
case 1:
return new l(a2);
case 2:
return new j(a2);
case 3:
return new h(a2);
case 4:
return new k(a2);
case 5:
return new m(a2);
case 6:
return new g(a2);
case 7:
return new a(a2);
case 8:
return new n(a2);
case 9:
return new e(a2);
case 10:
return new c(a2);
case 11:
return new d(a2);
default:
return null;
}
}
return new b(a2);
}
@Override
public void onBindViewHolder(RecyclerView.v vVar, int i2) {
ChildModel childModel = new ChildModel();
int itemViewType = getItemViewType(i2);
LinearLayout linearLayout = (LinearLayout) vVar.itemView.findViewById(R.id.item_line);
if (i2 == 0 && linearLayout != null) {
linearLayout.setVisibility(8);
} else if (linearLayout != null) {
linearLayout.setVisibility(0);
}
try {
if (ae.this.f8866i.size() > i2) {
childModel.json = ae.this.a(((MainModules) ae.this.f8866i.get(i2)).module_data);
if (((MainModules) ae.this.f8866i.get(i2)).module_id != null && !TextUtils.isEmpty(((MainModules) ae.this.f8866i.get(i2)).module_id)) {
childModel.module_id = ((MainModules) ae.this.f8866i.get(i2)).module_id;
}
if (((MainModules) ae.this.f8866i.get(i2)).weight != null && !TextUtils.isEmpty(((MainModules) ae.this.f8866i.get(i2)).weight)) {
childModel.weight = Double.parseDouble(((MainModules) ae.this.f8866i.get(i2)).weight);
}
if (((MainModules) ae.this.f8866i.get(i2)).module_title != null && !TextUtils.isEmpty(((MainModules) ae.this.f8866i.get(i2)).module_title)) {
childModel.module_title = ((MainModules) ae.this.f8866i.get(i2)).module_title;
}
if (((MainModules) ae.this.f8866i.get(i2)).column_num != null && !TextUtils.isEmpty(((MainModules) ae.this.f8866i.get(i2)).column_num)) {
childModel.column_num = Integer.parseInt(((MainModules) ae.this.f8866i.get(i2)).column_num);
}
if (((MainModules) ae.this.f8866i.get(i2)).module_title_color != null && !TextUtils.isEmpty(((MainModules) ae.this.f8866i.get(i2)).module_title_color)) {
childModel.module_title_color = ((MainModules) ae.this.f8866i.get(i2)).module_title_color;
}
if (((MainModules) ae.this.f8866i.get(i2)).module_title_icon != null && !TextUtils.isEmpty(((MainModules) ae.this.f8866i.get(i2)).module_title_icon)) {
childModel.module_title_icon = ((MainModules) ae.this.f8866i.get(i2)).module_title_icon;
}
if (((MainModules) ae.this.f8866i.get(i2)).module_icon != null && !TextUtils.isEmpty(((MainModules) ae.this.f8866i.get(i2)).module_icon)) {
childModel.module_icon = ((MainModules) ae.this.f8866i.get(i2)).module_icon;
}
if (((MainModules) ae.this.f8866i.get(i2)).isshow_module_title != null && !TextUtils.isEmpty(((MainModules) ae.this.f8866i.get(i2)).isshow_module_title)) {
childModel.isshow_module_title = ((MainModules) ae.this.f8866i.get(i2)).isshow_module_title;
}
if (((MainModules) ae.this.f8866i.get(i2)).isshow_sub_module != null && !TextUtils.isEmpty(((MainModules) ae.this.f8866i.get(i2)).isshow_sub_module)) {
childModel.isshow_sub_module = ((MainModules) ae.this.f8866i.get(i2)).isshow_sub_module;
}
if (!TextUtils.isEmpty(((MainModules) ae.this.f8866i.get(i2)).margin)) {
childModel.margin = ((MainModules) ae.this.f8866i.get(i2)).margin;
}
}
} catch (IOException e2) {
e2.printStackTrace();
}
switch (itemViewType) {
case 1:
try {
ae.this.D.a(childModel.module_id, ae.this.getActivity(), childModel.json, (float) childModel.weight, vVar.itemView);
return;
} catch (Exception e3) {
e3.printStackTrace();
return;
}
case 2:
this.f8890a = vVar.itemView;
com.shopex.westore.util.w.f(childModel.module_id, vVar.itemView, itemViewType, ae.this.getActivity(), childModel.json, childModel.weight, childModel.module_title, childModel.module_title_icon, childModel.module_title_color, childModel.column_num, childModel.module_icon, childModel.isshow_module_title, childModel.isshow_sub_module);
return;
case 3:
try {
com.shopex.westore.util.v unused = ae.this.F;
com.shopex.westore.util.v.a(childModel.json, ae.this.getActivity(), vVar.itemView, childModel.module_icon, childModel.isshow_module_title);
return;
} catch (Exception e4) {
e4.printStackTrace();
return;
}
case 4:
ae.this.E.a(((MainModules) ae.this.f8866i.get(i2)).submodule_index, childModel.json, ae.this.getActivity(), vVar.itemView, childModel.module_title, childModel.module_title_color, childModel.module_title_icon, childModel.isshow_module_title);
return;
case 5:
try {
ae.this.G.a(ae.this.getActivity(), childModel.json, childModel.isshow_sub_module, childModel.isshow_module_title, childModel.module_title, childModel.module_title_color, childModel.module_title_icon, vVar.itemView, childModel.weight, childModel.margin);
return;
} catch (Exception e5) {
e5.printStackTrace();
return;
}
case 6:
com.shopex.westore.util.w.a(childModel.module_id, vVar.itemView, itemViewType, ae.this.getActivity(), childModel.json, childModel.weight, childModel.module_title, childModel.module_title_icon, childModel.module_title_color, childModel.column_num, childModel.module_icon, childModel.isshow_module_title, childModel.isshow_sub_module);
return;
case 7:
com.shopex.westore.util.w.e(childModel.module_id, vVar.itemView, itemViewType, ae.this.getActivity(), childModel.json, childModel.weight, childModel.module_title, childModel.module_title_icon, childModel.module_title_color, childModel.column_num, childModel.module_icon, childModel.isshow_module_title, childModel.isshow_sub_module);
return;
case 8:
com.shopex.westore.util.w.d(childModel.module_id, vVar.itemView, itemViewType, ae.this.getActivity(), childModel.json, childModel.weight, childModel.module_title, childModel.module_title_icon, childModel.module_title_color, childModel.column_num, childModel.module_icon, childModel.isshow_module_title, childModel.isshow_sub_module);
return;
case 9:
com.shopex.westore.util.w.c(childModel.module_id, vVar.itemView, itemViewType, ae.this.getActivity(), childModel.json, childModel.weight, childModel.module_title, childModel.module_title_icon, childModel.module_title_color, childModel.column_num, childModel.module_icon, childModel.isshow_module_title, childModel.isshow_sub_module);
return;
case 10:
com.shopex.westore.util.w.b(childModel.module_id, vVar.itemView, itemViewType, ae.this.getActivity(), childModel.json, childModel.weight, childModel.module_title, childModel.module_title_icon, childModel.module_title_color, childModel.column_num, childModel.module_icon, childModel.isshow_module_title, childModel.isshow_sub_module);
return;
case 11:
com.shopex.westore.util.w.a(childModel.json, childModel.weight, childModel.margin, vVar.itemView);
return;
default:
return;
}
}
@Override
public int getItemCount() {
if (ae.this.f8866i != null) {
return ae.this.f8866i.size() + 1;
}
return 1;
}
@Override
public int getItemViewType(int i2) {
int size = ae.this.f8866i.size();
if (i2 < size) {
return Integer.parseInt(((MainModules) ae.this.f8866i.get(i2)).module_type);
}
return i2 == size ? 99 : 99;
}
}
private class l extends RecyclerView.v {
public l(View view) {
super(view);
}
}
private class h extends RecyclerView.v {
public h(View view) {
super(view);
}
}
private class m extends RecyclerView.v {
public m(View view) {
super(view);
}
}
private class k extends RecyclerView.v {
public k(View view) {
super(view);
}
}
private class j extends RecyclerView.v {
public j(View view) {
super(view);
}
}
private class a extends RecyclerView.v {
public a(View view) {
super(view);
}
}
private class n extends RecyclerView.v {
public n(View view) {
super(view);
}
}
private class e extends RecyclerView.v {
public e(View view) {
super(view);
}
}
private class c extends RecyclerView.v {
public c(View view) {
super(view);
}
}
private class g extends RecyclerView.v {
public g(View view) {
super(view);
}
}
private class d extends RecyclerView.v {
public d(View view) {
super(view);
}
}
private class b extends RecyclerView.v {
public b(View view) {
super(view);
}
}
@Override
public void onPause() {
super.onPause();
}
private void b() {
this.f8869l = true;
new com.shopex.westore.util.h("https://www.zjsjtz.com/index.php//openapi/home/all", new File(String.valueOf(bn.a.a(getActivity(), true))).getAbsolutePath(), getActivity(), new aj.a() {
@Override
public void a() {
JSONObject jSONObject;
JSONArray optJSONArray;
try {
jSONObject = new JSONObject(ae.this.a("main_modules.json"));
} catch (Exception e2) {
e2.printStackTrace();
jSONObject = null;
}
if (jSONObject != null) {
ae.this.f8865h = (MainModuleList) com.shopex.westore.util.k.a(jSONObject.optString("data"), (Class<Object>) MainModuleList.class);
ae.this.f8867j = ae.this.f8865h.module;
for (int i2 = 0; i2 < ae.this.f8867j.size(); i2++) {
try {
JSONObject jSONObject2 = new JSONObject(ae.this.a(((MainModules) ae.this.f8867j.get(i2)).module_data));
if (!((MainModules) ae.this.f8867j.get(i2)).module_type.equals(dc.c.f14280ao)) {
ae.this.f8866i.add(ae.this.f8867j.get(i2));
} else {
if (jSONObject2.optJSONObject("data").optJSONArray("info").length() > 0) {
for (int i3 = 0; i3 < Math.ceil(optJSONArray.length() / 2.0d); i3++) {
MainModules mainModules = (MainModules) ((MainModules) ae.this.f8867j.get(i2)).clone();
mainModules.submodule_index = i3;
ae.this.f8866i.add(mainModules);
}
}
}
} catch (Exception e3) {
e3.printStackTrace();
}
}
Collections.sort(ae.this.f8866i, new com.shopex.westore.util.r());
ae.this.f8863f.setAdapter(ae.this.f8864g);
ae.this.f8863f.setVisibility(0);
ae.this.f8869l = false;
ae.this.f8861d.setRefreshing(ae.this.f8869l.booleanValue());
}
}
}).execute(new Void[0]);
}
public String a(String str) throws IOException {
File file = new File(bn.a.a(getActivity(), true) + File.separator + "all" + File.separator + str);
if (file.exists()) {
FileInputStream fileInputStream = new FileInputStream(new File(file.getAbsolutePath()));
byte[] bArr = new byte[fileInputStream.available()];
fileInputStream.read(bArr);
String string = EncodingUtils.getString(bArr, "UTF-8");
fileInputStream.close();
return string;
}
return null;
}
private class f implements fu.e {
private f() {
}
@Override
public void task_response(String str) {
try {
JSONObject jSONObject = new JSONObject(str);
if (com.shopex.westore.k.a((Context) ae.this.getActivity(), jSONObject, true)) {
JSONObject optJSONObject = jSONObject.optJSONObject("data");
final int optInt = optJSONObject.optInt(ClientCookie.COMMENT_ATTR);
final int optInt2 = optJSONObject.optInt("praise");
go.f.a().a(go.f.f19149f, optInt);
go.f.a().a(go.f.f19150g, optInt2);
if (ae.this.f8864g != null && ae.this.f8864g.f8890a != null) {
ae.this.b(optInt, optInt2);
} else {
ae.this.mHandler.postDelayed(new Runnable() {
@Override
public void run() {
ae.this.a(optInt, optInt2);
}
}, 1000L);
}
}
} catch (JSONException e2) {
e2.printStackTrace();
}
}
@Override
public fu.c task_request() {
return new fu.c("circle.message.get_message");
}
}
public void a(final int i2, final int i3) {
if (this.f8864g != null && this.f8864g.f8890a != null) {
b(i2, i3);
} else {
this.mHandler.postDelayed(new Runnable() {
@Override
public void run() {
ae.this.b(i2, i3);
}
}, 1000L);
}
}
public void b(int i2, int i3) {
LinearLayout linearLayout;
View view = this.f8864g.f8890a;
if (view == null || (linearLayout = (LinearLayout) view.findViewById(R.id.linear)) == null || linearLayout.getChildCount() <= 0) {
return;
}
LinearLayout linearLayout2 = (LinearLayout) linearLayout.getChildAt(0);
for (int i4 = 0; i4 < linearLayout2.getChildCount(); i4++) {
ImageView imageView = (ImageView) linearLayout2.getChildAt(3).findViewById(R.id.image);
if ("生粉论坛".equals((String) imageView.getTag())) {
imageView.setBackgroundResource((i2 > 0 || i3 > 0) ? R.drawable.btn_shenglutan_hongdian : R.drawable.btn_shengfenluntan);
}
}
}
}