当前位置: 首页>>代码示例>>Java>>正文


Java ProgressBar.setLayoutParams方法代码示例

本文整理汇总了Java中android.widget.ProgressBar.setLayoutParams方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressBar.setLayoutParams方法的具体用法?Java ProgressBar.setLayoutParams怎么用?Java ProgressBar.setLayoutParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ProgressBar的用法示例。


在下文中一共展示了ProgressBar.setLayoutParams方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import android.widget.ProgressBar; //导入方法依赖的package包/类
public static LinearLayout create(Context context) {
	LinearLayout root = new LinearLayout(context);
	ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
			ViewGroup.LayoutParams.WRAP_CONTENT);
	root.setLayoutParams(params);
	root.setOrientation(LinearLayout.VERTICAL);

	ProgressBar bar = new ProgressBar(context);
	LinearLayout.LayoutParams barParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
			LinearLayout.LayoutParams.WRAP_CONTENT);
	bar.setLayoutParams(barParams);
	SizeHelper.prepare(context);
	int padding = SizeHelper.fromPxWidth(20);
	bar.setPadding(padding, padding, padding, padding);

	root.addView(bar);

	return root;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:ProgressDialogLayout.java

示例2: onPreExecute

import android.widget.ProgressBar; //导入方法依赖的package包/类
protected void onPreExecute() {
	super.onPreExecute();

	// Replace the ListView with a ProgressBar
	mProgBar = new ProgressBar(EDFileChooserActivity.this, null,
			android.R.attr.progressBarStyleLarge);

	// Set the layout to fill the screen
	mListView = EDFileChooserActivity.this.getListView();
	mLayout = (LinearLayout) mListView.getParent();
	mLayout.setGravity(Gravity.CENTER);
	mLayout.setLayoutParams(new FrameLayout.LayoutParams(
			LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

	// Set the ProgressBar in the center of the layout
	LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
			LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	layoutParams.gravity = Gravity.CENTER;
	mProgBar.setLayoutParams(layoutParams);

	// Replace the ListView with the ProgressBar
	mLayout.removeView(mListView);
	mLayout.addView(mProgBar);
	mProgBar.setVisibility(View.VISIBLE);
}
 
开发者ID:starn,项目名称:encdroidMC,代码行数:26,代码来源:EDFileChooserActivity.java

示例3: getView

import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
public View getView() {
    FrameLayout root = new FrameLayout(mContext);
    root.setBackgroundColor(Color.WHITE);

    mWebView = new WebView(mContext);//mContext.getApplicationContext();
    FrameLayout.LayoutParams wvLayoutParams =
            new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
                    FrameLayout.LayoutParams.MATCH_PARENT);
    wvLayoutParams.gravity = Gravity.CENTER;
    mWebView.setLayoutParams(wvLayoutParams);
    root.addView(mWebView);
    initWebView(mWebView);

    mProgressBar = new ProgressBar(mContext);
    showProgressBar(false);
    FrameLayout.LayoutParams pLayoutParams =
            new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,
                    FrameLayout.LayoutParams.WRAP_CONTENT);
    mProgressBar.setLayoutParams(pLayoutParams);
    pLayoutParams.gravity = Gravity.CENTER;
    root.addView(mProgressBar);
    return root;
}
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:25,代码来源:WXWebView.java

示例4: getVideoLoadingProgressView

import android.widget.ProgressBar; //导入方法依赖的package包/类
/**
 * Ask the host application for a custom progress view to show while
 * a <video> is loading.
 * @return View The progress view.
 */
public View getVideoLoadingProgressView() {

    if (mVideoProgressView == null) {
        // Create a new Loading view programmatically.

        // create the linear layout
        LinearLayout layout = new LinearLayout(parentEngine.getView().getContext());
        layout.setOrientation(LinearLayout.VERTICAL);
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
        layout.setLayoutParams(layoutParams);
        // the proress bar
        ProgressBar bar = new ProgressBar(parentEngine.getView().getContext());
        LinearLayout.LayoutParams barLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        barLayoutParams.gravity = Gravity.CENTER;
        bar.setLayoutParams(barLayoutParams);
        layout.addView(bar);

        mVideoProgressView = layout;
    }
return mVideoProgressView;
}
 
