思特奇智慧酒店云平台 v0.0.5版本的 MD5 值为:dedb172bb322639d79d7e0e26262fb5c

以下内容为反编译后的 AppCenterFragment2.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.FrameLayout;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
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.AppCenterFragment2;
import com.sitech.oncon.activity.appcenter.MngView;
import com.sitech.oncon.activity.appcenter.OrgView;
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 AppCenterFragment2 extends BaseFragment implements lj1, kk1 {
    public static final Object q0 = new Object();
    public static final int r0 = 1;
    public static final int s0 = 2;
    public static final int t0 = 3;
    public static final int u0 = 4;
    public static final int v0 = 5;
    public static final int w0 = 6;
    public static final int x0 = 7;
    public static final int y0 = 8;
    public FragmentBaseActivity A;
    public BroadcastReceiver D;
    public SwipeRefreshLayout a;
    public RecyclerView b;
    public RecyclerView c;
    public AppcenterAdapter d;
    public AppcenterAdapter e;
    public bp1 e0;
    public ud1 f;
    public String f0;
    public sf1 g;
    public String g0;
    public MemberData h0;
    public kg1 i0;
    public OnNotiReceiver q;
    public OnNotiReceiver r;
    public OnNotiReceiver s;
    public OnNotiReceiver t;
    public View u;
    public FrameLayout v;
    public NoEnterAccountPromptView w;
    public OrgView x;
    public MngView y;
    public ViewPager z;
    public List<Object> h = new ArrayList();
    public List<Object> i = new ArrayList();
    public List<AppAdData> j = new ArrayList();
    public ArrayList<PersonAppCategoryData> k = new ArrayList<>();
    public HashMap<String, PersonAppNotiData> l = new HashMap<>();
    public List<PackageInfo> m = new ArrayList();
    public List<PersonAppData> n = new ArrayList();
    public List<ff1> o = new ArrayList();
    public List<CompanyData> p = new ArrayList();
    public boolean B = false;
    public boolean C = false;
    public AtomicBoolean j0 = new AtomicBoolean(false);
    public j k0 = new j(this);
    public AtomicBoolean l0 = new AtomicBoolean(false);
    public BroadcastReceiver m0 = new g();
    public AtomicBoolean n0 = new AtomicBoolean(false);
    public AtomicBoolean o0 = new AtomicBoolean(false);
    public AtomicBoolean p0 = new AtomicBoolean(false);

    public class a extends GridLayoutManager.SpanSizeLookup {
        public a() {
        }

        @Override
        public int getSpanSize(int i) {
            int itemViewType = AppCenterFragment2.this.d.getItemViewType(i);
            if (itemViewType != 3) {
                return itemViewType != 5 ? 12 : 3;
            }
            return 4;
        }
    }

    public class b extends RecyclerView.OnScrollListener {
        public b() {
        }

        @Override
        public void onScrolled(@NonNull RecyclerView recyclerView, int i, int i2) {
            super.onScrolled(recyclerView, i, i2);
            boolean z = false;
            AppCenterFragment2.this.a.setEnabled((recyclerView.getChildCount() == 0 || recyclerView.getChildAt(0).getTop() >= 0) ? true : true);
        }
    }

    public class c implements bp1.c {
        public c() {
        }

        @Override
        public void a(int i) {
            if (i == R.id.scan_TV) {
                kk0.D(AppCenterFragment2.this.A);
                AppCenterFragment2.this.e0.dismiss();
            } else if (i == R.id.chip_TV) {
                Intent intent = new Intent(AppCenterFragment2.this.A, WebViewActivity.class);
                intent.putExtra("url", bk0.r5);
                intent.putExtra("title", AppCenterFragment2.this.A.getString(R.string.nfc_title));
                AppCenterFragment2.this.A.startActivity(intent);
                AppCenterFragment2.this.e0.dismiss();
            }
        }
    }

    public class d extends Thread {
        public d() {
        }

        @Override
        public void run() {
            PersonAppNotiData personAppNotiData;
            String str;
            try {
                try {
                    String w = MyApplication.h().a.w();
                    AppCenterFragment2.this.r();
                    AppCenterFragment2.this.p();
                    if (bk0.v) {
                        AppCenterFragment2.this.j.clear();
                        AppCenterFragment2.this.j.addAll(AppCenterFragment2.this.f.b().f());
                    }
                    AppCenterFragment2.this.l.clear();
                    AppCenterFragment2.this.l.putAll(AppCenterFragment2.this.f.f());
                    AppCenterFragment2.this.k.clear();
                    AppCenterFragment2.this.k.addAll(AppCenterFragment2.this.f.b(w, MyApplication.h().a.v(), 0));
                    boolean z = AppCenterFragment2.this.m.size() == 0;
                    Iterator it = AppCenterFragment2.this.k.iterator();
                    while (it.hasNext()) {
                        Iterator<PersonAppData> it2 = ((PersonAppCategoryData) it.next()).list.iterator();
                        while (it2.hasNext()) {
                            PersonAppData next = it2.next();
                            if (next.isNative() && z) {
                                AppCenterFragment2.this.w();
                                z = false;
                            }
                            next.hasNewVersion = AppCenterFragment2.this.f.b(next, AppCenterFragment2.this.m);
                            if (((PersonAppNotiData) AppCenterFragment2.this.l.get(next.app_id)) == null) {
                                str = "0";
                            } else {
                                str = personAppNotiData.num + "";
                            }
                            next.appNotiNum = str;
                        }
                    }
                    if (bk0.u) {
                        PersonAppCategoryData b = AppCenterFragment2.this.f.b(w, AppCenterFragment2.this.k);
                        PersonAppCategoryData a = AppCenterFragment2.this.f.a(w, AppCenterFragment2.this.k);
                        AppCenterFragment2.this.k.add(b.idx, b);
                        AppCenterFragment2.this.k.add(a.idx, a);
                    }
                    AppCenterFragment2.this.k0.sendEmptyMessage(8);
                } catch (Exception e) {
                    Log.a((Throwable) e);
                }
            } finally {
                AppCenterFragment2.this.j0.set(false);
            }
        }
    }

    public class e extends BroadcastReceiver {
        public e() {
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            intent.getDataString().substring(8);
            if (intent.getAction().equals("android.intent.action.PACKAGE_ADDED")) {
                AppCenterFragment2.this.v();
            }
            if (intent.getAction().equals("android.intent.action.PACKAGE_REMOVED")) {
                AppCenterFragment2.this.v();
            }
        }
    }

    public class f extends Thread {
        public f() {
        }

        @Override
        public void run() {
            try {
                try {
                    hn1 n = new rm1(AppCenterFragment2.this.A).n(AppCenterFragment2.this.A.getPackageName(), AppCenterFragment2.this.g0);
                    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(AppCenterFragment2.this.g0, true);
                            AppCenterFragment2.this.k0.sendEmptyMessage(6);
                        }
                    }
                } catch (Exception e) {
                    Log.a((Throwable) e);
                }
            } finally {
                AppCenterFragment2.this.l0.set(false);
            }
        }
    }

    public class g extends BroadcastReceiver {
        public g() {
        }

        @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 >= AppCenterFragment2.this.h.size()) {
                            break;
                        }
                        Object obj = AppCenterFragment2.this.h.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;
                    }
                }
                AppCenterFragment2.this.d.notifyDataSetChanged();
            }
        }
    }

    public class h extends Thread {
        public h() {
        }

        @Override
        public void run() {
            try {
                try {
                    Iterator it = AppCenterFragment2.this.k.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) {
                                AppCenterFragment2.this.w();
                                z2 = false;
                            }
                            boolean z3 = next.hasNewVersion;
                            next.hasNewVersion = AppCenterFragment2.this.f.b(next, AppCenterFragment2.this.m);
                            if (next.hasNewVersion != z3) {
                                z = true;
                            }
                        }
                    }
                    if (z) {
                        AppCenterFragment2.this.k0.sendEmptyMessage(7);
                    }
                } catch (Exception e) {
                    Log.a((Throwable) e);
                }
            } finally {
                AppCenterFragment2.this.n0.set(false);
            }
        }
    }

    public class i extends Thread {
        public i() {
        }

        @Override
        public void run() {
            String str;
            try {
                try {
                    AppCenterFragment2.this.l.clear();
                    AppCenterFragment2.this.l.putAll(AppCenterFragment2.this.f.f());
                    Iterator it = AppCenterFragment2.this.k.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) AppCenterFragment2.this.l.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) {
                        AppCenterFragment2.this.k0.sendEmptyMessage(7);
                    }
                } catch (Exception e) {
                    Log.a((Throwable) e);
                }
            } finally {
                AppCenterFragment2.this.o0.set(false);
            }
        }
    }

    public class j extends Handler {
        public WeakReference<AppCenterFragment2> a;

        public j(AppCenterFragment2 appCenterFragment2) {
            this.a = new WeakReference<>(appCenterFragment2);
        }

        @Override
        public void handleMessage(Message message) {
            AppCenterFragment2 appCenterFragment2 = this.a.get();
            switch (message.what) {
                case 2:
                    appCenterFragment2.A.toastToMessage(R.string.inexistent_company);
                    return;
                case 3:
                    appCenterFragment2.t();
                    return;
                case 4:
                    AppCenterFragment2.this.a.setRefreshing(false);
                    return;
                case 5:
                    AppCenterFragment2.this.c(true);
                    return;
                case 6:
                    if (bk0.u) {
                        AppCenterFragment2.this.d.notifyDataSetChanged();
                        AppCenterFragment2.this.y.setVisibility(8);
                        return;
                    }
                    AppCenterFragment2.this.y.setVisibility(0);
                    return;
                case 7:
                    AppCenterFragment2.this.d.notifyDataSetChanged();
                    return;
                case 8:
                    AppCenterFragment2.this.y();
                    return;
                default:
                    return;
            }
        }
    }

    private void b(View view) {
    }

    public void p() {
    }

    public void t() {
        if (this.j0.compareAndSet(false, true)) {
            new d().start();
        }
    }

    private void u() {
        if (this.o0.compareAndSet(false, true)) {
            new i().start();
        }
    }

    public void v() {
        if (this.n0.compareAndSet(false, true)) {
            new h().start();
        }
    }

    public synchronized void w() {
        this.m.clear();
        this.m.addAll(this.f.l());
    }

    private void x() {
        String b2 = zl0.b(this.A, "appstore");
        if (TextUtils.isEmpty(b2)) {
            b2 = this.A.getString(R.string.appstore);
        }
        this.mTitleView.setYxTitleCenterTxt(b2);
        this.mTitleView.setLeftViewImgOfLeftLLVisible(false);
    }

    public void y() {
        Iterator<PersonAppCategoryData> it;
        try {
            this.h.clear();
            if (!TextUtils.isEmpty(MyApplication.h().a.y()) && (!bk0.ca.equals(this.g0) || bk0.b)) {
                this.p.clear();
                this.p.addAll(m().b());
                if (this.p != null && this.p.size() > 1) {
                    this.x.setVisibility(0);
                    this.x.a();
                } else {
                    this.x.setVisibility(8);
                }
                if (!MyApplication.h().a.b(this.g0) && !bk0.u) {
                    this.y.setVisibility(0);
                } else {
                    this.y.setVisibility(8);
                }
                this.i.clear();
                this.i.addAll(this.n);
                this.e.notifyDataSetChanged();
                if (bk0.v && this.j.size() > 0) {
                    this.h.add(this.j);
                }
                it = this.k.iterator();
                while (it.hasNext()) {
                    PersonAppCategoryData next = it.next();
                    this.h.add(next);
                    if (!bk0.u) {
                        this.h.addAll(next.list);
                    }
                }
                if (this.o.size() > 0) {
                    this.h.addAll(this.o);
                }
                if (this.k.size() > 0) {
                    this.h.add("unknown");
                }
                this.d.notifyDataSetChanged();
            }
            this.x.setVisibility(0);
            this.x.a();
            if (!MyApplication.h().a.b(this.g0)) {
            }
            this.y.setVisibility(8);
            this.i.clear();
            this.i.addAll(this.n);
            this.e.notifyDataSetChanged();
            if (bk0.v) {
                this.h.add(this.j);
            }
            it = this.k.iterator();
            while (it.hasNext()) {
            }
            if (this.o.size() > 0) {
            }
            if (this.k.size() > 0) {
            }
            this.d.notifyDataSetChanged();
        } catch (Throwable th) {
            Log.a(th);
        }
    }

    @Override
    public void finishNoti(String str) {
        super.finishNoti(str);
        if (OnNotiReceiver.f.equals(str)) {
            c(false);
            hideProgressDialog();
        }
        if (OnNotiReceiver.k.equals(str)) {
            this.p.clear();
            this.p.addAll(m().b());
            o();
            x();
            this.k0.sendEmptyMessage(5);
        }
        if (OnNotiReceiver.d.equals(str)) {
            o();
        }
    }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        if (view.getId() == R.id.yxTitle_Right_LL_RLRight) {
            if (!bk0.M0) {
                kk0.D(this.A);
            } else {
                s();
            }
        } else if (view.getId() == R.id.yxTitle_Left_LL_RL) {
            this.A.finish();
        }
    }

    @Override
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View view = this.u;
        if (view != null) {
            ViewGroup viewGroup2 = (ViewGroup) view.getParent();
            if (viewGroup2 != null) {
                viewGroup2.removeView(this.u);
            }
        } else {
            this.u = layoutInflater.inflate(R.layout.activity_app_centre, viewGroup, false);
            this.A = (FragmentBaseActivity) getActivity();
            this.f = new ud1(this.A);
            this.i0 = new kg1(bf1.L().r());
            this.h0 = new MemberData();
            o();
            a(this.u);
            c(false);
            l();
            x();
        }
        if (this.A.getIntent() != null && this.A.getIntent().getBooleanExtra("needBack", false)) {
            this.mTitleView.setLeftViewOfLeftLL(R.drawable.ic_back);
        }
        return this.u;
    }

    @Override
    public void onDestroy() {
        try {
            super.onDestroy();
            if (this.q != null) {
                sb1.a(this.A, this.q);
            }
            if (this.r != null) {
                sb1.a(this.A, this.r);
            }
            if (this.t != null) {
                sb1.a(this.A, this.t);
            }
            if (this.s != null) {
                sb1.a(this.A, this.s);
            }
            MyApplication.h().b(bk0.wa, this);
            MyApplication.h().b(bk0.Ba, this);
            if (this.D != null) {
                this.A.unregisterReceiver(this.D);
            }
            if (this.m0 != null) {
                this.A.unregisterReceiver(this.m0);
            }
            this.v.removeAllViews();
        } catch (Throwable th) {
            th.printStackTrace();
        }
    }

    @Override
    public void onHiddenChanged(boolean z) {
        super.onHiddenChanged(z);
        this.B = !z;
    }

    @Override
    public void onPause() {
        super.onPause();
        this.B = false;
    }

    @Override
    public void onResume() {
        super.onResume();
        this.B = true;
        pg0.a(nj0.f2);
        pg0.a(MyApplication.h(), nj0.e0, null, null);
        showNoEnterAccountPromptView();
    }

    @Override
    public void showNoEnterAccountPromptView() {
        if (this.p0.compareAndSet(false, true)) {
            for (int i2 = 0; i2 < this.v.getChildCount(); i2++) {
                View childAt = this.v.getChildAt(i2);
                if (childAt instanceof NoEnterAccountPromptView) {
                    this.v.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.w == null) {
                    this.w = new NoEnterAccountPromptView(this.A);
                }
                this.v.addView(this.w);
                this.a.setEnabled(false);
                this.b.setEnabled(false);
                this.mTitleView.l.setEnabled(false);
                this.mTitleView.c.setEnabled(false);
            }
            this.p0.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.g == null) {
            synchronized (q0) {
                if (this.g == null) {
                    this.g = new sf1(bf1.L().r());
                }
            }
        }
        return this.g;
    }

    private void n() {
        if (bk0.G && this.l0.compareAndSet(false, true)) {
            this.y.setVisibility(8);
            MyApplication.h().a.a(this.g0, false);
            this.d.notifyDataSetChanged();
            new f().start();
        }
    }

    private void o() {
        this.g0 = km0.r(MyApplication.h().a.w());
        this.f0 = km0.r(MyApplication.h().a.y());
        this.h0.mobile = bf1.L().b();
        MemberData c2 = this.i0.c(this.g0, this.h0.mobile);
        if (c2 != null) {
            MemberData memberData = this.h0;
            memberData.name = c2.name;
            memberData.enterid = c2.enterid;
        } else {
            MemberData memberData2 = this.h0;
            memberData2.name = "";
            memberData2.enterid = "";
        }
        this.h0.empid = km0.r(MyApplication.h().a.v());
        this.h0.enter_code = this.g0;
    }

    private void q() {
        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 r() {
        if (bk0.uc) {
            this.n.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.n.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.n.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.n.add(personAppData3);
        }
    }

    private void s() {
        if (this.e0 == null) {
            this.e0 = new bp1(this.A);
        }
        this.e0.a(new c());
        this.e0.a(this.v);
    }

    public void a(View view) {
        GridLayoutManager gridLayoutManager;
        this.mTitleView = (CustomWebTitleView) view.findViewById(R.id.title);
        this.v = (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() {
                AppCenterFragment2.this.h();
            }
        });
        this.x = (OrgView) view.findViewById(R.id.f112org);
        this.y = (MngView) view.findViewById(R.id.mng);
        this.b = (RecyclerView) view.findViewById(R.id.rv);
        if (bk0.u) {
            gridLayoutManager = new GridLayoutManager(this.A, 1);
            this.b.setBackgroundColor(0);
        } else {
            this.b.setBackgroundColor(-1);
            gridLayoutManager = new GridLayoutManager(this.A, 12);
            gridLayoutManager.setSpanSizeLookup(new a());
        }
        this.b.setLayoutManager(gridLayoutManager);
        this.d = new AppcenterAdapter(this.A, this.h);
        AppcenterAdapter appcenterAdapter = this.d;
        appcenterAdapter.a = this.f;
        appcenterAdapter.e = new AppcenterAdapter.g() {
            @Override
            public final void a(boolean z) {
                AppCenterFragment2.this.b(z);
            }
        };
        appcenterAdapter.b = this.h0;
        appcenterAdapter.g = this.z;
        appcenterAdapter.h = this.a;
        this.b.setAdapter(appcenterAdapter);
        this.b.addOnScrollListener(new b());
        this.c = (RecyclerView) view.findViewById(R.id.toprv);
        this.c.setLayoutManager(new GridLayoutManager(this.A, 3));
        this.e = new AppcenterAdapter(this.A, this.i);
        AppcenterAdapter appcenterAdapter2 = this.e;
        appcenterAdapter2.a = this.f;
        appcenterAdapter2.b = this.h0;
        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.l.containsKey(str) && this.l.get(str).num == parse.num) {
            return;
        }
        u();
    }

    @Override
    public void f(String str) {
        if (this.l.containsKey(str)) {
            u();
        }
    }

    public void h() {
        this.C = true;
        me1.a();
    }

    public void l() {
        this.q = new OnNotiReceiver();
        this.q.a(OnNotiReceiver.f, this);
        sb1.a(this.A, this.q, new IntentFilter(OnNotiReceiver.f));
        this.r = new OnNotiReceiver();
        this.r.a(OnNotiReceiver.k, this);
        sb1.a(this.A, this.r, new IntentFilter(OnNotiReceiver.k));
        this.t = new OnNotiReceiver();
        this.t.a(OnNotiReceiver.n, this);
        sb1.a(this.A, this.t, new IntentFilter(OnNotiReceiver.n));
        this.s = new OnNotiReceiver();
        this.s.a(OnNotiReceiver.d, this);
        sb1.a(this.A, this.s, new IntentFilter(OnNotiReceiver.d));
        this.u.findViewById(R.id.yxTitle_Left_LL_RL).setOnClickListener(this);
        this.u.findViewById(R.id.yxTitle_Left_LL_TV).setOnClickListener(this);
        this.u.findViewById(R.id.yxTitle_Right_LL_RLRight).setOnClickListener(this);
        this.u.findViewById(R.id.yxTitle_Left_LL).setOnClickListener(this);
        this.D = new e();
        IntentFilter intentFilter = new IntentFilter("android.intent.action.PACKAGE_ADDED");
        intentFilter.addAction("android.intent.action.PACKAGE_REMOVED");
        intentFilter.addDataScheme("package");
        this.A.registerReceiver(this.D, intentFilter);
        MyApplication.h().a(bk0.Ba, this);
        MyApplication.h().a(bk0.wa, this);
        q();
    }

    @Override
    public void f() {
        this.k0.sendEmptyMessage(3);
    }

    private void d(boolean z) {
        if (z) {
            e(true);
            return;
        }
        String d2 = MyApplication.h().a.d(this.g0);
        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();
        }
        t();
        if (System.currentTimeMillis() - date.getTime() > 86400000) {
            this.B = 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.C) {
                    this.k0.sendEmptyMessage(5);
                    this.C = false;
                }
            } else {
                this.k0.sendEmptyMessage(2);
            }
        }
        this.k0.sendEmptyMessage(4);
    }

    public boolean a(int i2, KeyEvent keyEvent) {
        if (i2 == 4) {
            sb1.p(this.A);
            return true;
        }
        return false;
    }
}