导航菜单

页面标题

页面副标题

Adobe Acrobat v15.3 - ARSplitPaneActivity.java 源代码

正在查看: Adobe Acrobat v15.3 应用的 ARSplitPaneActivity.java JAVA 源代码文件

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


package com.adobe.reader.viewer;

import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.view.ViewPager;
import android.text.Editable;
import android.text.InputFilter;
import android.text.Spanned;
import android.text.TextWatcher;
import android.view.ActionMode;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.SearchView;
import android.widget.TextView;
import android.widget.Toast;
import com.adobe.libs.buildingblocks.utils.BBFileUtils;
import com.adobe.libs.services.a.j;
import com.adobe.libs.services.a.k;
import com.adobe.libs.services.a.l;
import com.adobe.libs.services.a.p;
import com.adobe.libs.services.a.q;
import com.adobe.libs.services.auth.d;
import com.adobe.libs.services.f.a;
import com.adobe.libs.services.g.b;
import com.adobe.libs.services.h.h;
import com.adobe.libs.services.h.n;
import com.adobe.reader.R;
import com.adobe.reader.analytics.ARDCMAnalytics;
import com.adobe.reader.config.ARConstants;
import com.adobe.reader.emm.AREMMManager;
import com.adobe.reader.filebrowser.ARFileBrowserUtils;
import com.adobe.reader.filebrowser.ARFileEntry;
import com.adobe.reader.filebrowser.ARFileEntryAdapter;
import com.adobe.reader.fillandsign.ARFillAndSignFragment;
import com.adobe.reader.fillandsign.ARFillAndSignUtils;
import com.adobe.reader.framework.ui.FWAbstractTabFragment;
import com.adobe.reader.framework.ui.FWBaseCloudListFragment;
import com.adobe.reader.framework.ui.FWBaseSwitcherActivity;
import com.adobe.reader.framework.ui.FWConnectorListFragment;
import com.adobe.reader.framework.ui.FWDocumentCloudListFragment;
import com.adobe.reader.framework.ui.FWDocumentsLocationManager;
import com.adobe.reader.framework.ui.FWDownloadFileAsyncTask;
import com.adobe.reader.framework.ui.FWFloatingActionButton;
import com.adobe.reader.framework.ui.FWLocalFileListFragment;
import com.adobe.reader.framework.ui.FWLocalFolderFileListFragment;
import com.adobe.reader.framework.ui.FWOutboxListFragment;
import com.adobe.reader.framework.ui.FWRecentsListFragment;
import com.adobe.reader.framework.ui.FWSwitcherEntry;
import com.adobe.reader.framework.ui.FWTabsFragment;
import com.adobe.reader.misc.ARAlert;
import com.adobe.reader.misc.ARApp;
import com.adobe.reader.mobileLink.ARMobileLinkUIManager;
import com.adobe.reader.pagemanipulation.AROrganizePagesFragment;
import com.adobe.reader.services.ARCloudFileEntry;
import com.adobe.reader.services.auth.ARServicesAccount;
import com.adobe.reader.services.blueheron.ARBlueHeronGetSystemFolderIDsAsyncTask;
import com.adobe.reader.services.cpdf.ARCreatePDFFragment;
import com.adobe.reader.services.epdf.ARExportPDFFragment;
import com.adobe.reader.test.ARAutomationListActivity;
import com.adobe.reader.test.ARUnitTestActivity;
import com.adobe.reader.ui.ARAppSwitcherEntryManager;
import com.adobe.reader.ui.ARBaseSwitcherActivity;
import com.adobe.reader.utils.ARIntentUtils;
import com.adobe.reader.utils.ARUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

