@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mSpinner = new ProgressDialog(getContext());

    mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mSpinner.setMessage("Loading...");

    mContent = new LinearLayout(getContext());

    mContent.setOrientation(LinearLayout.VERTICAL);

    setUpTitle();
    setUpWebView();

    Display display = getWindow().getWindowManager().getDefaultDisplay();
    final float scale = getContext().getResources().getDisplayMetrics().density;
    float[] dimensions =
        (display.getWidth() < display.getHeight()) ? DIMENSIONS_PORTRAIT : DIMENSIONS_LANDSCAPE;

    addContentView(
        mContent,
        new FrameLayout.LayoutParams(
            (int) (dimensions[0] * scale + 0.5f), (int) (dimensions[1] * scale + 0.5f)));
  }
示例#2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mSpinner = new ProgressDialog(getContext());
    mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mSpinner.setMessage("Loading...");

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    mContent = new FrameLayout(getContext());

    /* Create the 'x' image, but don't add to the mContent layout yet
     * at this point, we only need to know its drawable width and height
     * to place the webview
     */
    createCrossImage();

    /* Now we know 'x' drawable width and height,
     * layout the webivew and add it the mContent layout
     */
    int crossWidth = mCrossImage.getDrawable().getIntrinsicWidth();
    setUpWebView(crossWidth / 2);

    /* Finally add the 'x' image to the mContent layout and
     * add mContent to the Dialog view
     */
    mContent.addView(
        mCrossImage, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    addContentView(mContent, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
  }
示例#3
0
 /**
  * Instantiates a new calendar web view client.
  *
  * @param calendarLogin the calendar login
  * @param webView
  */
 public TasksWebViewClient(final TasksLogin calendarLogin, final WebView webView) {
   super();
   this.mTasksLogin = calendarLogin;
   mSpinner = new ProgressDialog(webView.getContext());
   mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
   mSpinner.setMessage("Loading...");
 }
  /**
   * Shows a simple native progress dialog<br>
   * Subclass can override below two methods for custom dialogs- <br>
   * 1. showProgressDialog <br>
   * 2. removeProgressDialog
   *
   * @param bodyText
   */
  public void showProgressDialog(String bodyText) {
    if (isFinishing()) {
      return;
    }
    if (mProgressDialog == null) {
      mProgressDialog = new ProgressDialog(BaseActivity.this);
      mProgressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
      mProgressDialog.setCancelable(false);
      mProgressDialog.setOnKeyListener(
          new Dialog.OnKeyListener() {
            @Override
            public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
              if (keyCode == KeyEvent.KEYCODE_CAMERA || keyCode == KeyEvent.KEYCODE_SEARCH) {
                return true; //
              }
              return false;
            }
          });
    }

    mProgressDialog.setMessage(bodyText);
    if (!mProgressDialog.isShowing()) {
      mProgressDialog.show();
    }
  }
 @Override
 protected void onPreExecute() {
   Home.homeMainLayout.setVisibility(View.GONE);
   Dialog = new ProgressDialog(this.ContextDialog);
   Dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
   Dialog.setMessage("Yükleniyor...");
   Dialog.setCancelable(false);
   Dialog.show();
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    handler = new Handler();
    Util.getDisplayDpi(getContext());

    mSpinner = new ProgressDialog(getContext());
    mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mSpinner.setMessage("Loading...");
    mSpinner.setCancelable(true);

    mContent = new LinearLayout(getContext());
    mContent.setOrientation(LinearLayout.VERTICAL);
    setUpTitle();
    setUpWebView();

    Display display = getWindow().getWindowManager().getDefaultDisplay();
    final float scale = getContext().getResources().getDisplayMetrics().density;
    int orientation = getContext().getResources().getConfiguration().orientation;
    float[] dimensions =
        (orientation == Configuration.ORIENTATION_LANDSCAPE)
            ? DIMENSIONS_DIFF_LANDSCAPE
            : DIMENSIONS_DIFF_PORTRAIT;

    addContentView(
        mContent,
        new LinearLayout.LayoutParams(
            display.getWidth() - ((int) (dimensions[0] * scale + 0.5f)),
            display.getHeight() - ((int) (dimensions[1] * scale + 0.5f))));

    mSpinner.setOnCancelListener(
        new OnCancelListener() {
          @Override
          public void onCancel(DialogInterface dialogInterface) {
            mWebView.stopLoading();
            mListener.onBack();
            SocialAuthDialog.this.dismiss();
          }
        });

    this.setOnKeyListener(
        new OnKeyListener() {
          @Override
          public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
              mWebView.stopLoading();
              dismiss();
              mListener.onBack();
              return true;
            }
            return false;
          }
        });
  }
