android.app.ProgressDialog#requestWindowFeature ( )源码实例Demo

下面列出了android.app.ProgressDialog#requestWindowFeature ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: blade-player   文件: LoginDialog.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mResultDelivered = false;

    mProgressDialog = new ProgressDialog(getContext());
    mProgressDialog.setMessage(getContext().getString(R.string.com_spotify_sdk_login_progress));
    mProgressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mProgressDialog.setOnCancelListener(new OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialogInterface) {
            dismiss();
        }
    });

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    getWindow().setBackgroundDrawableResource(android.R.drawable.screen_background_dark_transparent);

    setContentView(R.layout.com_spotify_sdk_login_dialog);

    setLayoutSize();

    createWebView(mUri);
}
 
@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)));
  CookieSyncManager.createInstance(getContext());
  CookieManager cookieManager = CookieManager.getInstance();
  cookieManager.removeAllCookie();
}
 
源代码3 项目: android-auth   文件: LoginDialog.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mResultDelivered = false;

    mProgressDialog = new ProgressDialog(getContext());
    mProgressDialog.setMessage(getContext().getString(R.string.com_spotify_sdk_login_progress));
    mProgressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mProgressDialog.setOnCancelListener(new OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialogInterface) {
            dismiss();
        }
    });

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    getWindow().setBackgroundDrawableResource(android.R.drawable.screen_background_dark_transparent);

    setContentView(R.layout.com_spotify_sdk_login_dialog);

    setLayoutSize();

    createWebView(mUri);
}
 
源代码4 项目: geopaparazzi   文件: StringAsyncTask.java
@Override
protected void onPreExecute() {
    if (doProgress) {
        progressDialog = new ProgressDialog(context);
        if (title == null) {
            progressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        } else {
            progressDialog.setTitle(title);
        }
        progressDialog.setMessage(message);
        progressDialog.setCancelable(cancelable);
        if (max == null) {
            progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
            progressDialog.setIndeterminate(true);
        } else {
            progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
            progressDialog.setIndeterminate(false);
            progressDialog.setProgress(0);
            progressDialog.setMax(max);
        }
        progressDialog.show();
    }
}
 
源代码5 项目: dcs-sdk-java   文件: BaiduDialog.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // 设置ProgressDialog的样式
    mSpinner = new ProgressDialog(getContext());
    mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mSpinner.setMessage("登录中...");
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    mContent = new FrameLayout(getContext());
    setUpWebView();
    addContentView(mContent, MATCH);
}
 
源代码6 项目: smart-farmer-android   文件: CameraActivity.java
private ProgressDialog showProgressDialog() {
    final ProgressDialog dialog = new ProgressDialog(this);
    dialog.setMessage("准备中...");
    dialog.setIndeterminate(true);
    dialog.setCancelable(false);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.show();
    return dialog;
}
 
源代码7 项目: okhttp-OkGo   文件: DialogCallback.java
private void initDialog(Activity activity) {
    dialog = new ProgressDialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    dialog.setMessage("请求网络中...");
}
 
源代码8 项目: okhttp-OkGo   文件: BitmapDialogCallback.java
public BitmapDialogCallback(Activity activity) {
    super(1000, 1000);
    dialog = new ProgressDialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    dialog.setMessage("请求网络中...");
}
 
源代码9 项目: okhttp-OkGo   文件: StringDialogCallback.java
public StringDialogCallback(Activity activity) {
    dialog = new ProgressDialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    dialog.setMessage("请求网络中...");
}
 
源代码10 项目: drupalfit   文件: WebDialog.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Log8.d();
    spinner = new ProgressDialog(getContext());
    spinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
    spinner.setOnCancelListener(new OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialogInterface) {
            Log8.d();
            WebDialog.this.dismiss();
        }
    });
    Log8.d();

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

    // First calculate how big the frame layout should be
    getWindow().setGravity(Gravity.CENTER);
    Log8.d();

    // resize the dialog if the soft keyboard comes up
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    Log8.d();
    setUpWebView(500);
    Log8.d();
    setContentView(contentFrameLayout);
    Log8.d();
}
 
源代码11 项目: Klyph   文件: FbDialog.java
@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));
}
 
