导航菜单

页面标题

页面副标题

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

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

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


package com.adobe.reader.help;

import android.annotation.TargetApi;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.view.ViewCompat;
import android.view.accessibility.AccessibilityManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.adobe.libs.c.a.a;
import com.adobe.reader.R;
import com.adobe.reader.misc.ARApp;
import com.adobe.reader.viewer.ARSplitPaneActivity;
import com.adobe.reader.viewer.ARViewerActivity;

public class AROnboardingHelpActivity extends a {
    private static final String ONBOARDING_URL = "file:///android_res/raw/index.html";
    public static final int RESULT_CUSTOM_BACK_PRESSED = 10;
    BroadcastReceiver broadcastReceiver_finishActivity = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            AROnboardingHelpActivity.this.finish();
        }
    };
    private WebView mOnBoardingWebView;
    private Object mTouchExplorationStateChangeListener;

    private void initComponents() {
        this.mOnBoardingWebView = (WebView) findViewById(R.id.onBoardingWebView);
        this.mOnBoardingWebView.setBackgroundColor(ViewCompat.MEASURED_STATE_MASK);
        this.mOnBoardingWebView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView webView, String str) {
                if (!str.contains("continue")) {
                    return false;
                }
                AROnboardingHelpActivity.this.onBoardingExperienceCompleted();
                AROnboardingHelpActivity.this.finish();
                AROnboardingHelpActivity.this.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
                return true;
            }
        });
        this.mOnBoardingWebView.getSettings().setJavaScriptEnabled(true);
        this.mOnBoardingWebView.loadUrl(ONBOARDING_URL);
    }

    public void onBoardingExperienceCompleted() {
        startActivity(new Intent(this, (Class<?>) ARSplitPaneActivity.class));
        ARApp.setWhatsNewDisplayed(true);
    }

    @TargetApi(19)
    private void registerTouchExplorationStateChangedListener() {
        if (Build.VERSION.SDK_INT >= 19) {
            if (this.mTouchExplorationStateChangeListener == null) {
                this.mTouchExplorationStateChangeListener = new AccessibilityManager.TouchExplorationStateChangeListener() {
                    @Override
                    public void onTouchExplorationStateChanged(boolean z) {
                        if (z) {
                            AROnboardingHelpActivity.this.onBoardingExperienceCompleted();
                        }
                    }
                };
            }
            ((AccessibilityManager) getSystemService("accessibility")).addTouchExplorationStateChangeListener((AccessibilityManager.TouchExplorationStateChangeListener) this.mTouchExplorationStateChangeListener);
        }
    }

    @TargetApi(19)
    private void unregisterTouchExplorationStateChangedListener() {
        if (Build.VERSION.SDK_INT < 19 || this.mTouchExplorationStateChangeListener == null) {
            return;
        }
        ((AccessibilityManager) getSystemService("accessibility")).removeTouchExplorationStateChangeListener((AccessibilityManager.TouchExplorationStateChangeListener) this.mTouchExplorationStateChangeListener);
    }

    @Override
    public void onBackPressed() {
        setResult(10);
        super.onBackPressed();
    }

    @Override
    public void onCreateRAW(Bundle bundle) {
        super.onCreateRAW(bundle);
        setContentView(R.layout.onboarding);
        LocalBroadcastManager.getInstance(this).registerReceiver(this.broadcastReceiver_finishActivity, new IntentFilter(ARSplitPaneActivity.BROADCAST_SPLIT_PANE_LAUNCHED));
        LocalBroadcastManager.getInstance(this).registerReceiver(this.broadcastReceiver_finishActivity, new IntentFilter(ARViewerActivity.BROADCAST_NEW_PDF_OPENED));
        initComponents();
    }

    @Override
    public void onDestroyRAW() {
        LocalBroadcastManager.getInstance(this).unregisterReceiver(this.broadcastReceiver_finishActivity);
        super.onDestroyRAW();
    }

    @Override
    public void onPauseRAW() {
        unregisterTouchExplorationStateChangedListener();
        super.onPauseRAW();
    }

    @Override
    public void onResumeRAW() {
        super.onResumeRAW();
        registerTouchExplorationStateChangedListener();
        AccessibilityManager accessibilityManager = (AccessibilityManager) getSystemService("accessibility");
        if (accessibilityManager.isEnabled() && accessibilityManager.isTouchExplorationEnabled()) {
            onBoardingExperienceCompleted();
        }
    }
}