开发者ID:runner525,项目名称:x5webview-cordova-plugin,代码行数:28,代码来源:X5WebChromeClient.java

示例5: onCreateView

import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
						 Bundle savedInstanceState) {
	ProgressBar progressBar = new ProgressBar(container.getContext());
	if (container instanceof FrameLayout) {
		Resources res = getResources();
		int width = res.getDimensionPixelSize(R.dimen.spinner_width);
		int height = res.getDimensionPixelSize(R.dimen.spinner_height);
		FrameLayout.LayoutParams layoutParams =
				new FrameLayout.LayoutParams(width, height, Gravity.CENTER);
		progressBar.setLayoutParams(layoutParams);
	}
	return progressBar;
}
 
开发者ID:NiciDieNase,项目名称:chaosflix,代码行数:15,代码来源:BrowseErrorFragment.java

示例6: onCreate

import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    LinearLayout linearLayout = new LinearLayout(getContext());
    ProgressBar progressBar = new ProgressBar(getContext());

    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(125,
            125);
    params.setMargins(100, 20, 100, 20);
    progressBar.setLayoutParams(params);
    linearLayout.addView(progressBar);

    setContentView(linearLayout);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:RLoadingDialog.java

示例7: layoutDesign

import android.widget.ProgressBar; //导入方法依赖的package包/类
@SuppressLint("InlinedApi")
private void layoutDesign() {
	setOrientation(LinearLayout.VERTICAL);
	FrameLayout.LayoutParams lParams0 = new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,
			LayoutParams.WRAP_CONTENT);
	setLayoutParams(lParams0);
	setBackgroundColor(Color.TRANSPARENT);

	ProgressBar progressBar = new ProgressBar(mContext);
	progressBar.setBackgroundColor(Color.TRANSPARENT);
	LayoutParams lParams1 = new LayoutParams(LayoutParams.WRAP_CONTENT,
			LayoutParams.WRAP_CONTENT);
	lParams1.gravity = Gravity.CENTER;
	progressBar.setLayoutParams(lParams1);
	addView(progressBar);
	TextView textView = new TextView(mContext);
	textView.setText(mMessage);
	LayoutParams lParams2 = new LayoutParams(LayoutParams.MATCH_PARENT,
			LayoutParams.WRAP_CONTENT);
	lParams2.gravity = Gravity.CENTER;
	lParams2.width = mScreenWidth;
	textView.setGravity(Gravity.CENTER);
	textView.setLayoutParams(lParams2);
	textView.setBackgroundColor(Color.TRANSPARENT);
	textView.setPadding(mMessagePadding, mMessagePadding, mMessagePadding, mMessagePadding);
	textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mTextSize);
	textView.setTextColor(0xffe5e5e5);
	addView(textView);
}
 
开发者ID:Tamicer,项目名称:FastDownloader,代码行数:30,代码来源:WaitingDialog.java

示例8: onCreateView

import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    ProgressBar progressBar = new ProgressBar(container.getContext());
    if (container instanceof FrameLayout) {
        FrameLayout.LayoutParams layoutParams =
                new FrameLayout.LayoutParams(SPINNER_WIDTH, SPINNER_HEIGHT, Gravity.CENTER);
        progressBar.setLayoutParams(layoutParams);
    }
    return progressBar;
}
 
开发者ID:bassaer,项目名称:HelloTV,代码行数:12,代码来源:BrowseErrorActivity.java

示例9: onCreateView

import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    ProgressBar progressBar = new ProgressBar(container.getContext());
    if (container instanceof FrameLayout) {
        Resources res = getResources();
        int width = res.getDimensionPixelSize(R.dimen.spinner_width);
        int height = res.getDimensionPixelSize(R.dimen.spinner_height);
        FrameLayout.LayoutParams layoutParams =
                new FrameLayout.LayoutParams(width, height, Gravity.CENTER);
        progressBar.setLayoutParams(layoutParams);
    }
    return progressBar;
}
 
开发者ID:ad-on-is,项目名称:chilly,代码行数:15,代码来源:LoginFragment.java

示例10: ProgressWebView