源代码12 项目: socialauth-android   文件: CustomUI.java
@Override
public void onComplete(Bundle values) {

	Log.d("Custom-UI", "Successful");

	// Changing Sign In Text to Sign Out
	View v = listview.getChildAt(pos - listview.getFirstVisiblePosition());
	TextView pText = (TextView) v.findViewById(R.id.signstatus);
	pText.setText("Sign Out");

	// Get the provider
	providerName = values.getString(SocialAuthAdapter.PROVIDER);
	Log.d("Custom-UI", "providername = " + providerName);

	Toast.makeText(CustomUI.this, providerName + " connected", Toast.LENGTH_SHORT).show();

	int res = getResources().getIdentifier(providerName + "_array", "array", CustomUI.this.getPackageName());

	AlertDialog.Builder builder = new AlertDialog.Builder(CustomUI.this);
	builder.setTitle("Select Options");
	builder.setCancelable(true);
	builder.setIcon(android.R.drawable.ic_menu_more);

	mDialog = new ProgressDialog(CustomUI.this);
	mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
	mDialog.setMessage("Loading...");

	builder.setSingleChoiceItems(new DialogAdapter(CustomUI.this, R.layout.provider_options, getResources()
			.getStringArray(res)), 0, new DialogInterface.OnClickListener() {
		@Override
		public void onClick(DialogInterface dialog, int item) {

			Events(item, providerName);
			dialog.dismiss();
		}
	});
	dialog = builder.create();
	dialog.show();

}
 
源代码13 项目: kognitivo   文件: WebDialog.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    spinner = new ProgressDialog(getContext());
    spinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
    spinner.setMessage(getContext().getString(R.string.com_facebook_loading));
    spinner.setOnCancelListener(new OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialogInterface) {
            cancel();
        }
    });

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

    // First calculate how big the frame layout should be
    resize();
    getWindow().setGravity(Gravity.CENTER);

    // resize the dialog if the soft keyboard comes up
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

    /* Create the 'x' image, but don't add to the contentFrameLayout 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 webview and add it the contentFrameLayout layout
     */
    int crossWidth = crossImageView.getDrawable().getIntrinsicWidth();

    setUpWebView(crossWidth / 2 + 1);

    /* Finally add the 'x' image to the contentFrameLayout layout and
    * add contentFrameLayout to the Dialog view
    */
    contentFrameLayout.addView(crossImageView, new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));

    setContentView(contentFrameLayout);
}
 
源代码14 项目: MiBandDecompiled   文件: WeiboDialog.java
private void initLoadingDlg()
{
    mLoadingDlg = new ProgressDialog(getContext());
    mLoadingDlg.requestWindowFeature(1);
    mLoadingDlg.setMessage(ResourceManager.getString(mContext, 1));
}
 
源代码15 项目: NewAndroidTwitter   文件: TwitterDialog.java
@SuppressWarnings("deprecation")
@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();
	Point outSize		= new Point();
	
	int width			= 0;
	int height			= 0;
	
	double[] dimensions = new double[2];
	        
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
		display.getSize(outSize);
		
		width	= outSize.x;
		height	= outSize.y;
	} else {
		width	= display.getWidth();
		height	= display.getHeight();
	}
	
	if (width < height) {
		dimensions[0]	= 0.87 * width;
        dimensions[1]	= 0.82 * height;
	} else {
		dimensions[0]	= 0.75 * width;
		dimensions[1]	= 0.75 * height;	        
	}
       
       addContentView(mContent, new FrameLayout.LayoutParams((int) dimensions[0], (int) dimensions[1]));
   }
 
源代码16 项目: AndroidInstagram   文件: InstagramDialog.java
@SuppressWarnings("deprecation")
@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();
	Point outSize		= new Point();
	
	int width			= 0;
	int height			= 0;
	
	double[] dimensions = new double[2];
	        
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
		display.getSize(outSize);
		
		width	= outSize.x;
		height	= outSize.y;
	} else {
		width	= display.getWidth();
		height	= display.getHeight();
	}
	
	if (width < height) {
		dimensions[0]	= 0.87 * width;
        dimensions[1]	= 0.82 * height;
	} else {
		dimensions[0]	= 0.75 * width;
		dimensions[1]	= 0.75 * height;	        
	}
        
	addContentView(mContent, new FrameLayout.LayoutParams((int) dimensions[0], (int) dimensions[1]));
}
 
源代码17 项目: socialauth-android   文件: SocialAuthDialog.java
@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 DialogInterface.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;
		}
	});
}