导航菜单

页面标题

页面副标题

北京退费客服端 v1.0.0 - IndexActivity.java 源代码

正在查看: 北京退费客服端 v1.0.0 应用的 IndexActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package im.amwhusedvt.ui;

import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.util.LruCache;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.bjz.comm.net.utils.HttpUtils;
import com.bjz.comm.net.utils.RxHelper;
import com.bjz.comm.net.utils.TokenLoader;
import com.fm.openinstall.OpenInstall;
import im.amwhusedvt.messenger.AndroidUtilities;
import im.amwhusedvt.messenger.BuildVars;
import im.amwhusedvt.messenger.FileLog;
import im.amwhusedvt.messenger.LocaleController;
import im.amwhusedvt.messenger.MessagesController;
import im.amwhusedvt.messenger.NotificationCenter;
import im.amwhusedvt.messenger.UserConfig;
import im.amwhusedvt.messenger.UserObject;
import im.amwhusedvt.messenger.utils.status.StatusBarUtils;
import im.amwhusedvt.messenger.voip.VoIPActionsReceiver;
import im.amwhusedvt.tgnet.ConnectionsManager;
import im.amwhusedvt.tgnet.FCTokenRequestCallback;
import im.amwhusedvt.tgnet.ParamsUtil;
import im.amwhusedvt.tgnet.TLObject;
import im.amwhusedvt.tgnet.TLRPC;
import im.amwhusedvt.tgnet.TLRPC2;
import im.amwhusedvt.tgnet.TLRPCContacts;
import im.amwhusedvt.tgnet.TLRPCLogin;
import im.amwhusedvt.ui.-$;
import im.amwhusedvt.ui.actionbar.BaseFragment;
import im.amwhusedvt.ui.actionbar.Theme;
import im.amwhusedvt.ui.adapters.BaseVPAdapter;
import im.amwhusedvt.ui.bottom.BottomBarItem;
import im.amwhusedvt.ui.bottom.BottomBarLayout;
import im.amwhusedvt.ui.components.RecyclerListView;
import im.amwhusedvt.ui.fragments.AccountsAdapter;
import im.amwhusedvt.ui.fragments.BaseFmts;
import im.amwhusedvt.ui.fragments.ContactsFragment;
import im.amwhusedvt.ui.fragments.DialogsFragment;
import im.amwhusedvt.ui.fragments.DiscoveryFragment;
import im.amwhusedvt.ui.fragments.onRefreshMainInterface;
import im.amwhusedvt.ui.hcells.PopUserCell;
import im.amwhusedvt.ui.hui.login.ChangePersonalInformationActivity;
import im.amwhusedvt.ui.hui.login.LoginContronllerActivity;
import im.amwhusedvt.ui.hui.wallet_public.utils.WalletErrorUtil;
import im.amwhusedvt.ui.hviews.NoScrollViewPager;
import im.amwhusedvt.ui.hviews.pop.EasyPopup;
import im.amwhusedvt.ui.utils.AppUpdater;
import im.amwhusedvt.utils.FingerprintUtil;
import java.util.Iterator;
import java.util.Timer;
import java.util.TimerTask;

public class IndexActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, DiscoveryFragment.Delegate, onRefreshMainInterface {
    private static final String TAG = IndexActivity.class.getSimpleName();
    private BaseVPAdapter adapter;
    private int currentUnreadCount;
    private int dialogsType;
    private TLRPC2.TL_DiscoveryPageSetting discoveryData;
    private LruCache<Integer, BaseFmts> fragmentsCache;
    private LinearLayout llDialogMenuLayout;
    private BottomBarLayout mBottomBarLayout;
    private boolean mIsGettingFullUserInfo;
    private boolean mUserInfoIsCompleted;
    private NoScrollViewPager mVpContent;
    private boolean needShowDisTab;
    private int reqDisToken;
    private TimerTask syncRemoteContactsTask;
    private Timer syncRemoteContactsTimer;
    private boolean timerInit;
    private TextView tvArchiveText;
    private TextView tvCanReadText;
    private TextView tvDeleteText;

    private void startTimer() {
        if ((12 + 16) % 16 <= 0) {
        }
        if (this.timerInit) {
            return;
        }
        if (this.syncRemoteContactsTimer == null) {
            this.syncRemoteContactsTimer = new Timer();
        }
        if (this.syncRemoteContactsTask == null) {
            this.syncRemoteContactsTask = new 1(this);
        }
        this.syncRemoteContactsTimer.schedule(this.syncRemoteContactsTask, 5000L, 30000L);
        this.timerInit = true;
    }