import android.widget.ProgressBar; //导入方法依赖的package包/类
public ProgressWebView(Context context, AttributeSet attrs) {
    super(context, attrs);
    mProgressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal);
    mProgressBar.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, 8, 0, 0));

    Drawable drawable = context.getResources().getDrawable(R.drawable.progressbar_webview);
    mProgressBar.setProgressDrawable(drawable);
    addView(mProgressBar);
    setWebChromeClient(new WebChromeClient());
    //是否可以缩放
    getSettings().setSupportZoom(true);
    getSettings().setBuiltInZoomControls(true);
}
 
开发者ID:lo625090140,项目名称:lqrwechatrongcloud,代码行数:14,代码来源:ProgressWebView.java

示例11: init

import android.widget.ProgressBar; //导入方法依赖的package包/类
private void init(Context context) {
  setBackgroundColor(WXResourceUtils.getColor("#ee000000"));
  mProgressBar = new ProgressBar(context);
  FrameLayout.LayoutParams pLayoutParams =
      new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,
          FrameLayout.LayoutParams.WRAP_CONTENT);
  mProgressBar.setLayoutParams(pLayoutParams);
  pLayoutParams.gravity = Gravity.CENTER;
  addView(mProgressBar);

  getViewTreeObserver().addOnGlobalLayoutListener(this);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:13,代码来源:WXVideoView.java

示例12: getVideoLoadingProgressView

import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
/**
 * Ask the host application for a custom progress view to show while
 * a <video> is loading.
 * @return View The progress view.
 */
public View getVideoLoadingProgressView() {

    if (mVideoProgressView == null) {
        // Create a new Loading view programmatically.

        // create the linear layout
        LinearLayout layout = new LinearLayout(parentEngine.getView().getContext());
        layout.setOrientation(LinearLayout.VERTICAL);
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
        layout.setLayoutParams(layoutParams);
        // the proress bar
        ProgressBar bar = new ProgressBar(parentEngine.getView().getContext());
        LinearLayout.LayoutParams barLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        barLayoutParams.gravity = Gravity.CENTER;
        bar.setLayoutParams(barLayoutParams);
        layout.addView(bar);

        mVideoProgressView = layout;
    }
return mVideoProgressView;
}
 
开发者ID:disit,项目名称:siiMobilityAppKit,代码行数:29,代码来源:SystemWebChromeClient.java

示例13: showProgressBar

import android.widget.ProgressBar; //导入方法依赖的package包/类
public static <T extends Activity> ProgressBar showProgressBar(T context) {
    ProgressBar bar = new ProgressBar(context);
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    params.gravity = Gravity.CENTER;
    bar.setLayoutParams(params);

    ViewGroup vg = (ViewGroup) context.getWindow().getDecorView();
    vg.addView(bar);
    return bar;
}
 
开发者ID:hh-in-zhuzhou,项目名称:ShangHanLun,代码行数:11,代码来源:Helper.java

示例14: ProgressWebView

import android.widget.ProgressBar; //导入方法依赖的package包/类
public ProgressWebView(Context context, AttributeSet attrs) {
    super(context, attrs);
    progressBar = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal);
    progressBar.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
            10, 0, 0));
    Drawable drawable = context.getResources().getDrawable(R.drawable.progress_bar_states);
    progressBar.setProgressDrawable(drawable);
    addView(progressBar);
    setWebChromeClient(new WebChromeClient());
    getSettings().setSupportZoom(true);//支持缩放
    getSettings().setBuiltInZoomControls(true);
}
 
开发者ID:zwf779375807,项目名称:progresswebview,代码行数:13,代码来源:ProgressWebView.java

示例15: onCreateView

import android.widget.ProgressBar; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    ProgressBar progressBar = new ProgressBar(container.getContext());
    if (container instanceof FrameLayout) {
        Resources res = getResources();
        int width = res.getDimensionPixelSize(R.dimen.spinner_width);
        int height = res.getDimensionPixelSize(R.dimen.spinner_height);
        FrameLayout.LayoutParams layoutParams =
                new FrameLayout.LayoutParams(width, height, Gravity.CENTER);
        progressBar.setLayoutParams(layoutParams);
    }
    return progressBar;
}
 
开发者ID:ad-on-is,项目名称:chilly,代码行数:15,代码来源:VerticalGridFragment.java


注:本文中的android.widget.ProgressBar.setLayoutParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。