思特奇智慧酒店云平台 v0.0.5版本的 MD5 值为:dedb172bb322639d79d7e0e26262fb5c
以下内容为反编译后的 AppCenterFragment.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.content.res.Configuration;
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.FrameLayout;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.viewpager.widget.ViewPager;
import com.sitech.core.util.Log;
import com.sitech.oncon.R;
import com.sitech.oncon.activity.AppCenterFragment;
import com.sitech.oncon.activity.appcenter.MngView;
import com.sitech.oncon.activity.appcenter.OrgView;
import com.sitech.oncon.activity.appcenter.WorkbenchAdapter;
import com.sitech.oncon.activity.appcenter.data.WorkbenchData;
import com.sitech.oncon.activity.appcenter.data.WorkbenchModuleData;
import com.sitech.oncon.adapter.AppcenterAdapter;
import com.sitech.oncon.app.team.NoEnterAccountPromptView;
import com.sitech.oncon.application.MyApplication;
import com.sitech.oncon.data.AppAdData;
import com.sitech.oncon.data.CompanyData;
import com.sitech.oncon.data.MemberData;
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 defpackage.bp1;
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 java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONObject;
@SuppressLint({"HandlerLeak", "SimpleDateFormat", "InflateParams"})
public class AppCenterFragment extends BaseFragment implements lj1, kk1 {
public static final int A0 = 5;
public static final int B0 = 6;
public static final int C0 = 7;
public static final int D0 = 8;
public static final Object v0 = new Object();
public static final int w0 = 1;
public static final int x0 = 2;
public static final int y0 = 3;
public static final int z0 = 4;
public FrameLayout A;
public NoEnterAccountPromptView B;
public OrgView C;
public MngView D;
public SwipeRefreshLayout a;
public RecyclerView b;
public RecyclerView c;
public RecyclerView d;
public AppcenterAdapter e;
public ViewPager e0;
public AppcenterAdapter f;
public FragmentBaseActivity f0;
public WorkbenchAdapter g;
public ud1 h;
public sf1 i;
public BroadcastReceiver i0;
public hp0 j;
public bp1 j0;
public String k0;
public String l0;
public MemberData m0;
public kg1 n0;
public OnNotiReceiver v;
public OnNotiReceiver w;
public OnNotiReceiver x;
public OnNotiReceiver y;
public View z;
public List<Object> k = new ArrayList();
public List<Object> l = new ArrayList();
public List<AppAdData> m = new ArrayList();
public ArrayList<PersonAppCategoryData> n = new ArrayList<>();
public HashMap<String, PersonAppNotiData> o = new HashMap<>();
public List<PackageInfo> p = new ArrayList();
public List<PersonAppData> q = new ArrayList();
public List<WorkbenchData> r = new ArrayList();
public List<WorkbenchData> s = new ArrayList();
public List<WorkbenchModuleData> t = new ArrayList();
public List<CompanyData> u = new ArrayList();
public boolean g0 = false;
public boolean h0 = false;
public AtomicBoolean o0 = new AtomicBoolean(false);
public k p0 = new k(this);
public AtomicBoolean q0 = new AtomicBoolean(false);
public BroadcastReceiver r0 = new i();
public AtomicBoolean s0 = new AtomicBoolean(false);
public AtomicBoolean t0 = new AtomicBoolean(false);
public AtomicBoolean u0 = new AtomicBoolean(false);
public class a extends Thread {
public a() {
}
@Override
public void run() {
String str;
try {
try {
AppCenterFragment.this.o.clear();
AppCenterFragment.this.o.putAll(AppCenterFragment.this.h.f());
Iterator it = AppCenterFragment.this.n.iterator();
boolean z = false;
while (it.hasNext()) {
Iterator<PersonAppData> it2 = ((PersonAppCategoryData) it.next()).list.iterator();
while (it2.hasNext()) {
PersonAppData next = it2.next();
PersonAppNotiData personAppNotiData = (PersonAppNotiData) AppCenterFragment.this.o.get(next.app_id);
String str2 = next.appNotiNum;
if (personAppNotiData == null) {
str = "0";
} else {
str = personAppNotiData.num + "";
}
next.appNotiNum = str;
if (!next.appNotiNum.equalsIgnoreCase(str2)) {
z = true;
}
}
}
if (z) {
AppCenterFragment.this.p0.sendEmptyMessage(7);
}
} catch (Exception e) {
Log.a((Throwable) e);
}
} finally {
AppCenterFragment.this.t0.set(false);
}
}
}
public class b extends GridLayoutManager.SpanSizeLookup {
public b() {
}
@Override
public int getSpanSize(int i) {
int itemViewType = AppCenterFragment.this.e.getItemViewType(i);
if (itemViewType != 3) {
return itemViewType != 5 ? 12 : 3;
}
return 4;
}
}
public class c extends RecyclerView.OnScrollListener {
public c() {
}
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int i, int i2) {
super.onScrolled(recyclerView, i, i2);
boolean z = false;
AppCenterFragment.this.a.setEnabled((recyclerView.getChildCount() == 0 || recyclerView.getChildAt(0).getTop() >= 0) ? true : true);
}
}
public class d implements WorkbenchAdapter.a {
public d() {
}
@Override
public void a(int i) {
MyApplication.h().a.i(i);
AppCenterFragment.this.c(false);
}
}
public class e implements bp1.c {
public e() {
}
@Override
public void a(int i) {
if (i == R.id.scan_TV) {
kk0.D(AppCenterFragment.this.f0);
AppCenterFragment.this.j0.dismiss();
} else if (i == R.id.chip_TV) {
Intent intent = new Intent(AppCenterFragment.this.f0, WebViewActivity.class);
intent.putExtra("url", bk0.r5);
intent.putExtra("title", AppCenterFragment.this.f0.getString(R.string.nfc_title));
AppCenterFragment.this.f0.startActivity(intent);
AppCenterFragment.this.j0.dismiss();
}
}
}
public class f extends Thread {
public f() {
}
@Override
public void run() {
PersonAppNotiData personAppNotiData;
String str;
try {
try {
String w = MyApplication.h().a.w();
AppCenterFragment.this.r();
AppCenterFragment.this.t();
AppCenterFragment.this.s();
if (bk0.v) {
AppCenterFragment.this.m.clear();
AppCenterFragment.this.m.addAll(AppCenterFragment.this.h.b().f());
}
AppCenterFragment.this.o.clear();
AppCenterFragment.this.o.putAll(AppCenterFragment.this.h.f());
AppCenterFragment.this.n.clear();
AppCenterFragment.this.n.addAll(AppCenterFragment.this.h.b(w, MyApplication.h().a.v(), 0));
boolean z = AppCenterFragment.this.p.size() == 0;
Iterator it = AppCenterFragment.this.n.iterator();
while (it.hasNext()) {
Iterator<PersonAppData> it2 = ((PersonAppCategoryData) it.next()).list.iterator();
while (it2.hasNext()) {
PersonAppData next = it2.next();
if (next.isNative() && z) {
AppCenterFragment.this.y();
z = false;
}
next.hasNewVersion = AppCenterFragment.this.h.b(next, AppCenterFragment.this.p);
if (((PersonAppNotiData) AppCenterFragment.this.o.get(next.app_id)) == null) {
str = "0";
} else {
str = personAppNotiData.num + "";
}
next.appNotiNum = str;
}
}
if (bk0.u) {
PersonAppCategoryData b = AppCenterFragment.this.h.b(w, AppCenterFragment.this.n);
PersonAppCategoryData a = AppCenterFragment.this.h.a(w, AppCenterFragment.this.n);
AppCenterFragment.this.n.add(b.idx, b);
AppCenterFragment.this.n.add(a.idx, a);
}
AppCenterFragment.this.p0.sendEmptyMessage(8);
} catch (Exception e) {
Log.a((Throwable) e);
}
} finally {
AppCenterFragment.this.o0.set(false);
}
}
}
public class g extends BroadcastReceiver {
public g() {
}
@Override
public void onReceive(Context context, Intent intent) {
intent.getDataString().substring(8);
if (intent.getAction().equals("android.intent.action.PACKAGE_ADDED")) {
AppCenterFragment.this.x();
}
if (intent.getAction().equals("android.intent.action.PACKAGE_REMOVED")) {
AppCenterFragment.this.x();
}
}
}
public class h extends Thread {
public h() {
}
@Override
public void run() {
try {
try {
hn1 n = new rm1(AppCenterFragment.this.f0).n(AppCenterFragment.this.f0.getPackageName(), AppCenterFragment.this.l0);
if (n.j()) {
JSONObject jSONObject = (JSONObject) n.e();
if (jSONObject.has(bk0.D9) && !jSONObject.isNull(bk0.D9) && "true".equals(jSONObject.getString(bk0.D9))) {
MyApplication.h().a.a(AppCenterFragment.this.l0, true);
AppCenterFragment.this.p0.sendEmptyMessage(6);
}
}
} catch (Exception e) {
Log.a((Throwable) e);
}
} finally {
AppCenterFragment.this.q0.set(false);
}
}
}
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())) {
int i = 0;
while (true) {
try {
if (i >= AppCenterFragment.this.k.size()) {
break;
}
Object obj = AppCenterFragment.this.k.get(i);
if (obj instanceof PersonAppData) {
PersonAppData personAppData = (PersonAppData) obj;
if (personAppData.app_logo_resid == R.drawable.my_appcenter_topapp_cal) {
personAppData.app_logo_txt = ik0.b(new Date());
break;
}
}
i++;
} catch (Throwable th) {
Log.a(th);
return;
}
}
AppCenterFragment.this.e.notifyDataSetChanged();
}
}
}
public class j extends Thread {
public j() {
}
@Override
public void run() {
try {
try {
Iterator it = AppCenterFragment.this.n.iterator();
boolean z = false;
boolean z2 = true;
while (it.hasNext()) {
Iterator<PersonAppData> it2 = ((PersonAppCategoryData) it.next()).list.iterator();
while (it2.hasNext()) {
PersonAppData next = it2.next();
if (next.isNative() && z2) {
AppCenterFragment.this.y();
z2 = false;
}
boolean z3 = next.hasNewVersion;
next.hasNewVersion = AppCenterFragment.this.h.b(next, AppCenterFragment.this.p);
if (next.hasNewVersion != z3) {
z = true;
}
}
}
if (z) {
AppCenterFragment.this.p0.sendEmptyMessage(7);
}
} catch (Exception e) {
Log.a((Throwable) e);
}
} finally {
AppCenterFragment.this.s0.set(false);
}
}
}
public class k extends Handler {
public WeakReference<AppCenterFragment> a;
public k(AppCenterFragment appCenterFragment) {
this.a = new WeakReference<>(appCenterFragment);
}
@Override
public void handleMessage(Message message) {
AppCenterFragment appCenterFragment = this.a.get();
switch (message.what) {
case 2:
appCenterFragment.f0.toastToMessage(R.string.inexistent_company);
return;
case 3:
appCenterFragment.v();
return;
case 4:
AppCenterFragment.this.a.setRefreshing(false);
return;
case 5:
AppCenterFragment.this.c(true);
return;
case 6:
if (bk0.u) {
AppCenterFragment.this.e.notifyDataSetChanged();
AppCenterFragment.this.D.setVisibility(8);
return;
}
AppCenterFragment.this.D.setVisibility(0);
return;
case 7:
AppCenterFragment.this.e.notifyDataSetChanged();
return;
case 8:
AppCenterFragment.this.A();
return;
default:
return;
}
}
}
public void A() {
try {
this.k.clear();
if (!TextUtils.isEmpty(MyApplication.h().a.y()) && (!bk0.ca.equals(this.l0) || bk0.b)) {
this.u.clear();
this.u.addAll(m().b());
if (this.u != null && this.u.size() > 1) {
this.C.setVisibility(0);
this.C.a();
} else {
this.C.setVisibility(8);
}
if (!MyApplication.h().a.b(this.l0) && !bk0.u) {
this.D.setVisibility(0);
} else {
this.D.setVisibility(8);
}
this.l.clear();
this.l.addAll(this.q);
this.f.notifyDataSetChanged();
this.s.clear();
this.s.addAll(this.r);
this.g.notifyDataSetChanged();
if (this.g.c != 0) {
if (bk0.v && this.m.size() > 0) {
this.k.add(this.m);
}
Iterator<PersonAppCategoryData> it = this.n.iterator();
while (it.hasNext()) {
PersonAppCategoryData next = it.next();
this.k.add(next);
if (!bk0.u) {
this.k.addAll(next.list);
}
}
if (this.n.size() > 0) {
this.k.add("unknown");
}
} else if (this.t.size() > 0) {
this.k.add(this.t);
this.k.add("unknown");
}
this.e.notifyDataSetChanged();
}
this.C.setVisibility(0);
this.C.a();
if (!MyApplication.h().a.b(this.l0)) {
}
this.D.setVisibility(8);
this.l.clear();
this.l.addAll(this.q);
this.f.notifyDataSetChanged();
this.s.clear();
this.s.addAll(this.r);
this.g.notifyDataSetChanged();
if (this.g.c != 0) {
}
this.e.notifyDataSetChanged();
} catch (Throwable th) {
Log.a(th);
}
}
private void b(View view) {
}
private void u() {
if (this.j0 == null) {
this.j0 = new bp1(this.f0);
}
this.j0.a(new e());
this.j0.a(this.A);
}
public void v() {
if (this.o0.compareAndSet(false, true)) {
new f().start();
}
}
private void w() {
if (this.t0.compareAndSet(false, true)) {
new a().start();
}
}
public void x() {
if (this.s0.compareAndSet(false, true)) {
new j().start();
}
}
public synchronized void y() {
this.p.clear();
this.p.addAll(this.h.l());
}
private void z() {
String b2 = zl0.b(this.f0, "appstore");
if (TextUtils.isEmpty(b2)) {
b2 = this.f0.getString(R.string.appstore);
}
this.mTitleView.setYxTitleCenterTxt(b2);
this.mTitleView.setLeftViewImgOfLeftLLVisible(false);
}
@Override
public void finishNoti(String str) {
super.finishNoti(str);
if (OnNotiReceiver.f.equals(str)) {
c(false);
hideProgressDialog();
}
if (OnNotiReceiver.k.equals(str)) {
this.u.clear();
this.u.addAll(m().b());
p();
z();
this.p0.sendEmptyMessage(5);
}
if (OnNotiReceiver.d.equals(str)) {
p();
}
}
@Override
public void onClick(View view) {
super.onClick(view);
if (view.getId() == R.id.yxTitle_Right_LL_RLRight) {
if (!bk0.M0) {
kk0.D(this.f0);
} else {
u();
}
} else if (view.getId() == R.id.yxTitle_Left_LL_RL) {
this.f0.finish();
}
}
@Override
public void onConfigurationChanged(@NonNull Configuration configuration) {
super.onConfigurationChanged(configuration);
this.e.notifyDataSetChanged();
}
@Override
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View view = this.z;
if (view != null) {
ViewGroup viewGroup2 = (ViewGroup) view.getParent();
if (viewGroup2 != null) {
viewGroup2.removeView(this.z);
}
} else {
this.z = layoutInflater.inflate(R.layout.activity_app_centre, viewGroup, false);
this.f0 = (FragmentBaseActivity) getActivity();
this.h = new ud1(this.f0);
this.n0 = new kg1(bf1.L().r());
this.m0 = new MemberData();
p();
a(this.z);
c(false);
l();
z();
}
if (this.f0.getIntent() != null && this.f0.getIntent().getBooleanExtra("needBack", false)) {
this.mTitleView.setLeftViewOfLeftLL(R.drawable.ic_back);
}
return this.z;
}
@Override
public void onDestroy() {
try {
super.onDestroy();
if (this.v != null) {
sb1.a(this.f0, this.v);
}
if (this.w != null) {
sb1.a(this.f0, this.w);
}
if (this.y != null) {
sb1.a(this.f0, this.y);
}
if (this.x != null) {
sb1.a(this.f0, this.x);
}
MyApplication.h().b(bk0.wa, this);
MyApplication.h().b(bk0.Ba, this);
if (this.i0 != null) {
this.f0.unregisterReceiver(this.i0);
}
if (this.r0 != null) {
this.f0.unregisterReceiver(this.r0);
}
this.A.removeAllViews();
} catch (Throwable th) {
th.printStackTrace();
}
}
@Override
public void onHiddenChanged(boolean z) {
super.onHiddenChanged(z);
this.g0 = !z;
}
@Override
public void onPause() {
super.onPause();
this.g0 = false;
}
@Override
public void onResume() {
super.onResume();
this.g0 = true;
pg0.a(nj0.f2);
pg0.a(MyApplication.h(), nj0.e0, null, null);
showNoEnterAccountPromptView();
}
@Override
public void showNoEnterAccountPromptView() {
if (this.u0.compareAndSet(false, true)) {
for (int i2 = 0; i2 < this.A.getChildCount(); i2++) {
View childAt = this.A.getChildAt(i2);
if (childAt instanceof NoEnterAccountPromptView) {
this.A.removeView(childAt);
}
}
if (canDealByUserRole()) {
this.a.setEnabled(true);
this.b.setEnabled(true);
this.mTitleView.l.setEnabled(true);
this.mTitleView.c.setEnabled(true);
} else {
if (this.B == null) {
this.B = new NoEnterAccountPromptView(this.f0);
}
this.A.addView(this.B);
this.a.setEnabled(false);
this.b.setEnabled(false);
this.mTitleView.l.setEnabled(false);
this.mTitleView.c.setEnabled(false);
}
this.u0.set(false);
}
}
private synchronized void e(boolean z) {
if (z) {
if (getUserVisibleHint()) {
showProgressDialog(R.string.wait, true);
}
}
je1.a();
n();
}
private sf1 m() {
if (this.i == null) {
synchronized (v0) {
if (this.i == null) {
this.i = new sf1(bf1.L().r());
}
}
}
return this.i;
}
private void n() {
if (bk0.G && this.q0.compareAndSet(false, true)) {
this.D.setVisibility(8);
MyApplication.h().a.a(this.l0, false);
this.e.notifyDataSetChanged();
new h().start();
}
}
private hp0 o() {
if (this.j == null) {
synchronized (v0) {
if (this.j == null) {
this.j = new hp0(bf1.L().r());
}
}
}
return this.j;
}
private void p() {
this.l0 = km0.r(MyApplication.h().a.w());
this.k0 = km0.r(MyApplication.h().a.y());
this.m0.mobile = bf1.L().b();
MemberData c2 = this.n0.c(this.l0, this.m0.mobile);
if (c2 != null) {
MemberData memberData = this.m0;
memberData.name = c2.name;
memberData.enterid = c2.enterid;
} else {
MemberData memberData2 = this.m0;
memberData2.name = "";
memberData2.enterid = "";
}
this.m0.empid = km0.r(MyApplication.h().a.v());
this.m0.enter_code = this.l0;
}
private void q() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.intent.action.TIMEZONE_CHANGED");
intentFilter.addAction("android.intent.action.DATE_CHANGED");
getActivity().registerReceiver(this.r0, intentFilter);
}
public void r() {
if (bk0.uc) {
this.q.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());
personAppData.position = PersonAppData.POSITION_TOP;
personAppData.idx = 0;
this.q.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;
personAppData2.position = PersonAppData.POSITION_TOP;
personAppData2.idx = 1;
this.q.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;
personAppData3.position = PersonAppData.POSITION_TOP;
personAppData3.idx = 2;
this.q.add(personAppData3);
}
}
public void s() {
if (bk0.vc) {
this.t.clear();
if (this.g.c == 0) {
return;
}
try {
this.t.addAll(o().a(this.r.get(this.g.c).workbenchId));
} catch (Throwable th) {
Log.a(th);
}
}
}
public void t() {
if (bk0.vc) {
this.r.clear();
WorkbenchData workbenchData = new WorkbenchData();
workbenchData.workbenchId = "-1";
workbenchData.workbenchName = "全员";
this.r.add(workbenchData);
this.r.addAll(o().a());
if (this.g.c > this.r.size() - 1) {
this.g.c = 0;
}
}
}
public void a(View view) {
GridLayoutManager gridLayoutManager;
this.mTitleView = (CustomWebTitleView) view.findViewById(R.id.title);
this.A = (FrameLayout) view.findViewById(R.id.topLayout);
this.a = (SwipeRefreshLayout) view.findViewById(R.id.pull_refresh_scrollview);
this.a.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public final void onRefresh() {
AppCenterFragment.this.h();
}
});
this.C = (OrgView) view.findViewById(R.id.f112org);
this.D = (MngView) view.findViewById(R.id.mng);
this.b = (RecyclerView) view.findViewById(R.id.rv);
if (bk0.u) {
gridLayoutManager = new GridLayoutManager(this.f0, 1);
this.b.setBackgroundColor(0);
} else {
this.b.setBackgroundColor(-1);
gridLayoutManager = new GridLayoutManager(this.f0, 12);
gridLayoutManager.setSpanSizeLookup(new b());
}
this.b.setLayoutManager(gridLayoutManager);
this.e = new AppcenterAdapter(this.f0, this.k);
AppcenterAdapter appcenterAdapter = this.e;
appcenterAdapter.a = this.h;
appcenterAdapter.e = new AppcenterAdapter.g() {
@Override
public final void a(boolean z) {
AppCenterFragment.this.b(z);
}
};
appcenterAdapter.b = this.m0;
appcenterAdapter.g = this.e0;
appcenterAdapter.h = this.a;
this.b.setAdapter(appcenterAdapter);
this.b.addOnScrollListener(new c());
this.d = (RecyclerView) view.findViewById(R.id.bench);
this.d.setLayoutManager(new LinearLayoutManager(this.f0, 0, false));
this.g = new WorkbenchAdapter(this.f0, this.s);
this.g.d = new d();
this.d.setAdapter(this.g);
this.c = (RecyclerView) view.findViewById(R.id.toprv);
this.c.setLayoutManager(new GridLayoutManager(this.f0, 3));
this.f = new AppcenterAdapter(this.f0, this.l);
AppcenterAdapter appcenterAdapter2 = this.f;
appcenterAdapter2.a = this.h;
appcenterAdapter2.b = this.m0;
this.c.setAdapter(appcenterAdapter2);
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) {
if (z) {
c(false);
toastToMessage(R.string.delete_app_seccess);
return;
}
toastToMessage(R.string.delete_app_fail);
}
public void c(boolean z) {
d(z);
oe1.a(z);
}
@Override
public void d(String str, String str2) {
PersonAppNotiData parse = PersonAppNotiData.parse(str, str2);
if (this.o.containsKey(str) && this.o.get(str).num == parse.num) {
return;
}
w();
}
@Override
public void f(String str) {
if (this.o.containsKey(str)) {
w();
}
}
public void h() {
this.h0 = true;
me1.a();
}
public void l() {
this.v = new OnNotiReceiver();
this.v.a(OnNotiReceiver.f, this);
sb1.a(this.f0, this.v, new IntentFilter(OnNotiReceiver.f));
this.w = new OnNotiReceiver();
this.w.a(OnNotiReceiver.k, this);
sb1.a(this.f0, this.w, new IntentFilter(OnNotiReceiver.k));
this.y = new OnNotiReceiver();
this.y.a(OnNotiReceiver.n, this);
sb1.a(this.f0, this.y, new IntentFilter(OnNotiReceiver.n));
this.x = new OnNotiReceiver();
this.x.a(OnNotiReceiver.d, this);
sb1.a(this.f0, this.x, new IntentFilter(OnNotiReceiver.d));
this.z.findViewById(R.id.yxTitle_Left_LL_RL).setOnClickListener(this);
this.z.findViewById(R.id.yxTitle_Left_LL_TV).setOnClickListener(this);
this.z.findViewById(R.id.yxTitle_Right_LL_RLRight).setOnClickListener(this);
this.z.findViewById(R.id.yxTitle_Left_LL).setOnClickListener(this);
this.i0 = new g();
IntentFilter intentFilter = new IntentFilter("android.intent.action.PACKAGE_ADDED");
intentFilter.addAction("android.intent.action.PACKAGE_REMOVED");
intentFilter.addDataScheme("package");
this.f0.registerReceiver(this.i0, intentFilter);
MyApplication.h().a(bk0.Ba, this);
MyApplication.h().a(bk0.wa, this);
q();
}
@Override
public void f() {
this.p0.sendEmptyMessage(3);
}
private void d(boolean z) {
if (z) {
e(true);
return;
}
String d2 = MyApplication.h().a.d(this.l0);
if (TextUtils.isEmpty(d2)) {
e(true);
return;
}
Date date = null;
try {
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(d2);
} catch (ParseException e2) {
e2.printStackTrace();
}
v();
if (System.currentTimeMillis() - date.getTime() > 86400000) {
this.g0 = false;
e(false);
return;
}
n();
}
@Override
public void a(hn1 hn1Var) {
if (hn1Var != null && hn1Var.j()) {
ArrayList arrayList = (ArrayList) hn1Var.e();
if (arrayList != null && arrayList.size() > 0) {
if (this.h0) {
this.p0.sendEmptyMessage(5);
this.h0 = false;
}
} else {
this.p0.sendEmptyMessage(2);
}
}
this.p0.sendEmptyMessage(4);
}
public boolean a(int i2, KeyEvent keyEvent) {
if (i2 == 4) {
sb1.p(this.f0);
return true;
}
return false;
}
}