public class ARSplitPaneActivity extends ARBaseSwitcherActivity implements ARMobileLinkUIManager.MobileLinkUIVisibility, ARBaseSwitcherActivity.OptionsMenuHandler {
    static final boolean $assertionsDisabled;
    public static final String BROADCAST_DOC_MOVED_TO_CLOUD = "com.adobe.reader.ARSplitPane.docMovedToCloud";
    public static final String BROADCAST_SPLIT_PANE_LAUNCHED = "com.adobe.reader.ARSplitPane.splitPaneLaunched";
    public static final String CREATE_PDF_DOC_PATH = "com.adobe.reader.ARSplitPane.CreatePDFDocPath";
    public static final String CURRENT_TAB_SELECTED = "com.adobe.reader.ARSplitPane.currentTabSelected";
    public static final int DEFAULT_TAB_LOCATION_ID = 1;
    public static final String INITIAL_TAB_SELECTED = "com.adobe.reader.ARSplitPane.initialTabSelected";
    private Menu mActionBarMenu;
    ActionMode.Callback mCallback;
    private Menu mContextBarMenu;
    private Fragment mCreatePDFFragment;
    private int mCurrentTabLocationId;
    private ARViewerManagedDialog mErrorDlg;
    private Fragment mExportPDFFragment;
    private TextView mExtendedCAB;
    private FWFloatingActionButton mFabButton;
    private boolean mFileOpenedFromFileBrowser;
    private Intent mFileOpenedFromFileBrowserIntent;
    private ARFillAndSignFragment mFillAndSignFragment;
    private ARMobileLinkUIManager mMobileLinkUIManager;
    ActionMode mMode;
    private Fragment mOrganizePagesFragment;
    private MenuItem mSearchMenuItem;
    private ARDocumentListSearchView mSearchView;
    private FWTabsFragment mTabsFragment;
    private BroadcastReceiver broadcastReceiver_switchToOutboxTab = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            ARSplitPaneActivity.this.mTabsFragment.setDefaultTab(4);
        }
    };
    private BroadcastReceiver broadcastReceiver_documentCloudTabCreatedFirstLaunch = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            ARSplitPaneActivity.this.mTabsFragment.setDefaultTab(3);
        }
    };
    private BroadcastReceiver broadcastReceiver_connectorAccountAdded = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            k a2 = l.a().a(intent.getStringExtra("connector_account_id"));
            if (a2 != null) {
                ARSplitPaneActivity.this.addConnectorTab(a2);
            }
        }
    };
    private BroadcastReceiver broadcastReceiver_connectorAccountRemoved = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            k a2 = l.a().a(intent.getStringExtra("connector_account_id"));
            if (a2 != null) {
                ARSplitPaneActivity.this.removeConnectorTab(FWDocumentsLocationManager.getInstance().getLocationId(a2.f136a));
            }
        }
    };
    private BroadcastReceiver broadcastReceiver_userAccountAdded = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (ARSplitPaneActivity.this.addOutboxTab()) {
                ARSplitPaneActivity.this.mTabsFragment.notifyDataSetChanged();
                ARSplitPaneActivity.this.setFabButtonForTabs();
            }
        }
    };
    private BroadcastReceiver broadcastReceiver_userAccountRemoved = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            ARSplitPaneActivity.this.mTabsFragment.removeTab(4);
            ARSplitPaneActivity.this.mTabsFragment.notifyDataSetChanged();
            ARSplitPaneActivity.this.setFabButtonForTabs();
            ARSplitPaneActivity.this.getMobileLinkUIManager().checkAndShowMobileLinkUI();
            ARSplitPaneActivity.this.removeAllConnectorTabs();
        }
    };
    private String mDocFilePath = null;
    private String mCreatePDFFilePath = null;
    private boolean mIsActivityInBackground = true;
    private ArrayList<Integer> mConnectorsLocationIDList = new ArrayList<>();

    class ARDocumentListSearchView extends SearchView {
        public ARDocumentListSearchView(Context context) {
            super(context);
        }

        @Override
        public void onActionViewCollapsed() {
            setQuery(ARFileEntry.DEFAULT_ENTRY_ICON_STRING, false);
            super.onActionViewCollapsed();
            ARSplitPaneActivity.this.unlockSwitcher();
            ARSplitPaneActivity.this.setFabButtonForTabs();
            ARSplitPaneActivity.this.mTabsFragment.showTabStrip();
            ARSplitPaneActivity.this.getActionBar().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bar_color)));
            ARSplitPaneActivity.this.mActionBarMenu.setGroupVisible(R.id.split_pane_menu_group, true);
            ARSplitPaneActivity.this.mActionBarMenu.setGroupVisible(R.id.base_menu_group, true);
            ARSplitPaneActivity.this.getMobileLinkUIManager().checkAndShowMobileLinkUI();
        }

        @Override
        public void onActionViewExpanded() {
            super.onActionViewExpanded();
            ARSplitPaneActivity.this.mTabsFragment.hideTabStrip();
            ARSplitPaneActivity.this.setFabButtonForTabs();
            ARSplitPaneActivity.this.lockSwitcher();
            ARSplitPaneActivity.this.getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.top_action_bar_background));
            ARSplitPaneActivity.this.mActionBarMenu.setGroupVisible(R.id.split_pane_menu_group, false);
            ARSplitPaneActivity.this.mActionBarMenu.setGroupVisible(R.id.base_menu_group, false);
            ARSplitPaneActivity.this.getMobileLinkUIManager().checkAndShowMobileLinkUI();
        }
    }

    static {
        $assertionsDisabled = !ARSplitPaneActivity.class.desiredAssertionStatus();
    }

    private void addAllConnectorTabs() {
        Iterator<k> it = l.a().d().iterator();
        while (it.hasNext()) {
            addConnectorTab(it.next());
        }
    }

    public boolean addOutboxTab() {
        if (!ARServicesAccount.getInstance().isSignedIn()) {
            return false;
        }
        this.mTabsFragment.addTab(4, 500, getString(R.string.IDS_OUTBOX_LABEL), new FWTabsFragment.FWTabsFragmentHandler() {
            @Override
            public FWAbstractTabFragment getFragment() {
                return new FWOutboxListFragment();
            }
        });
        return true;
    }

    public void deleteSelectedFiles() {
        ARFileEntryAdapter currentFileEntryAdapter = getCurrentFileEntryAdapter();
        if (currentFileEntryAdapter == null) {
            return;
        }
        ArrayList<ARFileEntry> arrayList = new ArrayList();
        arrayList.addAll(currentFileEntryAdapter.getCheckedFileEntrylist());
        arrayList.addAll(currentFileEntryAdapter.getCheckedDirectoryEntrylist());
        final int size = arrayList.size();
        if (size != 0) {
            final ArrayList arrayList2 = new ArrayList();
            final ArrayList arrayList3 = new ArrayList();
            for (ARFileEntry aRFileEntry : arrayList) {
                if (aRFileEntry instanceof ARCloudFileEntry) {
                    arrayList3.add(aRFileEntry);
                } else {
                    arrayList2.add(aRFileEntry);
                }
            }
            new ARAlert(this, new ARAlert.DialogProvider() {
                @Override
                public Dialog getDialog() {
                    String string;
                    boolean z = size == 1;
                    ARAlertDialog aRAlertDialog = new ARAlertDialog(ARSplitPaneActivity.this);
                    Context appContext = ARApp.getAppContext();
                    if (z) {
                        aRAlertDialog.setTitle(R.string.IDS_DELETE_ITEM_ALERT_TITLE);
                        string = appContext.getString(R.string.IDS_DELETE_ITEM_ALERT_MESSAGE);
                    } else {
                        aRAlertDialog.setTitle(R.string.IDS_DELETE_ITEMS_ALERT_TITLE);
                        string = appContext.getString(R.string.IDS_DELETE_ITEMS_ALERT_MESSAGE);
                    }
                    aRAlertDialog.setMessage(string);
                    aRAlertDialog.setButton(-1, ARSplitPaneActivity.this.getResources().getString(2131230739), new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                            FWAbstractTabFragment tabFragment;
                            dialogInterface.dismiss();
                            if (arrayList2.size() > 0) {
                                boolean z2 = false;
                                int i2 = 0;
                                for (ARFileEntry aRFileEntry2 : arrayList2) {
                                    File file = new File(aRFileEntry2.getFilePath());
                                    if (BBFileUtils.b(file)) {
                                        ARUtils.refreshSystemMediaScanDataBase(ARSplitPaneActivity.this, aRFileEntry2.getFilePath());
                                        i2++;
                                    } else {
                                        z2 = (z2 || BBFileUtils.isFileWritable(file.getParent())) ? z2 : true;
                                    }
                                }
                                if (i2 != arrayList2.size()) {
                                    Context appContext2 = ARApp.getAppContext();
                                    if ((Build.VERSION.SDK_INT >= 19) && z2) {
                                        Toast.makeText(appContext2, appContext2.getString(R.string.IDS_ERR_FILE_MODIFICATION_OPERATION), 1).show();
                                    } else {
                                        Toast.makeText(appContext2, appContext2.getString(R.string.IDS_ERR_GENERIC_ERROR), 0).show();
                                    }
                                }
                                if (i2 > 0) {
                                    if (size == 1) {
                                        ARDCMAnalytics.getInstance().trackAction(ARDCMAnalytics.SINGLE, ARDCMAnalytics.MY_DOCUMENTS, ARDCMAnalytics.LOCAL_DELETE);
                                    } else {
                                        ARDCMAnalytics.getInstance().trackAction(ARDCMAnalytics.BATCH, ARDCMAnalytics.MY_DOCUMENTS, ARDCMAnalytics.LOCAL_DELETE);
                                    }
                                    ARSplitPaneActivity.this.getCurrentTabFragment().fullyRefreshList();
                                    if (ARSplitPaneActivity.this.mCurrentTabLocationId == 1 && ARSplitPaneActivity.this.mTabsFragment != null && (tabFragment = ARSplitPaneActivity.this.mTabsFragment.getTabFragment(2)) != null) {
                                        tabFragment.fullyRefreshList();
                                    }
                                }
                            }
                            if (arrayList3.size() > 0) {
                                ARSplitPaneActivity.this.getCurrentTabFragment().deleteCloudDocuments(arrayList3);
                            }
                            ARSplitPaneActivity.this.showContextualActionBar(false);
                        }
                    });
                    aRAlertDialog.setButton(-2, ARSplitPaneActivity.this.getResources().getString(android.R.string.cancel), new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                            dialogInterface.dismiss();
                        }
                    });
                    return aRAlertDialog;
                }
            }).show();
        }
    }

    public void downloadFileFromContentStreamWithProgress(Intent intent, boolean z) {
        ARIntentUtils.downloadFileFromContentStreamWithProgress(this, intent, new FWDownloadFileAsyncTask.FWAfterDownloadFileHandler() {
            @Override
            public void onFailure() {
            }

            @Override
            public void onSuccess(String str) {
                FWAbstractTabFragment currentTabFragment;
                boolean z2 = false;
                if (!ARSplitPaneActivity.this.mIsActivityInBackground && (currentTabFragment = ARSplitPaneActivity.this.getCurrentTabFragment()) != null) {
                    z2 = currentTabFragment.doActionAfterGettingFilePath(str);
                }
                ARSplitPaneActivity aRSplitPaneActivity = ARSplitPaneActivity.this;
                if (z2) {
                    str = null;
                }
                aRSplitPaneActivity.mDocFilePath = str;
            }
        }, z);
    }

    public ARFileEntryAdapter getCurrentFileEntryAdapter() {
        if (getCurrentTabFragment() != null) {
            return getCurrentTabFragment().getFileEntryAdapter();
        }
        return null;
    }

    private boolean handleIntent(Intent intent) {
        int intExtra;
        this.mCreatePDFFilePath = intent.getStringExtra(CREATE_PDF_DOC_PATH);
        if (this.mCreatePDFFilePath != null) {
            if (!BBFileUtils.c(this.mCreatePDFFilePath)) {
                switchToDefaultTool(false);
                switchToTool(4, false);
                return true;
            }
        } else if (intent.hasExtra(ARViewerActivity.VIEWER_LAUNCHED_FROM_OTHERS)) {
            if (intent.getBooleanExtra(ARViewerActivity.VIEWER_LAUNCHED_FROM_OTHERS, false)) {
                resetToolSwitcher();
                if (this.mTabsFragment.getCurrentTabLocationId() == 3 || this.mTabsFragment.getCurrentTabLocationId() >= 5) {
                    BBFileUtils.g(this.mDocFilePath);
                    this.mDocFilePath = null;
                }
                getMobileLinkUIManager().dismissCoachMark();
            }
            if (intent.hasExtra(INITIAL_TAB_SELECTED) && (intExtra = intent.getIntExtra(INITIAL_TAB_SELECTED, -1)) != -1) {
                this.mTabsFragment.setDefaultTab(intExtra);
                return true;
            }
        }
        return false;
    }

    private boolean isExtendedCABVisible() {
        return this.mExtendedCAB.isShown();
    }

    private void openFileFromSystemFileBrowser(Intent intent) {
        String docPathFromIntentDataLocally = ARIntentUtils.getDocPathFromIntentDataLocally(intent, getContentResolver());
        if (docPathFromIntentDataLocally != null) {
            getCurrentTabFragment().doActionAfterGettingFilePath(docPathFromIntentDataLocally);
            return;
        }
        if (this.mTabsFragment.getCurrentTabLocationId() == 1) {
            showFileCopyingConfirmationDialog(intent);
        } else if (this.mTabsFragment.getCurrentTabLocationId() == 3 || this.mTabsFragment.getCurrentTabLocationId() >= 5) {
            downloadFileFromContentStreamWithProgress(intent, true);
        }
    }

    public void removeAllConnectorTabs() {
        Iterator<Integer> it = this.mConnectorsLocationIDList.iterator();
        while (it.hasNext()) {
            removeConnectorTab(it.next().intValue());
        }
    }

    public void renameSelectedFile() {
        String fileName;
        ARFileEntryAdapter currentFileEntryAdapter = getCurrentFileEntryAdapter();
        if (currentFileEntryAdapter == null) {
            return;
        }
        ArrayList arrayList = new ArrayList();
        arrayList.addAll(currentFileEntryAdapter.getCheckedFileEntrylist());
        arrayList.addAll(currentFileEntryAdapter.getCheckedDirectoryEntrylist());
        if (arrayList.size() == 1) {
            final ARFileEntry aRFileEntry = (ARFileEntry) arrayList.get(0);
            final boolean z = aRFileEntry.getFileEntryType() == ARFileEntry.FILE_ENTRY_TYPE.DIRECTORY;
            if (z) {
                String filePath = aRFileEntry.getFilePath();
                fileName = filePath.substring(filePath.lastIndexOf(File.separator) + 1, filePath.length());
            } else {
                fileName = aRFileEntry.getFileName();
            }
            final EditText editText = new EditText(this);
            editText.setSingleLine();
            if (z) {
                editText.setText(fileName);
            } else {
                editText.setText(BBFileUtils.b(fileName));
            }
            editText.setSelectAllOnFocus(true);
            editText.setFilters(new InputFilter[]{new InputFilter() {
                @Override
                public CharSequence filter(CharSequence charSequence, int i, int i2, Spanned spanned, int i3, int i4) {
                    while (i < i2) {
                        if (ARFileBrowserUtils.INVALID_FILE_CHARS.contains(String.valueOf(charSequence.charAt(i)))) {
                            return ARFileEntry.DEFAULT_ENTRY_ICON_STRING;
                        }
                        i++;
                    }
                    return null;
                }
            }});
            editText.setHint(R.string.IDS_ENTER_NAME_PLACEHOLDER);
            new ARAlert(this, new ARAlert.DialogProvider() {
                @Override
                public Dialog getDialog() {
                    final ARAlertDialog aRAlertDialog = new ARAlertDialog(ARSplitPaneActivity.this);
                    aRAlertDialog.setTitle(R.string.IDS_RENAME_STR);
                    aRAlertDialog.setView(editText);
                    ARUtils.showKeyboard(editText);
                    aRAlertDialog.setButton(-1, ARSplitPaneActivity.this.getResources().getString(R.string.IDS_DONE_STR), new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                            String i2;
                            String filePath2 = aRFileEntry.getFilePath();
                            String substring = filePath2.substring(0, aRFileEntry.getFilePath().lastIndexOf(File.separator) + 1);
                            String trim = editText.getText().toString().trim();
                            if (!z && (i2 = BBFileUtils.i(BBFileUtils.a(filePath2))) != null && !i2.equalsIgnoreCase(BBFileUtils.i(trim))) {
                                trim = trim + ARFileBrowserUtils.EXTENSION_SEP + i2;
                            }
                            ARSplitPaneActivity.this.getCurrentTabFragment().renameFile(aRFileEntry, substring, trim);
                            ARUtils.hideKeyboard(editText);
                            dialogInterface.dismiss();
                            ARSplitPaneActivity.this.showContextualActionBar(false);
                        }
                    });
                    aRAlertDialog.setButton(-2, ARSplitPaneActivity.this.getResources().getString(android.R.string.cancel), new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                            ARUtils.hideKeyboard(editText);
                            dialogInterface.dismiss();
                        }
                    });
                    editText.addTextChangedListener(new TextWatcher() {
                        @Override
                        public void afterTextChanged(Editable editable) {
                            if (editable.toString().trim().length() == 0) {
                                aRAlertDialog.getButton(-1).setEnabled(false);
                            } else {
                                aRAlertDialog.getButton(-1).setEnabled(true);
                            }
                        }

                        @Override
                        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
                        }

                        @Override
                        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
                        }
                    });
                    return aRAlertDialog;
                }
            }, new DialogInterface.OnCancelListener() {
                @Override
                public void onCancel(DialogInterface dialogInterface) {
                    ARUtils.hideKeyboard(editText);
                    dialogInterface.dismiss();
                }
            }).show();
        }
    }

    public void setFabButtonForTabs() {
        if (this.mFabButton == null) {
        }
        if (isInContextualMode() || isSearchActivated()) {
            this.mFabButton.setVisibility(8);
            return;
        }
        this.mFabButton.setVisibility(0);
        switch (this.mCurrentTabLocationId) {
            case 0:
            case 2:
            case 4:
                this.mFabButton.setVisibility(8);
                break;
            case 1:
                this.mFabButton.setFabStyle(R.color.home_fab_color, R.color.home_fab_pressed_color, R.drawable.h_promoted_open_white);
                this.mFabButton.setContentDescription(getResources().getString(R.string.IDS_FLOATIING_ACTION_BUTTON_FOR_RECENTS_ACCESSIBILITY_STR));
                break;
            case 3:
            default:
                if (!ARServicesAccount.getInstance().isSignedIn()) {
                    this.mFabButton.setVisibility(8);
                    break;
                } else {
                    this.mFabButton.setFabStyle(R.color.home_fab_color, R.color.home_fab_pressed_color, R.drawable.h_promoted_upload_white);
                    this.mFabButton.setContentDescription(getResources().getString(R.string.IDS_FLOATIING_ACTION_BUTTON_FOR_DOCUMENTS_CLOUD_ACCESSIBILITY_STR));
                    break;
                }
        }
    }

    private void setupContextualActionBar() {
        this.mCallback = new ActionMode.Callback() {
            @Override
            public boolean onActionItemClicked(android.view.ActionMode r7, android.view.MenuItem r8) {
                throw new UnsupportedOperationException("Method not decompiled: com.adobe.reader.viewer.ARSplitPaneActivity.AnonymousClass16.onActionItemClicked(android.view.ActionMode, android.view.MenuItem):boolean");
            }

            @Override
            public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
                ARSplitPaneActivity.this.getMenuInflater().inflate(R.menu.split_pane_context_menu, menu);
                ARSplitPaneActivity.this.mContextBarMenu = menu;
                return true;
            }

            @Override
            public void onDestroyActionMode(ActionMode actionMode) {
                if (ARSplitPaneActivity.this.mMode != null) {
                    ARSplitPaneActivity.this.mMode = null;
                    ARSplitPaneActivity.this.mContextBarMenu = null;
                    FWAbstractTabFragment currentTabFragment = ARSplitPaneActivity.this.getCurrentTabFragment();
                    if (currentTabFragment != null) {
                        currentTabFragment.exitContextualMode();
                    }
                    if (!ARSplitPaneActivity.this.isSearchActivated()) {
                        ARSplitPaneActivity.this.showExtendedCAB(false);
                        ARSplitPaneActivity.this.unlockSwitcher();
                        ARSplitPaneActivity.this.mTabsFragment.showTabStrip();
                    }
                    ARSplitPaneActivity.this.setFabButtonForTabs();
                    ARSplitPaneActivity.this.getMobileLinkUIManager().checkAndShowMobileLinkUI();
                }
            }

            @Override
            public boolean onPrepareActionMode(ActionMode actionMode, Menu menu) {
                ARSplitPaneActivity.this.updateContextActionBarItems();
                return true;
            }
        };
    }

    public void shareFiles() {
        ARFileEntryAdapter currentFileEntryAdapter = getCurrentFileEntryAdapter();
        if (currentFileEntryAdapter == null) {
            return;
        }
        ARFileBrowserUtils.shareFileBrowserFiles(this, currentFileEntryAdapter.getCheckedFileEntrylist());
    }

    public void showExtendedCAB(boolean z) {
        if (z) {
            ViewGroup.LayoutParams layoutParams = this.mExtendedCAB.getLayoutParams();
            layoutParams.height = this.mTabsFragment.getTabStripHeight();
            this.mExtendedCAB.setLayoutParams(layoutParams);
        }
        this.mExtendedCAB.setVisibility(z ? 0 : 8);
    }

    private void showFileCopyingConfirmationDialog(final Intent intent) {
        new ARAlert(this, new ARAlert.DialogProvider() {
            @Override
            public Dialog getDialog() {
                ARAlertDialog aRAlertDialog = new ARAlertDialog(ARSplitPaneActivity.this);
                aRAlertDialog.setTitle(ARSplitPaneActivity.this.getResources().getString(R.string.IDS_COPY_FILE_CONFIRMTAION_DIALOG_TITLE_FOR_RECENTS_TAB));
                aRAlertDialog.setMessage(ARSplitPaneActivity.this.getResources().getString(R.string.IDS_FILE_COPY_WARNING_MESSAGE));
                aRAlertDialog.setButton(-1, ARSplitPaneActivity.this.getResources().getString(2131230753), new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        ARSplitPaneActivity.this.downloadFileFromContentStreamWithProgress(intent, false);
                    }
                });
                aRAlertDialog.setButton(-2, ARApp.getAppContext().getString(2131230745), new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        dialogInterface.dismiss();
                    }
                });
                return aRAlertDialog;
            }
        }).show();
    }

    private void trackAnalyticsForDefaultTab() {
        ARDCMAnalytics.getInstance().trackAction(ARDCMAnalytics.RECENT, ARDCMAnalytics.MY_DOCUMENTS, ARDCMAnalytics.SOURCE_SELECTED);
    }

    private void trackAnalyticsForFAB() {
        switch (this.mCurrentTabLocationId) {
            case 1:
                ARDCMAnalytics.getInstance().trackAction(ARDCMAnalytics.FAB_TAPPED, ARDCMAnalytics.MY_DOCUMENTS, ARDCMAnalytics.RECENT, (HashMap<String, Object>) null);
                break;
            case 3:
                ARDCMAnalytics.getInstance().trackAction(ARDCMAnalytics.FAB_TAPPED, ARDCMAnalytics.MY_DOCUMENTS, "Document Cloud", (HashMap<String, Object>) null);
                break;
        }
    }

    public void trackAnalyticsForTabs() {
        if (getCurrentTabFragment() != null) {
            HashMap<String, String> analyticsStringForSelectedTab = getCurrentTabFragment().analyticsStringForSelectedTab();
            ARDCMAnalytics.getInstance().trackAction(analyticsStringForSelectedTab.get(ARDCMAnalytics.CONTEXT_KEY_ACTION), analyticsStringForSelectedTab.get(ARDCMAnalytics.CONTEXT_KEY_PRIMARY_CATEGORY), analyticsStringForSelectedTab.get(ARDCMAnalytics.CONTEXT_KEY_SECONDARY_CATEGORY));
        }
    }

    public void addConnectorTab(final k kVar) {
        Integer valueOf = Integer.valueOf(FWDocumentsLocationManager.getInstance().addLocation(kVar.b));
        if (this.mConnectorsLocationIDList.contains(valueOf)) {
            return;
        }
        this.mConnectorsLocationIDList.add(valueOf);
        this.mTabsFragment.addTab(valueOf.intValue(), FWTabsFragment.CONNECTORS_ORDER_ID, kVar.c, new FWTabsFragment.FWTabsFragmentHandler() {
            @Override
            public FWAbstractTabFragment getFragment() {
                return FWConnectorListFragment.getNewInstance(kVar.b);
            }
        });
        this.mTabsFragment.notifyDataSetChanged();
    }

    public boolean dismissSearch() {
        boolean isSearchActivated = isSearchActivated();
        if (isSearchActivated) {
            this.mSearchMenuItem.collapseActionView();
        }
        return isSearchActivated;
    }

    public void displayErrorDialog(String str) {
        if (isFinishing()) {
            return;
        }
        if (this.mErrorDlg == null) {
            this.mErrorDlg = new ARViewerManagedDialog(this);
            this.mErrorDlg.setTitle(2131230738);
            this.mErrorDlg.setButton(-1, getResources().getString(2131230739), new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    dialogInterface.dismiss();
                }
            });
        }
        this.mErrorDlg.setMessage(str);
        this.mErrorDlg.show();
    }

    @Override
    protected int getActivityLayoutID() {
        return R.layout.split_pane;
    }

    @Override
    public int getActivityTheme() {
        return R.style.Theme_HomeStyle;
    }

    @Override
    protected FWBaseSwitcherActivity.FWToolSwitchHandler getCommentsToolSwitchHandler() {
        return new FWBaseSwitcherActivity.FWToolSwitchHandler() {
            @Override
            public boolean canEnterTool(int i) {
                Resources resources = ARSplitPaneActivity.this.getResources();
                ARAlert.displayErrorDlg(ARSplitPaneActivity.this, resources.getString(R.string.IDS_TOOL_NO_DOC_GUIDING_SCREEN_TITLE), resources.getString(R.string.IDS_INSTRUCTIONS_COMMENTS).replace("$HOME$", resources.getString(R.string.IDS_SWITCHER_ENTRY_HOME_TITLE)), new ARAlert.OnPositiveButtonClickedClickHandler() {
                    @Override
                    public void onPositiveButtonClick() {
                        ARSplitPaneActivity.this.switchToDefaultTool(false);
                    }
                });
                return false;
            }

            @Override
            public boolean canExitTool(int i) {
                return true;
            }

            @Override
            public void confirmToolEnter(int i, FWBaseSwitcherActivity.FWEnterToolSuccessHandler fWEnterToolSuccessHandler) {
            }

            @Override
            public void confirmToolExit(int i, FWBaseSwitcherActivity.FWExitToolSucccessHandler fWExitToolSucccessHandler) {
            }

            @Override
            public void enterTool(int i) {
            }

            @Override
            public void exitTool(int i) {
            }
        };
    }

    @Override
    protected FWBaseSwitcherActivity.FWToolSwitchHandler getCreatePDFToolSwitchHandler() {
        return new FWBaseSwitcherActivity.FWToolSwitchHandler() {
            @Override
            public boolean canEnterTool(int i) {
                return true;
            }

            @Override
            public boolean canExitTool(int i) {
                return true;
            }

            @Override
            public void confirmToolEnter(int i, FWBaseSwitcherActivity.FWEnterToolSuccessHandler fWEnterToolSuccessHandler) {
            }

            @Override
            public void confirmToolExit(int i, FWBaseSwitcherActivity.FWExitToolSucccessHandler fWExitToolSucccessHandler) {
            }

            @Override
            public void enterTool(int i) {
                String str;
                String str2 = null;
                ARSplitPaneActivity.this.findViewById(R.id.split_pane_main_container).setVisibility(8);
                if (ARSplitPaneActivity.this.mCreatePDFFilePath != null) {
                    ARSplitPaneActivity.this.mCreatePDFFragment = new ARCreatePDFFragment(ARSplitPaneActivity.this, null, ARSplitPaneActivity.this.mCreatePDFFilePath, BBFileUtils.d(ARSplitPaneActivity.this.mCreatePDFFilePath), false, d.ACROBAT_DOT_COM_DEFAULT_SOURCE_NAME);
                    ARSplitPaneActivity.this.mCreatePDFFilePath = null;
                } else {
                    ARFileEntry singleSelectedFileEntry = ARSplitPaneActivity.this.getCurrentTabFragment().getSingleSelectedFileEntry();
                    if (singleSelectedFileEntry != null) {
                        String filePath = singleSelectedFileEntry.getFilePath();
                        long fileSize = singleSelectedFileEntry.getFileSize();
                        if (singleSelectedFileEntry instanceof ARCloudFileEntry) {
                            ARCloudFileEntry aRCloudFileEntry = (ARCloudFileEntry) singleSelectedFileEntry;
                            str2 = aRCloudFileEntry.getFileID();
                            filePath = n.a(str2, singleSelectedFileEntry.getFileName());
                            str = aRCloudFileEntry.getCloudSource();
                        } else {
                            str = null;
                        }
                        ARSplitPaneActivity.this.mCreatePDFFragment = new ARCreatePDFFragment(ARSplitPaneActivity.this, str2, filePath, fileSize, true, str);
                    } else {
                        ARSplitPaneActivity.this.mCreatePDFFragment = new ARCreatePDFFragment(ARSplitPaneActivity.this, true, true);
                    }
                }
                ARSplitPaneActivity.this.enterToolFragment(ARSplitPaneActivity.this.mCreatePDFFragment);
            }

            @Override
            public void exitTool(int i) {
                ARSplitPaneActivity.this.exitToolFragment(ARSplitPaneActivity.this.mCreatePDFFragment);
                ARSplitPaneActivity.this.findViewById(R.id.split_pane_main_container).setVisibility(0);
                ARSplitPaneActivity.this.mCreatePDFFragment = null;
            }
        };
    }

    public FWAbstractTabFragment getCurrentTabFragment() {
        return this.mTabsFragment.getCurrentTabFragment();
    }

    public int getCurrentTabID() {
        return this.mCurrentTabLocationId;
    }

    @Override
    protected int getDefaultToolID() {
        return 1;
    }

    @Override
    protected List<FWSwitcherEntry> getEntries() {
        List<FWSwitcherEntry> allEntries = ARAppSwitcherEntryManager.getAllEntries();
        boolean z = !ARFillAndSignUtils.shouldShowFillAndSignEntryInToolSwitcher(this);
        Iterator<FWSwitcherEntry> it = allEntries.iterator();
        while (it.hasNext()) {
            FWSwitcherEntry next = it.next();
            if (next.getID() == 2 || (z && next.getID() == 7)) {
                it.remove();
            }
        }
        return allEntries;
    }

    @Override
    protected FWBaseSwitcherActivity.FWToolSwitchHandler getExportPDFSwitchHandler() {
        return new FWBaseSwitcherActivity.FWToolSwitchHandler() {
            private ARFileEntry mSelectedFileEntry;

            @Override
            public boolean canEnterTool(int i) {
                return true;
            }

            @Override
            public boolean canExitTool(int i) {
                return true;
            }

            @Override
            public void confirmToolEnter(int i, FWBaseSwitcherActivity.FWEnterToolSuccessHandler fWEnterToolSuccessHandler) {
            }

            @Override
            public void confirmToolExit(int i, FWBaseSwitcherActivity.FWExitToolSucccessHandler fWExitToolSucccessHandler) {
            }

            @Override
            public void enterTool(int i) {
                String str;
                String str2 = null;
                ARSplitPaneActivity.this.findViewById(R.id.split_pane_main_container).setVisibility(8);
                this.mSelectedFileEntry = ARSplitPaneActivity.this.getCurrentTabFragment().getSingleSelectedFileEntry();
                if (this.mSelectedFileEntry != null) {
                    String filePath = this.mSelectedFileEntry.getFilePath();
                    long fileSize = this.mSelectedFileEntry.getFileSize();
                    if (this.mSelectedFileEntry instanceof ARCloudFileEntry) {
                        ARCloudFileEntry aRCloudFileEntry = (ARCloudFileEntry) this.mSelectedFileEntry;
                        str = aRCloudFileEntry.getFileID();
                        str2 = aRCloudFileEntry.getCloudSource();
                        filePath = n.a(str, this.mSelectedFileEntry.getFileName());
                    } else {
                        str = null;
                    }
                    ARSplitPaneActivity.this.mExportPDFFragment = new ARExportPDFFragment(ARSplitPaneActivity.this, str, filePath, fileSize, str2);
                } else {
                    ARSplitPaneActivity.this.mExportPDFFragment = new ARExportPDFFragment(ARSplitPaneActivity.this, true);
                }
                ARSplitPaneActivity.this.enterToolFragment(ARSplitPaneActivity.this.mExportPDFFragment);
            }

            @Override
            public void exitTool(int i) {
                ARSplitPaneActivity.this.exitToolFragment(ARSplitPaneActivity.this.mExportPDFFragment);
                ARSplitPaneActivity.this.findViewById(R.id.split_pane_main_container).setVisibility(0);
                ARSplitPaneActivity.this.mExportPDFFragment = null;
            }
        };
    }

    public void getFileChooser(View view) {
        trackAnalyticsForFAB();
        boolean z = this.mCurrentTabLocationId == 1;
        if (ARIntentUtils.openSystemFileBrowserFromActivity(this, z)) {
            return;
        }
        ARIntentUtils.openLocalFileBrowser(getSupportFragmentManager(), z ? "application/pdf" : null, getResources().getString(z ? R.string.IDS_LOCAL_FILE_BROWSER_RECENTS_TITLE : R.string.IDS_LOCAL_FILE_BROWSER_CLOUD_TITLE), new FWLocalFolderFileListFragment.FWDocumentSelectionHandler() {
            @Override
            public void onFileSelected(String str) {
                FWAbstractTabFragment currentTabFragment = ARSplitPaneActivity.this.getCurrentTabFragment();
                if (currentTabFragment != null) {
                    currentTabFragment.doActionAfterGettingFilePath(str);
                }
            }
        });
    }

    @Override
    protected FWBaseSwitcherActivity.FWToolSwitchHandler getFillAndSignSwitchHandler() {
        return new FWBaseSwitcherActivity.FWToolSwitchHandler() {
            @Override
            public boolean canEnterTool(int i) {
                return ARFillAndSignUtils.canEnterFillAndSignTool(ARSplitPaneActivity.this, null, null, null, false);
            }

            @Override
            public boolean canExitTool(int i) {
                return true;
            }

            @Override
            public void confirmToolEnter(int i, FWBaseSwitcherActivity.FWEnterToolSuccessHandler fWEnterToolSuccessHandler) {
            }

            @Override
            public void confirmToolExit(int i, FWBaseSwitcherActivity.FWExitToolSucccessHandler fWExitToolSucccessHandler) {
            }

            @Override
            public void enterTool(int i) {
                ARSplitPaneActivity.this.mFillAndSignFragment = new ARFillAndSignFragment(ARSplitPaneActivity.this);
                ARSplitPaneActivity.this.enterToolFragment(ARSplitPaneActivity.this.mFillAndSignFragment);
            }

            @Override
            public void exitTool(int i) {
                ARSplitPaneActivity.this.exitToolFragment(ARSplitPaneActivity.this.mFillAndSignFragment);
                ARSplitPaneActivity.this.mFillAndSignFragment = null;
            }
        };
    }

    @Override
    protected FWBaseSwitcherActivity.FWToolSwitchHandler getHomeToolSwitchHandler() {
        return new FWBaseSwitcherActivity.FWToolSwitchHandler() {
            @Override
            public boolean canEnterTool(int i) {
                return true;
            }

            @Override
            public boolean canExitTool(int i) {
                return true;
            }

            @Override
            public void confirmToolEnter(int i, FWBaseSwitcherActivity.FWEnterToolSuccessHandler fWEnterToolSuccessHandler) {
            }

            @Override
            public void confirmToolExit(int i, FWBaseSwitcherActivity.FWExitToolSucccessHandler fWExitToolSucccessHandler) {
            }

            @Override
            public void enterTool(int i) {
                if (ARApp.isRunning7inchOrAboveDevice() || ARSplitPaneActivity.this.getResources().getConfiguration().orientation != 1) {
                    ARSplitPaneActivity.this.getActionBar().setDisplayShowTitleEnabled(true);
                } else {
                    ARSplitPaneActivity.this.getActionBar().setDisplayShowTitleEnabled(false);
                }
                ARSplitPaneActivity.this.getActionBar().setBackgroundDrawable(new ColorDrawable(ARSplitPaneActivity.this.getResources().getColor(R.color.action_bar_color)));
            }

            @Override
            public void exitTool(int i) {
                ARSplitPaneActivity.this.getActionBar().setDisplayShowTitleEnabled(true);
                ARSplitPaneActivity.this.getActionBar().setBackgroundDrawable(ARSplitPaneActivity.this.getResources().getDrawable(R.drawable.top_action_bar_background));
            }
        };
    }

    public ARMobileLinkUIManager getMobileLinkUIManager() {
        return this.mMobileLinkUIManager;
    }

    @Override
    public int getOptionsMenuGroupID() {
        return R.id.split_pane_menu_group;
    }

    @Override
    protected FWBaseSwitcherActivity.FWToolSwitchHandler getOrganizePagesToolSwitchHandler() {
        return new FWBaseSwitcherActivity.FWToolSwitchHandler() {
            @Override
            public boolean canEnterTool(int i) {
                if (!ARServicesAccount.getInstance().isEntitledForService(h.ACROBATPRO_SERVICE)) {
                    return true;
                }
                Resources resources = ARSplitPaneActivity.this.getResources();
                ARAlert.displayErrorDlg(ARSplitPaneActivity.this, resources.getString(R.string.IDS_TOOL_NO_DOC_GUIDING_SCREEN_TITLE), resources.getString(R.string.IDS_INSTRUCTIONS_ORGANIZE_PAGES).replace("$HOME$", resources.getString(R.string.IDS_SWITCHER_ENTRY_HOME_TITLE)), new ARAlert.OnPositiveButtonClickedClickHandler() {
                    @Override
                    public void onPositiveButtonClick() {
                        ARSplitPaneActivity.this.switchToDefaultTool(false);
                    }
                });
                return false;
            }

            @Override
            public boolean canExitTool(int i) {
                return true;
            }

            @Override
            public void confirmToolEnter(int i, FWBaseSwitcherActivity.FWEnterToolSuccessHandler fWEnterToolSuccessHandler) {
            }

            @Override
            public void confirmToolExit(int i, FWBaseSwitcherActivity.FWExitToolSucccessHandler fWExitToolSucccessHandler) {
            }

            @Override
            public void enterTool(int i) {
                ARSplitPaneActivity.this.mOrganizePagesFragment = new AROrganizePagesFragment(ARSplitPaneActivity.this, null);
                ARSplitPaneActivity.this.enterToolFragment(ARSplitPaneActivity.this.mOrganizePagesFragment);
            }

            @Override
            public void exitTool(int i) {
                ARSplitPaneActivity.this.exitToolFragment(ARSplitPaneActivity.this.mOrganizePagesFragment);
                ARSplitPaneActivity.this.mOrganizePagesFragment = null;
            }
        };
    }

    @Override
    protected FWBaseSwitcherActivity.FWToolSwitchHandler getViewerToolSwitchHandler() {
        return null;
    }

    @Override
    protected boolean handleBackPressed() {
        if (dismissSearch()) {
            return true;
        }
        FWAbstractTabFragment currentTabFragment = getCurrentTabFragment();
        if (currentTabFragment != null) {
            return currentTabFragment.handleBackPress();
        }
        return false;
    }

    public boolean isInContextualMode() {
        return this.mMode != null;
    }

    public boolean isSearchActivated() {
        return (this.mSearchView == null || this.mSearchView.isIconified() || this.mSearchView.isInEditMode()) ? false : true;
    }

    @Override
    public void onActivityResultRAW(int i, int i2, Intent intent) {
        super.onActivityResultRAW(i, i2, intent);
        switch (i) {
            case 1:
                BBFileUtils.g(this.mDocFilePath);
                this.mDocFilePath = null;
                break;
            case ARConstants.SYSTEM_FILE_BROWSER_REQUEST_CODE:
                if (getCurrentTabFragment() == null || i2 != -1 || intent == null || intent.getData() == null) {
                    return;
                }
                if (this.mCurrentTabLocationId != 1) {
                    this.mFileOpenedFromFileBrowser = true;
                    this.mFileOpenedFromFileBrowserIntent = intent;
                    return;
                } else if (!ARIntentUtils.checkPdfTypeFromIntentData(intent, getContentResolver())) {
                    ARApp.displayErrorToast(getResources().getString(R.string.IDS_UNSUPPORTED_FILE_FORMAT_ERROR));
                    return;
                } else {
                    this.mFileOpenedFromFileBrowser = true;
                    this.mFileOpenedFromFileBrowserIntent = intent;
                    return;
                }
            case ARConstants.MOBILE_LINK_RFE_PREFS_TOGGLE_REQUEST_CODE:
                if (getCurrentTabFragment() == null) {
                    return;
                }
                boolean showMobileLinkUI = getCurrentTabFragment().showMobileLinkUI();
                if (i2 != -1) {
                    if (showMobileLinkUI) {
                        this.mMobileLinkUIManager.setRFEEnabledPrefsFromBanner(false);
                        this.mMobileLinkUIManager.toggleMobileLinkButton(false);
                        return;
                    }
                    return;
                }
                boolean booleanExtra = intent.getBooleanExtra(ARMobileLinkUIManager.RFE_TOGGLE_STATUS_KEY, ARServicesAccount.getInstance().isMobileLinkOn());
                int intExtra = intent.getIntExtra(ARMobileLinkUIManager.RFE_TOGGLED_SOURCE_VIEW_KEY, ARMobileLinkUIManager.RFE_TOGGLE_SOURCE.RFE_UNKNOWN_VIEW.ordinal());
                getMobileLinkUIManager().dismissCoachMark();
                if (showMobileLinkUI) {
                    if (intExtra == ARMobileLinkUIManager.RFE_TOGGLE_SOURCE.RFE_BANNER_VIEW.ordinal()) {
                        this.mMobileLinkUIManager.setRFEEnabledPrefsFromBanner(booleanExtra);
                        return;
                    } else {
                        if (intExtra == ARMobileLinkUIManager.RFE_TOGGLE_SOURCE.RFE_INDICATOR_VIEW.ordinal()) {
                            this.mMobileLinkUIManager.setRFEEnabledPrefsFromIndicator(booleanExtra);
                            return;
                        }
                        return;
                    }
                }
                return;
            case 10101:
                a.a().a(i, i2, intent);
                return;
        }
        if (!$assertionsDisabled) {
            throw new AssertionError();
        }
    }

    @Override
    public void onConfigurationChanged(Configuration configuration) {
        ARMobileLinkUIManager mobileLinkUIManager = getMobileLinkUIManager();
        if (mobileLinkUIManager != null) {
            mobileLinkUIManager.dismissCoachMark();
        }
        super.onConfigurationChanged(configuration);
        if (getResources().getConfiguration().orientation != 1 || getCurrentSwitcherItemID() != 1) {
            getActionBar().setDisplayShowTitleEnabled(true);
        } else if (ARApp.isRunning7inchOrAboveDevice()) {
            getActionBar().setDisplayShowTitleEnabled(true);
        } else {
            getActionBar().setDisplayShowTitleEnabled(false);
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.split_pane_menu, menu);
        this.mSearchView = new ARDocumentListSearchView(this);
        this.mSearchView.setQueryHint(getResources().getString(R.string.IDS_FILE_BROWSER_SEARCH_HINT_STR, this.mTabsFragment.getCurrentTabTitle()));
        this.mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
            @Override
            public boolean onQueryTextChange(String str) {
                FWAbstractTabFragment currentTabFragment = ARSplitPaneActivity.this.getCurrentTabFragment();
                ARFileEntryAdapter currentFileEntryAdapter = currentTabFragment != null ? ARSplitPaneActivity.this.getCurrentFileEntryAdapter() : null;
                if (currentFileEntryAdapter == null || currentTabFragment == null || !currentTabFragment.isSearchSupported()) {
                    return false;
                }
                currentFileEntryAdapter.updateSearchString(str);
                return false;
            }

            @Override
            public boolean onQueryTextSubmit(String str) {
                return false;
            }
        });
        this.mSearchMenuItem = menu.findItem(R.id.split_pane_search);
        this.mSearchMenuItem.setVisible(false);
        this.mSearchMenuItem.setActionView(this.mSearchView);
        MenuItem findItem = menu.findItem(R.id.split_pane_mobile_link);
        findItem.setVisible(false);
        if (this.mMobileLinkUIManager != null) {
            findItem.setActionView(this.mMobileLinkUIManager.setMobileLinkActionView());
        }
        super.onCreateOptionsMenu(menu);
        return true;
    }

    @Override
    public void onCreateRAW(Bundle bundle) {
        super.onCreateRAW(null);
        this.mExtendedCAB = (TextView) findViewById(R.id.extended_contextual_action_bar);
        com.adobe.libs.services.a.n.a().c();
        l.a().g();
        this.mFabButton = (FWFloatingActionButton) findViewById(R.id.fab_view_button);
        this.mTabsFragment = (FWTabsFragment) getSupportFragmentManager().findFragmentById(R.id.tabs_fragment);
        this.mTabsFragment.addTab(1, 100, getString(R.string.IDS_RECENTS_HEADING_ANDROID_STR), new FWTabsFragment.FWTabsFragmentHandler() {
            @Override
            public FWAbstractTabFragment getFragment() {
                return new FWRecentsListFragment();
            }
        });
        this.mTabsFragment.addTab(2, FWTabsFragment.LOCAL_ORDER_ID, getString(R.string.IDS_LOCAL_LABEL), new FWTabsFragment.FWTabsFragmentHandler() {
            @Override
            public FWAbstractTabFragment getFragment() {
                return new FWLocalFileListFragment();
            }
        });
        this.mTabsFragment.addTab(3, FWTabsFragment.ACROBAT_DOT_COM_ORDER_ID, d.getInstance().getAcrobatDotComLabel(), new FWTabsFragment.FWTabsFragmentHandler() {
            @Override
            public FWAbstractTabFragment getFragment() {
                return FWDocumentCloudListFragment.getNewInstance(d.getInstance().getAcrobatDotComRootFolderID());
            }
        });
        addAllConnectorTabs();
        new p(new q() {
            @Override
            public void onFailure() {
            }

            @Override
            public void onSuccess(ArrayList<j> arrayList) {
                new ARBlueHeronGetSystemFolderIDsAsyncTask(null).taskExecute(new Void[0]);
            }
        }).taskExecute(new Void[0]);
        addOutboxTab();
        this.mTabsFragment.setDefaultTab(1);
        this.mCurrentTabLocationId = 1;
        trackAnalyticsForDefaultTab();
        setFabButtonForTabs();
        this.mTabsFragment.addOnTabChangeListener(new FWTabsFragment.OnTabChangeListener() {
            @Override
            public void onTabChanged() {
                ARSplitPaneActivity.this.mCurrentTabLocationId = ARSplitPaneActivity.this.mTabsFragment.getCurrentTabLocationId();
                FWAbstractTabFragment currentTabFragment = ARSplitPaneActivity.this.getCurrentTabFragment();
                if (currentTabFragment != null && ARSplitPaneActivity.this.mCurrentTabLocationId != 2) {
                    currentTabFragment.fullyRefreshList();
                }
                ARSplitPaneActivity.this.setFabButtonForTabs();
                ARSplitPaneActivity.this.getMobileLinkUIManager().checkAndShowMobileLinkUI();
                ARSplitPaneActivity.this.dismissSearch();
                ARSplitPaneActivity.this.trackAnalyticsForTabs();
            }
        });
        this.mTabsFragment.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
            @Override
            public void onPageScrolled(int i, float f, int i2) {
                View view;
                View findFocus;
                FWAbstractTabFragment currentTabFragment = ARSplitPaneActivity.this.getCurrentTabFragment();
                if (currentTabFragment != null && (view = currentTabFragment.getView()) != null && (findFocus = view.findFocus()) != null) {
                    ((InputMethodManager) ARApp.getAppContext().getSystemService("input_method")).hideSoftInputFromWindow(findFocus.getWindowToken(), 0);
                }
                super.onPageScrolled(i, f, i2);
            }
        });
        this.mTabsFragment.notifyDataSetChanged();
        View placeCustomViewBelowTabStrip = this.mTabsFragment.placeCustomViewBelowTabStrip(R.layout.mobile_link_visibility_layout);
        if (placeCustomViewBelowTabStrip != null) {
            this.mMobileLinkUIManager = new ARMobileLinkUIManager(this, placeCustomViewBelowTabStrip);
        }
        setupContextualActionBar();
        LocalBroadcastManager.getInstance(this).registerReceiver(this.broadcastReceiver_userAccountAdded, new IntentFilter("com.adobe.libs.services.auth.SVInitiateServicesAccountAsyncTask.userAccountAdded"));
        LocalBroadcastManager.getInstance(this).registerReceiver(this.broadcastReceiver_userAccountRemoved, new IntentFilter(d.BROADCAST_USER_ACCOUNT_REMOVED));
        LocalBroadcastManager.getInstance(this).registerReceiver(this.broadcastReceiver_connectorAccountAdded, new IntentFilter("com.adobe.libs.services.blueheron.SVBlueHeronConnectorAccountManager.connectorAccountAdded"));
        LocalBroadcastManager.getInstance(this).registerReceiver(this.broadcastReceiver_connectorAccountRemoved, new IntentFilter("com.adobe.libs.services.blueheron.SVBlueHeronConnectorAccountManager.connectorAccountRemoved"));
        LocalBroadcastManager.getInstance(this).registerReceiver(this.broadcastReceiver_switchToOutboxTab, new IntentFilter(ARViewerActivity.BROADCAST_SWITCH_TO_OUTBOX));
        LocalBroadcastManager.getInstance(this).registerReceiver(this.broadcastReceiver_documentCloudTabCreatedFirstLaunch, new IntentFilter(FWBaseCloudListFragment.BROADCAST_DOCUMENT_TAB_CREATED_FIRST_LAUNCH));
        LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent(BROADCAST_SPLIT_PANE_LAUNCHED));
        handleIntent(getIntent());
        getActionBar().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bar_color)));
    }

    @Override
    public void onDestroyRAW() {
        if (this.mErrorDlg != null) {
            this.mErrorDlg.dismiss();
            this.mErrorDlg = null;
        }
        LocalBroadcastManager.getInstance(this).unregisterReceiver(this.broadcastReceiver_userAccountRemoved);
        LocalBroadcastManager.getInstance(this).unregisterReceiver(this.broadcastReceiver_userAccountAdded);
        LocalBroadcastManager.getInstance(this).unregisterReceiver(this.broadcastReceiver_switchToOutboxTab);
        LocalBroadcastManager.getInstance(this).unregisterReceiver(this.broadcastReceiver_documentCloudTabCreatedFirstLaunch);
        LocalBroadcastManager.getInstance(this).unregisterReceiver(this.broadcastReceiver_connectorAccountAdded);
        LocalBroadcastManager.getInstance(this).unregisterReceiver(this.broadcastReceiver_connectorAccountRemoved);
        if (this.mMobileLinkUIManager != null) {
            this.mMobileLinkUIManager.release();
        }
        super.onDestroyRAW();
    }

    @Override
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (84 == i) {
            return true;
        }
        return super.onKeyDown(i, keyEvent);
    }

    @Override
    public void onNewIntentRAW(Intent intent) {
        super.onNewIntentRAW(intent);
        String str = "onNewIntent : ARSplitPane: Got a new intent: " + intent.toString();
        handleIntent(intent);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        switch (menuItem.getItemId()) {
            case R.id.split_pane_automation:
                startActivity(new Intent(this, (Class<?>) ARAutomationListActivity.class));
                return true;
            case R.id.split_pane_unittests:
                startActivity(new Intent(this, (Class<?>) ARUnitTestActivity.class));
                return true;
            default:
                return super.onOptionsItemSelected(menuItem);
        }
    }

    @Override
    public void onPauseRAW() {
        super.onPauseRAW();
        ARDCMAnalytics.getInstance().pauseCollectingLifecycleData();
        showContextualActionBar(false);
        closeToolSwitcher();
        AREMMManager.getInstance().unregisterRestrictionChangedReceiver(getApplicationContext(), AREMMManager.getInstance().getEMMName(), null);
        AREMMManager.getInstance().dismissEMMDialog();
    }

    @Override
    public void onPostCreate(Bundle bundle) {
        super.onPostCreate(bundle);
        if (!(getCurrentSwitcherItemID() == 1) || ARApp.isRunning7inchOrAboveDevice()) {
            return;
        }
        getActionBar().setDisplayShowTitleEnabled(false);
    }

    @Override
    public void onPostResume() {
        super.onPostResume();
        if (this.mFileOpenedFromFileBrowser) {
            openFileFromSystemFileBrowser(this.mFileOpenedFromFileBrowserIntent);
            this.mFileOpenedFromFileBrowserIntent = null;
            this.mFileOpenedFromFileBrowser = false;
        }
    }

    @Override
    public boolean onPrepareOptionsMenu(Menu menu) {
        super.onPrepareOptionsMenu(menu);
        if (!isSearchActivated()) {
            menu.findItem(R.id.split_pane_automation).setVisible(false);
            menu.findItem(R.id.split_pane_unittests).setVisible(false);
        }
        this.mActionBarMenu = menu;
        return true;
    }

    @Override
    protected void onRestart() {
        if (this.mDocFilePath != null && this.mIsActivityInBackground) {
            getCurrentTabFragment().doActionAfterGettingFilePath(this.mDocFilePath);
            this.mDocFilePath = null;
        }
        super.onRestart();
    }

    @Override
    public void onResumeRAW() {
        super.onResumeRAW();
        ARDCMAnalytics.getInstance().collectLifecycleData();
        if (this.mSearchMenuItem != null) {
            this.mSearchMenuItem.getIcon().clearColorFilter();
        }
        if (ARServicesAccount.getInstance().isSignedIn() && d.getInstance().isSharedCloudAccessible()) {
            new com.adobe.libs.services.g.a(new b() {
                @Override
                public void success() {
                    ARMobileLinkUIManager mobileLinkUIManager = ARSplitPaneActivity.this.getMobileLinkUIManager();
                    if (mobileLinkUIManager != null) {
                        mobileLinkUIManager.checkAndShowMobileLinkUI();
                    }
                }
            }).taskExecute(new Void[0]);
        }
        if (ARViewerActivity.sViewerLaunchedFromOthers) {
            finish();
            ARViewerActivity.sViewerLaunchedFromOthers = false;
        }
        com.adobe.libs.e.b eMMName = AREMMManager.getInstance().getEMMName();
        AREMMManager.getInstance().checkAppRestrictions(getApplicationContext(), eMMName, true);
        AREMMManager.getInstance().registerRestrictionChangedReceiver(getApplicationContext(), eMMName, null);
        AREMMManager.getInstance().showEMMDialog(this);
    }

    @Override
    public void onSaveInstanceStateRAW(Bundle bundle) {
        super.onSaveInstanceStateRAW(bundle);
        bundle.clear();
    }

    @Override
    public void onStart() {
        super.onStart();
        this.mIsActivityInBackground = false;
    }

    @Override
    public void onStop() {
        this.mIsActivityInBackground = true;
        super.onStop();
    }

    public void removeConnectorTab(int i) {
        this.mTabsFragment.removeTab(i);
        this.mConnectorsLocationIDList.remove(Integer.valueOf(i));
        this.mTabsFragment.notifyDataSetChanged();
    }

    @Override
    public boolean shouldShowMobileLinkUI() {
        return ((this.mCurrentTabLocationId != 1 && this.mCurrentTabLocationId != 2 && (this.mCurrentTabLocationId != 3 || !ARServicesAccount.getInstance().isSignedIn())) || isInContextualMode() || isSearchActivated()) ? false : true;
    }

    public void showContextualActionBar(boolean z) {
        if (!z) {
            if (this.mMode != null) {
                this.mMode.finish();
                return;
            }
            return;
        }
        if (this.mMode != null) {
            FWAbstractTabFragment currentTabFragment = getCurrentTabFragment();
            if (currentTabFragment != null) {
                currentTabFragment.refreshListSelectionState();
                return;
            }
            return;
        }
        this.mMode = startActionMode(this.mCallback);
        setFabButtonForTabs();
        lockSwitcher();
        this.mTabsFragment.hideTabStrip();
        if (!isSearchActivated()) {
            showExtendedCAB(true);
        }
        getMobileLinkUIManager().checkAndShowMobileLinkUI();
        getMobileLinkUIManager().checkAndShowMobileLinkUI();
        FWAbstractTabFragment currentTabFragment2 = getCurrentTabFragment();
        if (currentTabFragment2 != null) {
            currentTabFragment2.enterContextualMode();
        }
    }

    public void updateContextActionBarItems() {
        ARFileEntryAdapter currentFileEntryAdapter;
        if (this.mContextBarMenu == null || (currentFileEntryAdapter = getCurrentFileEntryAdapter()) == null) {
            return;
        }
        List<ARFileEntry> checkedFileEntrylist = currentFileEntryAdapter.getCheckedFileEntrylist();
        List<ARFileEntry> checkedDirectoryEntrylist = currentFileEntryAdapter.getCheckedDirectoryEntrylist();
        int size = checkedFileEntrylist.size();
        int size2 = checkedDirectoryEntrylist.size();
        int i = size + size2;
        if (isExtendedCABVisible()) {
            if (size2 > 0) {
                this.mExtendedCAB.setText(getString(i > 1 ? R.string.IDS_EXTENDED_CAB_MULTIPLE_ITEM_TITLE_STR : R.string.IDS_EXTENDED_CAB_SINGLE_ITEM_TITLE_STR, new Object[]{Integer.valueOf(i)}));
            } else {
                this.mExtendedCAB.setText(getString(i > 1 ? R.string.IDS_FILE_BROWSER_MULTIPLE_FILES_SELECTED : R.string.IDS_FILE_BROWSER_SINGLE_FILE_SELECTED).replace("$NUM_FILES$", String.valueOf(i)));
            }
        } else if (this.mMode != null) {
            this.mMode.setTitle(new StringBuilder().append(i).toString());
        }
        getCurrentTabFragment().updateContextActionBarItems(this.mContextBarMenu);
    }
}