导航菜单

页面标题

页面副标题

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

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

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


package com.adobe.reader.fillandsign;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
import com.adobe.reader.R;
import com.adobe.reader.analytics.ARDCMAnalytics;
import com.adobe.reader.framework.ui.FWSwitchToDefaultToolHandler;
import com.adobe.reader.ui.ARBaseToolFragment;

public class ARFillAndSignFragment extends ARBaseToolFragment {
    private static final String FILL_AND_SIGN_PLAYSTORE_URL = "market://details?id=com.adobe.fas&referrer=utm_source%3DAdobe%2520Acrobat%2520Android";
    private static final String FILL_AND_SIGN_URL = "file:///android_res/raw/fillsign.html";
    private FWSwitchToDefaultToolHandler mSwitchToolHandler;

    public ARFillAndSignFragment(FWSwitchToDefaultToolHandler fWSwitchToDefaultToolHandler) {
        this.mSwitchToolHandler = fWSwitchToDefaultToolHandler;
    }

    @Override
    protected boolean isTopLevelFragment() {
        return true;
    }

    @Override
    public View onCreateViewRAW(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View inflate = layoutInflater.inflate(R.layout.fill_and_sign_fragment, viewGroup, false);
        WebView webView = (WebView) inflate.findViewById(R.id.fillAndSignWebView);
        webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView webView2, String str) {
                if (!str.contains("fasplaystore")) {
                    return false;
                }
                ARDCMAnalytics.getInstance().trackAction(ARDCMAnalytics.MARKETING_PAGE_INSTALL_BUTTON_TAPPED, ARDCMAnalytics.FILL_AND_SIGN, (String) null);
                Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(ARFillAndSignFragment.FILL_AND_SIGN_PLAYSTORE_URL));
                if (intent.resolveActivity(ARFillAndSignFragment.this.getActivity().getPackageManager()) != null) {
                    ARFillAndSignFragment.this.startActivity(intent);
                } else {
                    Toast.makeText(ARFillAndSignFragment.this.getActivity(), ARFillAndSignFragment.this.getActivity().getString(2131230746), 0).show();
                }
                ARFillAndSignFragment.this.mSwitchToolHandler.switchToDefaultTool(true);
                return true;
            }
        });
        webView.getSettings().setJavaScriptEnabled(true);
        webView.loadUrl(FILL_AND_SIGN_URL);
        return inflate;
    }
}