思特奇智慧酒店云平台 v0.0.5版本的 MD5 值为:dedb172bb322639d79d7e0e26262fb5c
以下内容为反编译后的 AppCenterNewFragment.java 源代码,内容仅作参考
package com.sitech.oncon.activity;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageInfo;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.sitech.core.util.Log;
import com.sitech.oncon.R;
import com.sitech.oncon.activity.connections.widget.pulltorefresh.PullToRefreshBase;
import com.sitech.oncon.activity.connections.widget.pulltorefresh.PullToRefreshScrollView;
import com.sitech.oncon.activity.enterprise.EnterpriseBusiOpenActivity;
import com.sitech.oncon.adapter.TopAppAdapter;
import com.sitech.oncon.application.MyApplication;
import com.sitech.oncon.data.AppAdData;
import com.sitech.oncon.data.AppClassData;
import com.sitech.oncon.data.CompanyData;
import com.sitech.oncon.data.PersonAppCategoryData;
import com.sitech.oncon.data.PersonAppData;
import com.sitech.oncon.data.PersonAppNotiData;
import com.sitech.oncon.receiver.OnNotiReceiver;
import com.sitech.oncon.widget.CustomWebTitleView;
import com.sitech.oncon.widget.MyAppSticklyGridHeadersView;
import defpackage.bp1;
import defpackage.iv0;
import java.lang.Thread;
import java.lang.ref.WeakReference;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.json.JSONObject;
@SuppressLint({"HandlerLeak", "SimpleDateFormat", "InflateParams"})
public class AppCenterNewFragment extends BaseFragment implements lj1, AdapterView.OnItemClickListener, kk1 {
public static final int n0 = 1;
public static final int o0 = 3;
public static final int p0 = 4;
public static final int q0 = 7;
public static final int r0 = 8;
public static final int s0 = 9;
public static final int t0 = 1;
public static final int u0 = 2;
public static final int v0 = 3;
public static final int w0 = 4;
public static final int x0 = 6;
public static final int y0 = 7;
public TopAppAdapter A;
public FragmentBaseActivity C;
public TextView a;
public LinearLayout b;
public PullToRefreshScrollView c;
public String d;
public String e;
public ImageView f;
public Thread f0;
public TextView g;
public BroadcastReceiver g0;
public String h;
public bp1 h0;
public ud1 i;
public kf1 j;
public sf1 k;
public OnNotiReceiver r;
public OnNotiReceiver s;
public OnNotiReceiver t;
public OnNotiReceiver u;
public View v;
public MyAppSticklyGridHeadersView w;
public iv0 x;
public LinearLayout y;
public RecyclerView z;
public List<Object> l = new ArrayList();
public ArrayList<PersonAppCategoryData> m = new ArrayList<>();
public HashMap<String, PersonAppNotiData> n = new HashMap<>();
public ArrayList<AppClassData> o = new ArrayList<>();
public ArrayList<AppAdData> p = new ArrayList<>();
public List<PackageInfo> q = new ArrayList();
public List<PersonAppData> B = new ArrayList();
public boolean D = false;
public boolean e0 = false;
public k i0 = new k(this);
public j j0 = new j(this, null);
public boolean k0 = false;
public boolean l0 = false;
public BroadcastReceiver m0 = new i();
public class a implements PullToRefreshBase.l<ScrollView> {
public a() {
}
@Override
public void a(PullToRefreshBase<ScrollView> pullToRefreshBase) {
AppCenterNewFragment.this.e0 = true;
me1.a();
}
}
public class b implements bp1.c {
public b() {
}
@Override
public void a(int i) {
if (i == R.id.scan_TV) {
kk0.D(AppCenterNewFragment.this.C);
AppCenterNewFragment.this.h0.dismiss();
} else if (i == R.id.chip_TV) {
Intent intent = new Intent(AppCenterNewFragment.this.C, WebViewActivity.class);
intent.putExtra("url", bk0.r5);
intent.putExtra("title", AppCenterNewFragment.this.C.getResources().getString(R.string.nfc_title));
AppCenterNewFragment.this.C.startActivity(intent);
AppCenterNewFragment.this.h0.dismiss();
}
}
}
public class c implements iv0.d {
public c() {
}
@Override
public void a(boolean z) {
if (z) {
AppCenterNewFragment.this.d(false);
AppCenterNewFragment.this.toastToMessage(R.string.delete_app_seccess);
return;
}
AppCenterNewFragment.this.toastToMessage(R.string.delete_app_fail);
}
}
public class d extends BroadcastReceiver {
public d() {
}
@Override
public void onReceive(Context context, Intent intent) {
String substring = intent.getDataString().substring(8);
if (intent.getAction().equals("android.intent.action.PACKAGE_ADDED")) {
AppCenterNewFragment.this.j0.obtainMessage(6, substring).sendToTarget();
}
if (intent.getAction().equals("android.intent.action.PACKAGE_REMOVED")) {
AppCenterNewFragment.this.j0.obtainMessage(7, substring).sendToTarget();
}
}
}
public class e implements Runnable {
public e() {
}
@Override
public void run() {
Message obtainMessage;
try {
try {
} finally {
AppCenterNewFragment.this.k0 = false;
}
} catch (Exception e) {
Log.a(bk0.V5, e.getMessage(), e);
}
if (AppCenterNewFragment.this.k0) {
return;
}
AppCenterNewFragment.this.k0 = true;
hn1 g = new gn1(AppCenterNewFragment.this.C).g(MyApplication.h().a.w(), bk0.c6);
if (!"0".equals(g.g())) {
if (AppCenterNewFragment.this.j0 != null) {
AppCenterNewFragment.this.j0.obtainMessage(3).sendToTarget();
}
} else {
try {
try {
if (g.e() != null && ((ArrayList) g.e()).size() > 0) {
AppCenterNewFragment.this.p.clear();
AppCenterNewFragment.this.p.addAll((ArrayList) g.e());
AppCenterNewFragment.this.j.a();
Iterator it = AppCenterNewFragment.this.p.iterator();
while (it.hasNext()) {
AppCenterNewFragment.this.j.a((AppAdData) it.next());
}
}
} catch (Exception e2) {
Log.a(bk0.V5, e2.getMessage(), e2);
if (AppCenterNewFragment.this.j0 != null) {
obtainMessage = AppCenterNewFragment.this.j0.obtainMessage(2);
}
}
if (AppCenterNewFragment.this.j0 != null) {
obtainMessage = AppCenterNewFragment.this.j0.obtainMessage(2);
obtainMessage.sendToTarget();
}
} catch (Throwable th) {
if (AppCenterNewFragment.this.j0 != null) {
AppCenterNewFragment.this.j0.obtainMessage(2).sendToTarget();
}
throw th;
}
}
}
}
public class f implements Runnable {
public f() {
}
@Override
public void run() {
Message obtainMessage;
try {
try {
} catch (Exception e) {
Log.a(bk0.V5, e.getMessage(), e);
}
if (AppCenterNewFragment.this.l0) {
return;
}
AppCenterNewFragment.this.l0 = true;
hn1 f = new gn1(AppCenterNewFragment.this.C).f();
try {
if ("0".equals(f.g())) {
try {
if (f.e() != null && ((ArrayList) f.e()).size() > 0) {
AppCenterNewFragment.this.o.clear();
AppCenterNewFragment.this.o.addAll((ArrayList) f.e());
Iterator it = AppCenterNewFragment.this.o.iterator();
while (it.hasNext()) {
AppCenterNewFragment.this.j.a((AppClassData) it.next());
}
}
} catch (Exception e2) {
Log.a(bk0.V5, e2.getMessage(), e2);
if (AppCenterNewFragment.this.j0 != null) {
obtainMessage = AppCenterNewFragment.this.j0.obtainMessage(1);
}
}
if (AppCenterNewFragment.this.j0 != null) {
obtainMessage = AppCenterNewFragment.this.j0.obtainMessage(1);
obtainMessage.sendToTarget();
}
}
} catch (Throwable th) {
if (AppCenterNewFragment.this.j0 != null) {
AppCenterNewFragment.this.j0.obtainMessage(1).sendToTarget();
}
throw th;
}
} finally {
AppCenterNewFragment.this.l0 = false;
}
}
}
public class g extends Thread {
public g() {
}
@Override
public void run() {
try {
AppCenterNewFragment.this.q.clear();
AppCenterNewFragment.this.q.addAll(AppCenterNewFragment.this.i.l());
AppCenterNewFragment.this.i0.sendEmptyMessage(9);
} catch (Exception e) {
e.printStackTrace();
}
}
}
public class h extends Thread {
public class a implements Runnable {
public final hn1 a;
public a(hn1 hn1Var) {
this.a = hn1Var;
}
@Override
public void run() {
try {
if (this.a.j()) {
JSONObject jSONObject = (JSONObject) this.a.e();
if (jSONObject.has(bk0.D9) && !jSONObject.isNull(bk0.D9) && "true".equals(jSONObject.getString(bk0.D9))) {
AppCenterNewFragment.this.v.findViewById(R.id.app_class_layout).setVisibility(0);
}
}
} catch (Exception unused) {
}
}
}
public h() {
}
@Override
public void run() {
try {
AppCenterNewFragment.this.C.runOnUiThread(new a(new rm1(AppCenterNewFragment.this.C).n(AppCenterNewFragment.this.C.getPackageName(), MyApplication.h().a.w())));
} catch (Throwable th) {
Log.a(bk0.V5, th.getMessage());
}
}
}
public class i extends BroadcastReceiver {
public i() {
}
@Override
public void onReceive(Context context, Intent intent) {
if ("android.intent.action.TIMEZONE_CHANGED".equals(intent.getAction()) || "android.intent.action.DATE_CHANGED".equalsIgnoreCase(intent.getAction())) {
AppCenterNewFragment.this.t();
AppCenterNewFragment.this.A.notifyDataSetChanged();
}
}
}
public class j extends Handler {
public j() {
}
@Override
public void handleMessage(Message message) {
super.handleMessage(message);
int i = message.what;
if (i == 1) {
AppCenterNewFragment.this.r();
} else if (i == 2 || i == 3) {
AppCenterNewFragment.this.q();
} else if (i != 4) {
if (i == 6 || i == 7) {
AppCenterNewFragment.this.o();
}
}
}
public j(AppCenterNewFragment appCenterNewFragment, a aVar) {
this();
}
}
public class k extends Handler {
public WeakReference<AppCenterNewFragment> a;
public k(AppCenterNewFragment appCenterNewFragment) {
this.a = new WeakReference<>(appCenterNewFragment);
}
@Override
public void handleMessage(Message message) {
JSONObject jSONObject;
AppCenterNewFragment appCenterNewFragment = this.a.get();
int i = message.what;
if (i != 1) {
if (i == 3) {
appCenterNewFragment.C.toastToMessage(R.string.inexistent_company);
return;
} else if (i == 4) {
appCenterNewFragment.v();
return;
} else if (i == 7) {
AppCenterNewFragment.this.c.f();
return;
} else if (i == 8) {
AppCenterNewFragment.this.d(true);
return;
} else if (i != 9) {
return;
} else {
AppCenterNewFragment.this.w();
return;
}
}
hn1 hn1Var = (hn1) message.obj;
try {
if ("0".equals(hn1Var.g()) && (jSONObject = (JSONObject) hn1Var.e()) != null && jSONObject.has("audit") && "2".equals(jSONObject.getString("audit")) && jSONObject.has("flag")) {
if ("1".equals(jSONObject.getString("flag"))) {
MyApplication.h().a.j(true);
} else if ("0".equals(jSONObject.getString("flag")) && jSONObject.has("isadmin") && "1".equals(jSONObject.getString("isadmin"))) {
appCenterNewFragment.C.startActivity(new Intent(appCenterNewFragment.C, EnterpriseBusiOpenActivity.class));
}
}
} catch (Exception e) {
Log.a(bk0.V5, e.getMessage(), e);
}
}
}
private void b(View view) {
}
public void q() {
}
public void r() {
}
private void u() {
if (this.h0 == null) {
this.h0 = new bp1(this.C);
}
this.h0.a(new b());
this.h0.a(this.y);
}
public synchronized void v() {
this.e = km0.r(MyApplication.h().a.y());
this.m.clear();
this.m.addAll(this.i.e());
this.n.clear();
this.n.putAll(this.i.f());
this.l.clear();
this.l.addAll(this.i.a(MyApplication.h().a.w(), MyApplication.h().a.v(), (String) null));
w();
}
public synchronized void w() {
if (this.x == null) {
this.x = new iv0(this.C, this.l, this.m, this.n, this.q);
this.x.j = new c();
this.x.b();
this.w.setAdapter((ListAdapter) this.x);
this.w.setOnItemClickListener(this.x.o);
this.w.setOnItemLongClickListener(this.x.p);
} else {
this.x.b();
this.x.notifyDataSetChanged();
}
ViewGroup.LayoutParams layoutParams = this.w.getLayoutParams();
layoutParams.height = (this.x.a() * this.C.getResources().getDimensionPixelSize(R.dimen.appcenter_item_height)) + (this.m.size() * (this.C.getResources().getDimensionPixelSize(R.dimen.appcenter_item_title_height) + this.C.getResources().getDimensionPixelSize(R.dimen.community_list_divider_w_height)));
this.w.setLayoutParams(layoutParams);
}
private void x() {
this.c.setVisibility(0);
String b2 = zl0.b(this.C, "appstore");
if (TextUtils.isEmpty(b2)) {
b2 = getString(R.string.appstore);
}
this.mTitleView.setYxTitleCenterTxt(b2);
this.mTitleView.setLeftViewImgOfLeftLLVisible(false);
}
@Override
public void finishNoti(String str) {
iv0 iv0Var;
super.finishNoti(str);
if (OnNotiReceiver.f.equals(str)) {
d(false);
hideProgressDialog();
}
if (OnNotiReceiver.k.equals(str)) {
x();
this.i0.sendEmptyMessage(8);
}
if (!OnNotiReceiver.d.equals(str) || (iv0Var = this.x) == null) {
return;
}
iv0Var.b();
}
@Override
public void onClick(View view) {
super.onClick(view);
if (view.getId() == R.id.yxTitle_Right_LL_RLRight) {
if (!bk0.M0) {
kk0.D(this.C);
} else {
u();
}
} else if (view.getId() == R.id.appcentre_org_name_layout) {
pg0.a(MyApplication.h(), nj0.M0, null, null);
startActivity(new Intent(this.C, ChooseOrganizationActivity.class));
} else if (view.getId() == R.id.add_app) {
} else {
if (view.getId() == R.id.yxTitle_Left_LL_RL) {
this.C.finish();
} else if (view.getId() == R.id.yxTitle_Left_LL_TV) {
} else {
if (view.getId() == R.id.app_add) {
Intent intent = new Intent(this.C, WebViewActivity.class);
intent.putExtra("url", bk0.U4);
startActivity(intent);
} else if (view.getId() == R.id.app_manage) {
Intent intent2 = new Intent(this.C, WebViewActivity.class);
intent2.putExtra("url", this.i.g());
startActivity(intent2);
}
}
}
}
@Override
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View view = this.v;
if (view != null) {
ViewGroup viewGroup2 = (ViewGroup) view.getParent();
if (viewGroup2 != null) {
viewGroup2.removeView(this.v);
}
} else {
this.v = layoutInflater.inflate(R.layout.activity_new_app_centre, viewGroup, false);
this.C = (FragmentBaseActivity) getActivity();
this.i = new ud1(this.C);
this.j = new kf1(bf1.L().r());
this.k = new sf1(bf1.L().r());
a(this.v);
d(false);
h();
x();
}
if (this.C.getIntent() != null && this.C.getIntent().getBooleanExtra("needBack", false)) {
this.mTitleView.setLeftViewOfLeftLL(R.drawable.ic_back);
}
return this.v;
}
@Override
public void onDestroy() {
try {
super.onDestroy();
if (this.r != null) {
sb1.a(this.C, this.r);
}
if (this.s != null) {
sb1.a(this.C, this.s);
}
if (this.u != null) {
sb1.a(this.C, this.u);
}
if (this.t != null) {
sb1.a(this.C, this.t);
}
MyApplication.h().b(bk0.wa, this);
MyApplication.h().b(bk0.Ba, this);
if (this.g0 != null) {
this.C.unregisterReceiver(this.g0);
}
if (this.m0 != null) {
this.C.unregisterReceiver(this.m0);
}
this.y.removeAllViews();
} catch (Throwable th) {
th.printStackTrace();
}
}
@Override
public void onHiddenChanged(boolean z) {
super.onHiddenChanged(z);
this.D = !z;
}
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i2, long j2) {
}
@Override
public void onPause() {
super.onPause();
this.D = false;
}
@Override
public void onResume() {
super.onResume();
this.D = true;
pg0.a(nj0.f2);
pg0.a(MyApplication.h(), nj0.e0, null, null);
}
private void e(boolean z) {
Date date;
if (z) {
f(true);
return;
}
String d2 = MyApplication.h().a.d(this.d);
if (km0.j(d2) && (!bk0.ca.equals(this.d) || bk0.b)) {
f(true);
} else if (km0.j(d2)) {
} else {
try {
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(d2);
} catch (ParseException e2) {
e2.printStackTrace();
date = null;
}
if (System.currentTimeMillis() - date.getTime() > 86400000) {
this.i0.sendEmptyMessage(4);
o();
this.D = false;
f(false);
return;
}
p();
this.i0.sendEmptyMessage(4);
o();
}
}
private void g(boolean z) {
e(z);
c(z);
oe1.a(z);
}
private View l() {
View view = new View(this.C);
view.setLayoutParams(new ViewGroup.LayoutParams(1, -1));
view.setBackgroundResource(R.color.list_division);
return view;
}
private void m() {
if (bk0.v) {
new Thread(new e()).start();
}
}
private void n() {
if (bk0.t) {
new Thread(new f()).start();
}
}
public void o() {
Thread thread = this.f0;
if (thread == null || thread.getState() == Thread.State.TERMINATED) {
this.f0 = new g();
this.f0.start();
}
}
private void p() {
View view = this.v;
if (view != null && view.findViewById(R.id.app_class_layout) != null) {
this.v.findViewById(R.id.app_class_layout).setVisibility(8);
}
if (bk0.G) {
new h().start();
}
}
private void s() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.intent.action.TIMEZONE_CHANGED");
intentFilter.addAction("android.intent.action.DATE_CHANGED");
getActivity().registerReceiver(this.m0, intentFilter);
}
public void t() {
this.B.clear();
PersonAppData personAppData = new PersonAppData();
personAppData.parseFromJsonString("{\"app_id\":\"yx_appid2020120414525093602\",\"app_name\":\"日历\",\"app_type\":\"web\",\"app_version\":\"1.0.0\",\"app_logo\":\"http://www.on-con.com/appsImages/AppIcon_yxCalendar.png\",\"app_rel_time\":\"2020-12-04 14:52:51.0\",\"app_author\":\"sitech\",\"app_remarks\":\"\",\"app_desc_url\":\"\",\"install_url\":\"\",\"load_url\":\"http://huiyi.teamshub.com/calendarApp/portal_manager/index\",\"packagename\":\"\",\"transact_key\":\"2e6e83930d8a8e5j\",\"comm_param\":\"\",\"app_class1_name\":\"\",\"app_class1_priority\":0,\"app_class1_code\":\"\",\"app_class2_name\":\"\",\"app_class2_priority\":0,\"app_class2_code\":\"\",\"priority\":0,\"attr_code\":100,\"attr_name\":\"我的办公\",\"browser\":\"in\"}");
personAppData.app_logo_resid = R.drawable.my_appcenter_topapp_cal;
personAppData.app_logo_txt = ik0.b(new Date());
this.B.add(personAppData);
PersonAppData personAppData2 = new PersonAppData();
personAppData2.parseFromJsonString("{\"app_id\":\"yx_appid2018122721254041202\",\"app_name\":\"待办\",\"app_type\":\"weex\",\"app_version\":\"1.0.0\",\"app_logo\":\"http://dfs.teamshub.com/group1/M00/00/11/CsoKyVwk06KALDtmAAAI9Tm2Dcg259.png\",\"app_rel_time\":\"2018-12-27 21:25:40.0\",\"app_author\":\"songcb\",\"app_remarks\":\"\",\"app_desc_url\":\"\",\"install_url\":\"\",\"load_url\":\"http://www.on-con.com/weexApp/todo/index.js\",\"packagename\":\"\",\"transact_key\":\"2e6e83930d8a8e5j\",\"comm_param\":\"\",\"app_class1_name\":\"\",\"app_class1_priority\":0,\"app_class1_code\":\"\",\"app_class2_name\":\"\",\"app_class2_priority\":0,\"app_class2_code\":\"\",\"priority\":0,\"attr_code\":100,\"attr_name\":\"我的办公\",\"browser\":\"in\"}");
personAppData2.app_logo_resid = R.drawable.my_appcenter_topapp_todo;
this.B.add(personAppData2);
PersonAppData personAppData3 = new PersonAppData();
personAppData3.parseFromJsonString("{\"app_id\":\"yx_appid2018122721273766502\",\"app_name\":\"任务\",\"app_type\":\"weex\",\"app_version\":\"1.0.0\",\"app_logo\":\"http://dfs.teamshub.com/group1/M00/A3/A8/CsoKylwtrZuAcmY6AAAICeh8sW4414.png\",\"app_rel_time\":\"2018-12-27 21:27:37.0\",\"app_author\":\"songcb\",\"app_remarks\":\"\",\"app_desc_url\":\"\",\"install_url\":\"\",\"load_url\":\"http://www.on-con.com/weexApp/task/index.js\",\"packagename\":\"\",\"transact_key\":\"2e6e83930d8a8e5j\",\"comm_param\":\"\",\"app_class1_name\":\"\",\"app_class1_priority\":0,\"app_class1_code\":\"\",\"app_class2_name\":\"\",\"app_class2_priority\":0,\"app_class2_code\":\"\",\"priority\":0,\"attr_code\":100,\"attr_name\":\"我的办公\",\"browser\":\"in\"}");
personAppData3.app_logo_resid = R.drawable.my_appcenter_topapp_task;
this.B.add(personAppData3);
}
public void d(boolean z) {
this.d = km0.r(MyApplication.h().a.w());
this.h = km0.r(MyApplication.h().a.v());
this.e = km0.r(MyApplication.h().a.y());
if (!km0.j(this.e) && (!bk0.ca.equals(this.d) || bk0.b)) {
ArrayList<CompanyData> b2 = this.k.b();
if (b2 != null) {
if (b2.size() == 1) {
this.v.findViewById(R.id.appcentre_org_name_layout).setVisibility(8);
} else {
this.v.findViewById(R.id.appcentre_org_name_layout).setVisibility(0);
this.a.setText(this.e);
}
}
} else {
this.v.findViewById(R.id.appcentre_org_name_layout).setVisibility(0);
this.a.setText(getResources().getString(R.string.company_null));
}
g(z);
}
@Override
public void f(String str) {
if (this.n.containsKey(str)) {
this.n.remove(str);
this.i0.sendEmptyMessage(4);
}
}
public void h() {
this.r = new OnNotiReceiver();
this.r.a(OnNotiReceiver.f, this);
sb1.a(this.C, this.r, new IntentFilter(OnNotiReceiver.f));
this.s = new OnNotiReceiver();
this.s.a(OnNotiReceiver.k, this);
sb1.a(this.C, this.s, new IntentFilter(OnNotiReceiver.k));
this.u = new OnNotiReceiver();
this.u.a(OnNotiReceiver.n, this);
sb1.a(this.C, this.u, new IntentFilter(OnNotiReceiver.n));
this.t = new OnNotiReceiver();
this.t.a(OnNotiReceiver.d, this);
sb1.a(this.C, this.t, new IntentFilter(OnNotiReceiver.d));
this.v.findViewById(R.id.yxTitle_Left_LL_RL).setOnClickListener(this);
this.v.findViewById(R.id.yxTitle_Left_LL_TV).setOnClickListener(this);
this.v.findViewById(R.id.yxTitle_Right_LL_RLRight).setOnClickListener(this);
this.v.findViewById(R.id.appcentre_org_name_layout).setOnClickListener(this);
this.v.findViewById(R.id.yxTitle_Left_LL).setOnClickListener(this);
this.v.findViewById(R.id.add_app).setOnClickListener(this);
this.v.findViewById(R.id.app_add).setOnClickListener(this);
this.v.findViewById(R.id.app_manage).setOnClickListener(this);
this.g0 = new d();
IntentFilter intentFilter = new IntentFilter("android.intent.action.PACKAGE_ADDED");
intentFilter.addAction("android.intent.action.PACKAGE_REMOVED");
intentFilter.addDataScheme("package");
this.C.registerReceiver(this.g0, intentFilter);
MyApplication.h().a(bk0.Ba, this);
MyApplication.h().a(bk0.wa, this);
s();
}
public void a(View view) {
this.mTitleView = (CustomWebTitleView) view.findViewById(R.id.title);
this.y = (LinearLayout) view.findViewById(R.id.topLayout);
this.c = (PullToRefreshScrollView) view.findViewById(R.id.pull_refresh_scrollview);
this.a = (TextView) view.findViewById(R.id.appcentre_org_name);
this.b = (LinearLayout) view.findViewById(R.id.app_class_layout);
this.c.setOnRefreshListener(new a());
this.w = (MyAppSticklyGridHeadersView) view.findViewById(R.id.myapp);
this.z = (RecyclerView) view.findViewById(R.id.topapp);
this.z.setLayoutManager(new GridLayoutManager(getContext(), 3));
t();
this.A = new TopAppAdapter(this.C, this.i, this.B);
this.z.setAdapter(this.A);
if (bk0.s2) {
this.mTitleView.setRightViewOfRightLLVisible(true);
if (bk0.M0) {
this.mTitleView.setRightViewOfRightLL(R.drawable.ic_nfc);
} else {
this.mTitleView.setRightViewOfRightLL(R.drawable.ic_app_center);
}
} else {
this.mTitleView.setRightViewOfRightLLVisible(false);
}
setTitleSkinEnable();
b(view);
}
public void b(boolean z) {
Date date;
if (z) {
m();
return;
}
String e2 = this.j.e();
if (km0.j(e2)) {
m();
} else if (km0.j(e2)) {
} else {
try {
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(e2);
} catch (ParseException e3) {
e3.printStackTrace();
date = null;
}
if (System.currentTimeMillis() - date.getTime() > 86400000) {
m();
return;
}
this.p.clear();
this.p.addAll(this.j.f());
q();
}
}
public void c(boolean z) {
Date date;
if (z) {
n();
return;
}
String h2 = this.j.h();
if (km0.j(h2)) {
n();
} else if (km0.j(h2)) {
} else {
try {
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(h2);
} catch (ParseException e2) {
e2.printStackTrace();
date = null;
}
if (System.currentTimeMillis() - date.getTime() > 86400000) {
n();
return;
}
this.o.clear();
this.o.addAll(this.j.g());
r();
}
}
@Override
public void f() {
this.i0.sendEmptyMessage(4);
}
private synchronized void f(boolean z) {
if (z) {
if (getUserVisibleHint()) {
showProgressDialog(R.string.wait, true);
}
}
je1.a();
p();
}
@Override
public void d(String str, String str2) {
PersonAppNotiData parse = PersonAppNotiData.parse(str, str2);
if (this.n.containsKey(str) && this.n.get(str).num == parse.num) {
return;
}
this.n.put(str, parse);
this.i0.sendEmptyMessage(4);
}
@Override
public void a(hn1 hn1Var) {
if (hn1Var != null && hn1Var.j()) {
ArrayList arrayList = (ArrayList) hn1Var.e();
if (arrayList != null && arrayList.size() > 0) {
if (this.e0) {
this.i0.sendEmptyMessage(8);
this.e0 = false;
}
} else {
this.i0.sendEmptyMessage(3);
}
}
this.i0.sendEmptyMessage(7);
}
public boolean a(int i2, KeyEvent keyEvent) {
if (i2 == 4) {
sb1.p(this.C);
return true;
}
return false;
}
private LinearLayout a(AppClassData appClassData, int i2) {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(BaseFragment.screenWidth / 4, -1);
LinearLayout linearLayout = new LinearLayout(this.C);
linearLayout.setLayoutParams(layoutParams);
linearLayout.setGravity(17);
linearLayout.setBackgroundResource(R.drawable.app_item_bg);
linearLayout.setOnClickListener(this);
linearLayout.addView(new rq1(appClassData, this.C));
return linearLayout;
}
}