im.delight.android.webview.AdvancedWebView Java Examples

The following examples show how to use im.delight.android.webview.AdvancedWebView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainActivity.java    From APKMirror with GNU General Public License v2.0 5 votes vote down vote up
private void download(String url, String name) {

        if (!sharedPreferences.getBoolean("external_download", false)) {
            if (AdvancedWebView.handleDownload(this, url, name)) {
                Toast.makeText(MainActivity.this, getString(R.string.download_started), Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(MainActivity.this, getString(R.string.cant_download), Toast.LENGTH_SHORT).show();
            }
        } else {
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
        }


    }
 
Example #2
Source File: OAuthManagerFragmentController.java    From react-native-oauth with MIT License 5 votes vote down vote up
public OAuthTokenTask(
  OAuthManagerFragmentController ctrl,
  AdvancedWebView webView
) {
  this.mCtrl = ctrl;
  this.mWebView = webView;
}
 
Example #3
Source File: OAuthManagerFragmentController.java    From react-native-oauth with MIT License 5 votes vote down vote up
public Load1AccessTokenTask(
  OAuthManagerFragmentController ctrl, 
  AdvancedWebView view,
  OAuth1RequestToken requestToken,
  String oauthVerifier
) {
  super(ctrl, view);
  this.oauthVerifier = oauthVerifier;
}
 
Example #4
Source File: OAuthManagerFragmentController.java    From react-native-oauth with MIT License 5 votes vote down vote up
public Load2AccessTokenTask(
  OAuthManagerFragmentController ctrl, 
  AdvancedWebView view,
  String authorizationCode
) {
  super(ctrl, view);
  this.authorizationCode = authorizationCode;
}
 
Example #5
Source File: OAuthManagerFragmentController.java    From react-native-oauth with MIT License 4 votes vote down vote up
public void getRequestTokenUrlAndLoad(AdvancedWebView webView) {
  mWebView = webView;
  LoadRequestTokenTask task = new LoadRequestTokenTask(this, webView);
  task.execute();
}
 
Example #6
Source File: OAuthManagerFragmentController.java    From react-native-oauth with MIT License 4 votes vote down vote up
public LoadRequestTokenTask(
  OAuthManagerFragmentController ctrl, 
  AdvancedWebView view
) {
  super(ctrl, view);
}
 
Example #7
Source File: OAuthManagerDialogFragment.java    From react-native-oauth with MIT License 4 votes vote down vote up
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        final Context context = mReactContext;
        LayoutParams rootViewLayoutParams = this.getFullscreenLayoutParams(context);

        RelativeLayout rootView = new RelativeLayout(context);

        mProgressBar = new ProgressBar(context);
        RelativeLayout.LayoutParams progressParams = new RelativeLayout.LayoutParams(convertDpToPixel(50f,context),convertDpToPixel(50f,context));
        progressParams.addRule(RelativeLayout.CENTER_IN_PARENT);
        mProgressBar.setLayoutParams(progressParams);
        mProgressBar.setIndeterminate(true);

        getDialog().setCanceledOnTouchOutside(true);
        rootView.setLayoutParams(rootViewLayoutParams);

        // mWebView = (AdvancedWebView) rootView.findViewById(R.id.webview);
        Log.d(TAG, "Creating webview");
        mWebView = new AdvancedWebView(context);
//        mWebView.setId(WEBVIEW_TAG);
        mWebView.setListener(this, this);
        mWebView.setVisibility(View.VISIBLE);
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.getSettings().setDomStorageEnabled(true);


        LayoutParams layoutParams = this.getFullscreenLayoutParams(context);
        //new LayoutParams(
        //   LayoutParams.FILL_PARENT,
        //   DIALOG_HEIGHT
        // );
        // mWebView.setLayoutParams(layoutParams);

        rootView.addView(mWebView, layoutParams);
        rootView.addView(mProgressBar,progressParams);

        // LinearLayout pframe = new LinearLayout(context);
        // pframe.setId(WIDGET_TAG);
        // pframe.setOrientation(LinearLayout.VERTICAL);
        // pframe.setVisibility(View.GONE);
        // pframe.setGravity(Gravity.CENTER);
        // pframe.setLayoutParams(layoutParams);

        // rootView.addView(pframe, layoutParams);

        this.setupWebView(mWebView);
        mController.getRequestTokenUrlAndLoad(mWebView);

        Log.d(TAG, "Loading view...");
        return rootView;
    }