示例#7
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    spinner = new ProgressDialog(getContext());
    spinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
    spinner.setMessage("Loading...");

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    content = new FrameLayout(getContext());
    setUpWebView(10);
    addContentView(content, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
  }
 public void showLoadingDialog() {
   try {
     if (progressDialog == null || !progressDialog.isShowing()) {
       progressDialog = new ProgressDialog(getActivity());
       progressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
       progressDialog.setMessage("Loading...");
       // progressDialog.setCancelable(false);
       progressDialog.setCanceledOnTouchOutside(false);
       progressDialog.show();
     }
   } catch (Exception ex) {
   }
 }
 public TwitterConnector(
     Activity activity,
     String consumerKey,
     String consumerSecret,
     String callbackUrl,
     TwitterLoginDelegate delegate) {
   mActivity = activity;
   mConsumerKey = consumerKey;
   mConsumerSecret = consumerSecret;
   mCallbackUrl = callbackUrl;
   mDelegate = delegate;
   mProgressDialog = new ProgressDialog(activity);
   mProgressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
 }
 protected void onCreate(Bundle paramBundle)
 {
   super.onCreate(paramBundle);
   spinner = new ProgressDialog(getContext());
   spinner.requestWindowFeature(1);
   spinner.setMessage(getContext().getString(R.string.com_facebook_loading));
   spinner.setOnCancelListener(new WebDialog.1(this));
   requestWindowFeature(1);
   contentFrameLayout = new FrameLayout(getContext());
   calculateSize();
   getWindow().setGravity(17);
   getWindow().setSoftInputMode(16);
   createCrossImage();
   setUpWebView(crossImageView.getDrawable().getIntrinsicWidth() / 2 + 1);
   contentFrameLayout.addView(crossImageView, new ViewGroup.LayoutParams(-2, -2));
   setContentView(contentFrameLayout);
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.webview);
   dialogListener = this;
   weibo = Weibo.getInstance();
   weibo.setupConsumerConfig(CONSUMER_KEY, CONSUMER_SECRET);
   weibo.setRedirectUrl(MREDIRECTURL);
   Utility.setAuthorization(new Oauth2AccessTokenHeader());
   webView = (WebView) this.findViewById(R.id.wv_id);
   webView.setHorizontalScrollBarEnabled(false);
   webView.setVerticalScrollBarEnabled(false);
   webView.getSettings().setJavaScriptEnabled(true);
   webView.setWebViewClient(new MyWebViewClient());
   webView.loadUrl(getOauthUrl());
   pd = new ProgressDialog(this);
   pd.requestWindowFeature(Window.FEATURE_NO_TITLE);
   pd.setMessage("正在载入...");
 }
示例#12
0
  public TwitterApp(Context context, String consumerKey, String secretKey) {
    this.context = context;
    this.consumerKey = consumerKey;
    this.secretKey = secretKey;

    twitter = new TwitterFactory().getInstance();
    session = new TwitterSession(context);
    progressDialog = new ProgressDialog(context);
    progressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

    httpOauthConsumer = new CommonsHttpOAuthConsumer(consumerKey, secretKey);

    String request_url = TWITTER_REQUEST_URL;
    String access_token_url = TWITTER_ACCESS_TOKEN_URL;
    String authorize_url = TWITTER_AUTHORZE_URL;

    httpOauthprovider = new DefaultOAuthProvider(request_url, access_token_url, authorize_url);
    accessToken = session.getAccessToken();

    configureToken();
  }
示例#13
0
  @SuppressWarnings("deprecation")
  @SuppressLint("SetJavaScriptEnabled")
  @Override
  /** When the dialog is created, we add the webview and load the authorize url. */
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);

    mProgress = new ProgressDialog(getContext());
    mProgress.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mProgress.setMessage("Loading...");

    mLayout = new LinearLayout(getContext());
    mLayout.setOrientation(LinearLayout.VERTICAL);

    mWebView = new WebView(getContext());
    mWebView.setVerticalScrollBarEnabled(false);
    mWebView.setHorizontalScrollBarEnabled(false);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setSupportZoom(false);
    mWebView.setLayoutParams(MATCH);

    mWebView.setWebViewClient(new OAuthWebViewClient());
    mWebView.setWebChromeClient(new WebChromeClient());

    mWebView.loadUrl(mUrl);
    mLayout.addView(mWebView);

    Display display = getWindow().getWindowManager().getDefaultDisplay();
    addContentView(
        mLayout, new FrameLayout.LayoutParams(display.getWidth() - 20, display.getHeight() - 20));
    CookieSyncManager.createInstance(getContext());
    CookieManager cookieManager = CookieManager.getInstance();
    cookieManager.removeAllCookie();
  }