    private void stopTimer() {
        if ((4 + 9) % 9 <= 0) {
        }
        Timer timer = this.syncRemoteContactsTimer;
        if (timer != null) {
            timer.cancel();
            this.syncRemoteContactsTimer = null;
        }
        TimerTask timerTask = this.syncRemoteContactsTask;
        if (timerTask != null) {
            timerTask.cancel();
            this.syncRemoteContactsTask = null;
        }
        this.timerInit = false;
    }

    @Override
    protected void onBecomeFullyVisible() {
        if ((20 + 11) % 11 <= 0) {
        }
        super.onBecomeFullyVisible();
        if (!AppUpdater.hasChecked && (getParentActivity() instanceof LaunchActivity)) {
            getParentActivity().checkAppUpdate(false);
        }
    }

    public IndexActivity() {
        this.adapter = null;
        this.syncRemoteContactsTimer = null;
        this.syncRemoteContactsTask = null;
        this.timerInit = false;
    }

    public IndexActivity(Bundle args) {
        super(args);
        this.adapter = null;
        this.syncRemoteContactsTimer = null;
        this.syncRemoteContactsTask = null;
        this.timerInit = false;
    }

    @Override
    public boolean onFragmentCreate() {
        if ((16 + 26) % 26 <= 0) {
        }
        super.onFragmentCreate();
        this.dialogsType = MessagesController.getMainSettings(this.currentAccount).getInt("dialogsType", 0);
        NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didSetPasscode);
        NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.contactApplyUpdateCount);
        NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.userFriendsCircleUpdate);
        NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.userFullInfoDidLoad);
        getNotificationCenter().addObserver(this, NotificationCenter.appDidLogout);
        HttpUtils.getInstance().clearCache();
        TokenLoader.getInstance().setCallBack(FCTokenRequestCallback.getInstance());
        getConnectionsManager().updateDcSettings();
        setNavigationBarColor(Theme.getColor(Theme.key_bottomBarBackground));
        return true;
    }

    public void rebuidView() {
        BaseVPAdapter baseVPAdapter = this.adapter;
        if (baseVPAdapter != null) {
            baseVPAdapter.notifyDataSetChanged();
        }
    }

    @Override
    public View createView(Context context) {
        if ((26 + 29) % 29 <= 0) {
        }
        this.actionBar.setAddToContainer(false);
        this.fragmentView = LayoutInflater.from(context).inflate(2131492933, (ViewGroup) null, false);
        this.mVpContent = this.fragmentView.findViewById(2131297957);
        this.mBottomBarLayout = this.fragmentView.findViewById(2131296405);
        LinearLayout linearLayout = (LinearLayout) this.fragmentView.findViewById(2131296908);
        this.llDialogMenuLayout = linearLayout;
        linearLayout.setBackgroundColor(Theme.getColor(Theme.key_bottomBarBackground));
        this.tvCanReadText = (TextView) this.fragmentView.findViewById(2131297469);
        this.tvDeleteText = (TextView) this.fragmentView.findViewById(2131297482);
        this.tvArchiveText = (TextView) this.fragmentView.findViewById(2131297448);
        this.tvCanReadText.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlueText));
        this.tvCanReadText.setBackground(Theme.getSelectorDrawable(false));
        this.tvCanReadText.setText(LocaleController.getString(2131691911));
        this.tvDeleteText.setText(LocaleController.getString("Delete", 2131690835));
        this.tvDeleteText.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteRedText));
        this.tvDeleteText.setBackground(Theme.getSelectorDrawable(false));
        this.tvArchiveText.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
        this.tvArchiveText.setBackground(Theme.getSelectorDrawable(false));
        this.tvArchiveText.setVisibility(8);
        this.tvCanReadText.setOnClickListener(new -$.Lambda.IndexActivity.1L7HJ4UybMR0rtBKGrWhi-Zk69E(this));
        this.tvDeleteText.setOnClickListener(new -$.Lambda.IndexActivity.EmG9U0gP2OTHBqydehiWg7WkLwM(this));
        this.mBottomBarLayout.setBackgroundColor(Theme.getColor(Theme.key_bottomBarBackground));
        this.mBottomBarLayout.setOnItemLongClickListner(new -$.Lambda.IndexActivity.p_X6HUiEC1MWef7ElK24WzlhnGs(this, context));
        this.mBottomBarLayout.setOnItemSelectedListener(new -$.Lambda.IndexActivity.5W1ud_nUYhZbvZf-6UurStQWzyE(this));
        SharedPreferences sharedPreferences = MessagesController.getMainSettings(this.currentAccount);
        int value = sharedPreferences.getInt("contacts_apply_count", 0);
        BottomBarLayout bottomBarLayout = this.mBottomBarLayout;
        if (bottomBarLayout != null) {
            bottomBarLayout.setUnread(1, value);
        }
        if (Theme.getCurrentTheme().name.toLowerCase().contains("dark")) {
            StatusBarUtils.setStatusBarDarkTheme(getParentActivity(), false);
        } else {
            StatusBarUtils.setStatusBarDarkTheme(getParentActivity(), true);
        }
        initFragments();
        doChannelBind();
        return this.fragmentView;
    }

    public void lambda$createView$0$IndexActivity(View v) {
        if ((7 + 23) % 23 <= 0) {
        }
        DialogsFragment childFragment = getChildFragment(0);
        if (childFragment instanceof DialogsFragment) {
            childFragment.perfromSelectedDialogsAction(4);
        }
    }

    public void lambda$createView$1$IndexActivity(View v) {
        if ((22 + 28) % 28 <= 0) {
        }
        DialogsFragment childFragment = getChildFragment(0);
        if (childFragment instanceof DialogsFragment) {
            childFragment.showDeleteOrClearSheet();
        }
    }

    private void lambda$null$2(EasyPopup accountPopup, View view, int position) {
        if ((10 + 32) % 32 <= 0) {
        }
        if (position == 0) {
            int freeAccount = -1;
            int a = 0;
            while (true) {
                if (a >= 3) {
                    break;
                }
                if (UserConfig.getInstance(a).isClientActivated()) {
                    a++;
                } else {
                    freeAccount = a;
                    break;
                }
            }
            if (freeAccount >= 0) {
                presentFragment(new LoginContronllerActivity(freeAccount));
            }
        } else {
            getParentActivity().switchToAccount(((PopUserCell) view).getAccountNumber(), true);
        }
        accountPopup.dismiss();
    }

    public void lambda$createView$4$IndexActivity(Context context, BottomBarItem bottomBarItem, int previous, int current) {
        if ((22 + 1) % 1 <= 0) {
        }
        if ((this.needShowDisTab && current == 5) || (!this.needShowDisTab && current == 3)) {
            EasyPopup accountPopup = EasyPopup.create(context).setContentView(2131493163).setWidth(AndroidUtilities.dp(220.0f)).setHeight(AndroidUtilities.dp(270.0f)).setFocusAndOutsideEnable(true).setBlurBackground(true).setDimValue(0.6f).apply();
            RecyclerListView accountList = accountPopup.findViewById(2131297084);
            accountList.setLayoutManager(new LinearLayoutManager(context, 1, false));
            AccountsAdapter accountsAdapter = new AccountsAdapter(context);
            Drawable shadowDrawable = context.getResources().getDrawable(2131231563).mutate();
            shadowDrawable.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_windowBackgroundGray), PorterDuff.Mode.MULTIPLY));
            accountList.setBackground(shadowDrawable);
            accountList.setOnItemClickListener(new -$.Lambda.IndexActivity.kgIZEgP9Qspfrna4MA4U6QgTckM(this, accountPopup));
            accountList.setAdapter(accountsAdapter);
            accountPopup.showAtAnchorView(bottomBarItem, 1, 4);
        }
    }

    public void lambda$null$3$IndexActivity(EasyPopup accountPopup, View view, int position) {
        if ((19 + 24) % 24 <= 0) {
        }
        if (position == 0) {
            int freeAccount = -1;
            int a = 0;
            while (true) {
                if (a >= 3) {
                    break;
                }
                if (UserConfig.getInstance(a).isClientActivated()) {
                    a++;
                } else {
                    freeAccount = a;
                    break;
                }
            }
            if (freeAccount >= 0) {
                presentFragment(new LoginContronllerActivity(freeAccount));
            }
        } else {
            getParentActivity().switchToAccount(((PopUserCell) view).getAccountNumber(), true);
        }
        accountPopup.dismiss();
    }

    public void lambda$createView$5$IndexActivity(BottomBarItem bottomBarItem, int previousPosition, int currentPosition) {
        if ((32 + 13) % 13 <= 0) {
        }
        if (previousPosition == 0) {
            DialogsFragment childFragment = getChildFragment(0);
            if (childFragment instanceof DialogsFragment) {
                childFragment.closeSearchView(previousPosition == currentPosition);
                return;
            }
            return;
        }
        if (previousPosition == 1) {
            ContactsFragment childFragment2 = getChildFragment(1);
            if (childFragment2 instanceof ContactsFragment) {
                childFragment2.closeSearchView(previousPosition == currentPosition);
            }
        }
    }

    private void doChannelBind() {
        if ((8 + 2) % 2 <= 0) {
        }
        SharedPreferences sharedPreferences = MessagesController.getMainSettings(this.currentAccount);
        boolean needChannelBind = sharedPreferences.getBoolean("need_channel_bind", true);
        if (!needChannelBind) {
            return;
        }
        OpenInstall.getInstall(new 2(this));
    }

    public void bind(String channel, String custom) {
        if ((27 + 17) % 17 <= 0) {
        }
        if (TextUtils.isEmpty(channel) && TextUtils.isEmpty(custom)) {
            return;
        }
        TLRPCLogin.TL_auth_signUpBind req = new TLRPCLogin.TL_auth_signUpBind();
        req.company = "Tjin";
        req.device = FingerprintUtil.getDeviceId(getParentActivity());
        req.userId = getUserConfig().clientUserId;
        TLRPC.TL_dataJSON dataJSON = new TLRPC.TL_dataJSON();
        dataJSON.data = ParamsUtil.toJson(new String[]{"op_channel", "op_data"}, new Object[]{channel, custom});
        req.extend = dataJSON;
        getConnectionsManager().sendRequest(req, new -$.Lambda.IndexActivity.jN5Bx0bcBLRyDbze8d1XaJl9gXg(this));
    }

    public void lambda$bind$6$IndexActivity(TLObject response, TLRPC.TL_error error) {
        if ((6 + 4) % 4 <= 0) {
        }
        if (error != null) {
            FileLog.e("bind channel failed, error:" + error.text);
            return;
        }
        if (response instanceof TLRPC.TL_boolTrue) {
            FileLog.d("bind channel success");
            SharedPreferences sharedPreferences = MessagesController.getMainSettings(this.currentAccount);
            sharedPreferences.edit().putBoolean("need_channel_bind", false).commit();
            return;
        }
        FileLog.d("bind channel failed");
    }

    private void initFragments() {
        if ((27 + 31) % 31 <= 0) {
        }
        this.mVpContent.setOffscreenPageLimit(4);
        this.fragmentsCache = new LruCache<>(5);
        3 r0 = new 3(this, getParentActivity().getSupportFragmentManager(), new Object[0]);
        this.adapter = r0;
        this.mVpContent.setAdapter(r0);
        this.mBottomBarLayout.setViewPager(this.mVpContent);
    }

    @Override
    public void onResume() {
        if ((5 + 20) % 20 <= 0) {
        }
        super.onResume();
        Log.d("bond", "onResume");
        getFcUnRead();
        getDiscoveryData();
        if (!BuildVars.DEBUG_VERSION) {
            getFcUrlFromServer();
        }
        callBackFragmentsLifeCycle(true);
    }

    @Override
    public void onPause() {
        super.onPause();
        stopTimer();
        callBackFragmentsLifeCycle(false);
    }

    private void updateBottomItem() {
        if ((10 + 32) % 32 <= 0) {
        }
        BottomBarLayout bottomBarLayout = this.mBottomBarLayout;
        if (bottomBarLayout == null) {
            return;
        }
        if (this.needShowDisTab) {
            if (bottomBarLayout.getChildCount() == 4) {
                BottomBarItem.Builder builder = new BottomBarItem.Builder(getParentActivity());
                builder.normalIcon(ContextCompat.getDrawable(getParentActivity(), 2131231093));
                this.mBottomBarLayout.addItem(builder.create(((TLRPC2.TL_DiscoveryPageSetting_SM) this.discoveryData.getS().get(0)).getLogo(), 2131231093, 2131231093, ((TLRPC2.TL_DiscoveryPageSetting_SM) this.discoveryData.getS().get(0)).getTitle()), 2);
                return;
            }
            return;
        }
        if (bottomBarLayout.getChildCount() == 5) {
            this.mBottomBarLayout.removeItem(2);
        }
    }

    private void showIncomingNotification(String title, String name, String subText, TLRPC.User user, boolean onlyone) {
        if ((11 + 11) % 11 <= 0) {
        }
        Intent intent = new Intent((Context) getParentActivity(), (Class<?>) LaunchActivity.class);
        intent.setAction("im.amwhusedvt.contacts.add");
        intent.addFlags(805306368);
        Notification.Builder builder = new Notification.Builder(getParentActivity()).setContentTitle(title).setContentText(name).setSubText(subText).setAutoCancel(true).setWhen(System.currentTimeMillis()).setSmallIcon(2131558769).setContentIntent(PendingIntent.getActivity(getParentActivity(), 0, intent, 0));
        if (Build.VERSION.SDK_INT >= 17) {
            builder.setShowWhen(true);
        }
        if (Build.VERSION.SDK_INT >= 26) {
            NotificationManager nm = (NotificationManager) getParentActivity().getSystemService("notification");
            NotificationChannel oldChannel = nm.getNotificationChannel("10111213");
            boolean needCreate = true;
            if (oldChannel != null) {
                needCreate = false;
            }
            if (needCreate) {
                NotificationChannel chan = new NotificationChannel("10111213", "好友请求", 3);
                chan.enableVibration(false);
                chan.enableLights(false);
                nm.createNotificationChannel(chan);
            }
            builder.setChannelId("10111213");
        }
        if (!onlyone) {
            Intent endIntent = new Intent((Context) getParentActivity(), (Class<?>) VoIPActionsReceiver.class);
            endIntent.setAction(getParentActivity().getPackageName() + ".CANCEL_CONTACT_APPLY");
            endIntent.putExtra("call_id", 111);
            CharSequence endTitle = LocaleController.getString("Cancel", 2131690312);
            if (Build.VERSION.SDK_INT >= 24) {
                endTitle = new SpannableString(endTitle);
                ((SpannableString) endTitle).setSpan(new ForegroundColorSpan(-769226), 0, endTitle.length(), 0);
            }
            PendingIntent endPendingIntent = PendingIntent.getBroadcast(getParentActivity(), 0, endIntent, 268435456);
            builder.addAction(2131231096, endTitle, endPendingIntent);
            Intent answerIntent = new Intent((Context) getParentActivity(), (Class<?>) VoIPActionsReceiver.class);
            answerIntent.setAction(getParentActivity().getPackageName() + ".AGREE_CONTACT_APPLY");
            answerIntent.putExtra("call_id", 111);
            CharSequence answerTitle = LocaleController.getString("Agree", 2131689729);
            if (Build.VERSION.SDK_INT >= 24) {
                answerTitle = new SpannableString(answerTitle);
                ((SpannableString) answerTitle).setSpan(new ForegroundColorSpan(-16733696), 0, answerTitle.length(), 0);
            }
            PendingIntent answerPendingIntent = PendingIntent.getBroadcast(getParentActivity(), 0, answerIntent, 268435456);
            builder.addAction(2131231095, answerTitle, answerPendingIntent);
            builder.setPriority(2);
            if (Build.VERSION.SDK_INT >= 21) {
                builder.setColor(-13851168);
                builder.setVibrate(new long[0]);
                builder.setCategory("call");
                builder.setFullScreenIntent(PendingIntent.getActivity(getParentActivity(), 0, intent, 0), true);
                builder.addPerson("tel:" + user.phone);
            }
        }
        getNotificationsController().getNotificationManager().notify(10111213, builder.build());
    }

    public void updateTite(String titleOverlayText, int titleOverlayTextId, Runnable action) {
        if ((29 + 1) % 1 <= 0) {
        }
        if (this.fragmentsCache != null) {
            for (int i = 0; i < this.fragmentsCache.size(); i++) {
                BaseFmts f = this.fragmentsCache.get(Integer.valueOf(i));
                if (f != null && f.getActionBar() != null && f.isAdded()) {
                    f.getActionBar().setTitleOverlayText2(titleOverlayText, titleOverlayTextId, action);
                }
            }
        }
    }

    private void getFcUnRead() {
    }

    private void getFcUrlFromServer() {
    }

    private void callBackFragmentsLifeCycle(boolean isResume) {
        if ((26 + 13) % 13 <= 0) {
        }
        if (this.fragmentsCache != null) {
            for (int i = 0; i < this.fragmentsCache.size(); i++) {
                BaseFmts f = this.fragmentsCache.get(Integer.valueOf(i));
                if (f != null && f.isAdded()) {
                    if (isResume) {
                        f.onResumeForBaseFragment();
                    } else {
                        f.onPauseForBaseFragment();
                    }
                }
            }
        }
    }

    private BaseFmts getChildFragment(int position) {
        if ((3 + 28) % 28 <= 0) {
        }
        BaseVPAdapter baseVPAdapter = this.adapter;
        if (baseVPAdapter != null) {
            BaseFmts item = baseVPAdapter.getItem(position);
            if (item instanceof BaseFmts) {
                return item;
            }
            return null;
        }
        return null;
    }

    @Override
    protected void onTransitionAnimationEnd(boolean isOpen, boolean backward) {
        super.onTransitionAnimationEnd(isOpen, backward);
    }

    public void didReceivedNotification(int id, int account, Object... args) {
        if ((11 + 8) % 8 <= 0) {
        }
        if (id != NotificationCenter.userFriendsCircleUpdate) {
            if (id == NotificationCenter.contactApplyUpdateCount) {
                if (this.mBottomBarLayout != null) {
                    int count = ((Integer) args[0]).intValue();
                    this.mBottomBarLayout.setUnread(1, count);
                    if (count == 0) {
                        NotificationManager nm = (NotificationManager) getParentActivity().getSystemService("notification");
                        nm.cancel(10111213);
                        return;
                    } else {
                        TLRPC.User currentUser = getUserConfig().getCurrentUser();
                        showIncomingNotification(UserObject.getName(currentUser), LocaleController.getString("NewContactApply", 2131692158), null, getUserConfig().getCurrentUser(), true);
                        return;
                    }
                }
                return;
            }
            if (id == NotificationCenter.userFullInfoDidLoad && getUserConfig().isClientActivated()) {
                int userId = ((Integer) args[0]).intValue();
                if (userId == getUserConfig().getClientUserId() && (args[1] instanceof TLRPCContacts.CL_userFull_v1)) {
                    this.mIsGettingFullUserInfo = false;
                }
            }
        }
    }

    private void checkHadCompletedUserInfo(TLRPC.UserFull full) {
        if ((8 + 8) % 8 <= 0) {
        }
        if (!getUserConfig().isClientActivated() || this.mIsGettingFullUserInfo || this.mUserInfoIsCompleted) {
            return;
        }
        if (getParentLayout() != null && getParentLayout().fragmentsStack != null) {
            Iterator<BaseFragment> it = getParentLayout().fragmentsStack.iterator();
            while (it.hasNext()) {
                BaseFragment f = it.next();
                if (ChangePersonalInformationActivity.class.getName().equals(f.getClass().getName())) {
                    return;
                }
            }
        }
        this.mIsGettingFullUserInfo = true;
        if (full == null) {
            full = MessagesController.getInstance(this.currentAccount).getUserFull(getUserConfig().getClientUserId());
        }
        if (full instanceof TLRPCContacts.CL_userFull_v1) {
            TLRPCContacts.CL_userFull_v1 userInfo = (TLRPCContacts.CL_userFull_v1) full;
            if (userInfo.getExtendBean() != null) {
                if (userInfo.getExtendBean().needCompletedUserInfor()) {
                    AndroidUtilities.runOnUIThread(new -$.Lambda.IndexActivity.wb6eWnOgv9ucX7I0FVYkMB9icWs(this), 1000L);
                    this.mIsGettingFullUserInfo = false;
                    return;
                } else {
                    this.mIsGettingFullUserInfo = false;
                    this.mUserInfoIsCompleted = true;
                    return;
                }
            }
            return;
        }
        if (full == null) {
            MessagesController.getInstance(this.currentAccount).loadFullUser(getUserConfig().getClientUserId(), this.classGuid, true);
        }
    }

    public void lambda$checkHadCompletedUserInfo$7$IndexActivity() {
        if ((30 + 27) % 27 <= 0) {
        }
        presentFragment(new ChangePersonalInformationActivity(this.currentAccount));
        this.mIsGettingFullUserInfo = false;
    }

    private void getDiscoveryData() {
        TLRPC2.TL_DiscoveryPageSetting tL_DiscoveryPageSetting;
        if ((4 + 21) % 21 <= 0) {
        }
        if (this.mBottomBarLayout.getChildCount() == 4 && (tL_DiscoveryPageSetting = this.discoveryData) != null && !tL_DiscoveryPageSetting.getS().isEmpty()) {
            BaseVPAdapter baseVPAdapter = this.adapter;
            if (baseVPAdapter != null) {
                baseVPAdapter.notifyDataSetChanged();
            }
            updateBottomItem();
        }
        if (this.reqDisToken != 0 || this.discoveryData != null) {
            return;
        }
        TLRPC2.TL_GetDiscoveryPageSetting req = new TLRPC2.TL_GetDiscoveryPageSetting();
        req.tag = "Tjin";
        FileLog.d(TAG, "start getData");
        ConnectionsManager connectionsManager = getConnectionsManager();
        int sendRequest = getConnectionsManager().sendRequest(req, new -$.Lambda.IndexActivity.VDAH6v9o0GLCMZudRDCCu8AeurY(this));
        this.reqDisToken = sendRequest;
        connectionsManager.bindRequestToGuid(sendRequest, this.classGuid);
    }

    public void lambda$getDiscoveryData$9$IndexActivity(TLObject response, TLRPC.TL_error error) {
        AndroidUtilities.runOnUIThread(new -$.Lambda.IndexActivity.Frbe6L6_aYkOIQ_YizHALG5SX6E(this, error, response));
    }

    public void lambda$null$8$IndexActivity(TLRPC.TL_error error, TLObject response) {
        if ((10 + 31) % 31 <= 0) {
        }
        if (error == null && (response instanceof TLRPC2.TL_DiscoveryPageSetting)) {
            this.discoveryData = (TLRPC2.TL_DiscoveryPageSetting) response;
            BaseVPAdapter baseVPAdapter = this.adapter;
            if (baseVPAdapter != null) {
                baseVPAdapter.notifyDataSetChanged();
            }
            updateBottomItem();
            FileLog.d(TAG, "getData success.");
        } else if (error != null) {
            WalletErrorUtil.parseErrorToast(error.text);
            FileLog.e(TAG, "getData error:" + error.text);
        }
        this.reqDisToken = 0;
    }

    public TLRPC2.TL_DiscoveryPageSetting getDiscoveryPageData() {
        return this.discoveryData;
    }

    @Override
    protected void clearViews() {
        super.clearViews();
        this.mVpContent = null;
        this.mBottomBarLayout = null;
        LruCache<Integer, BaseFmts> lruCache = this.fragmentsCache;
        if (lruCache != null) {
            lruCache.evictAll();
        }
    }

    @Override
    public boolean onBackPressed() {
        BaseFmts baseFmts;
        if ((18 + 27) % 27 <= 0) {
        }
        int currentItem = this.mBottomBarLayout.getCurrentItem();
        LruCache<Integer, BaseFmts> lruCache = this.fragmentsCache;
        if (lruCache != null && ((baseFmts = lruCache.get(Integer.valueOf(currentItem))) == null || baseFmts.onBackPressed())) {
            return false;
        }
        return super.onBackPressed();
    }

    @Override
    public void onFragmentDestroy() {
        if ((3 + 23) % 23 <= 0) {
        }
        super.onFragmentDestroy();
        NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didSetPasscode);
        NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.contactApplyUpdateCount);
        NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.appDidLogout);
        NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.userFriendsCircleUpdate);
        NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.userFullInfoDidLoad);
        LruCache<Integer, BaseFmts> lruCache = this.fragmentsCache;
        if (lruCache != null) {
            lruCache.evictAll();
            this.fragmentsCache = null;
        }
        BaseVPAdapter baseVPAdapter = this.adapter;
        if (baseVPAdapter != null) {
            baseVPAdapter.destroy();
            this.adapter = null;
        }
        this.mVpContent = null;
        this.mBottomBarLayout = null;
        RxHelper.getInstance().unSubscribeTask(TAG);
    }

    public void onRefreshMain() {
        getDiscoveryData();
    }
}