本文整理汇总了Java中android.widget.ProgressBar.setSecondaryProgress方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressBar.setSecondaryProgress方法的具体用法?Java ProgressBar.setSecondaryProgress怎么用?Java ProgressBar.setSecondaryProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ProgressBar
的用法示例。
在下文中一共展示了ProgressBar.setSecondaryProgress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initDialog
import android.widget.ProgressBar; //导入方法依赖的package包/类
private void initDialog() {
LayoutInflater inflater = LayoutInflater.from(mContext);
View mProgressDialogView = inflater.inflate(R.layout.mn_progress_bar_dialog_layout, null);// 得到加载view
mDialog = new Dialog(mContext, R.style.MNCustomDialog);// 创建自定义样式dialog
mDialog.setCancelable(false);// 不可以用“返回键”取消
mDialog.setCanceledOnTouchOutside(false);
mDialog.setContentView(mProgressDialogView);// 设置布局
//设置整个Dialog的宽高
DisplayMetrics dm = new DisplayMetrics();
WindowManager windowManager = ((Activity) mContext).getWindowManager();
windowManager.getDefaultDisplay().getMetrics(dm);
int screenW = dm.widthPixels;
int screenH = dm.heightPixels;
WindowManager.LayoutParams layoutParams = mDialog.getWindow().getAttributes();
layoutParams.width = screenW;
layoutParams.height = screenH;
mDialog.getWindow().setAttributes(layoutParams);
//获取布局
dialog_window_background = (RelativeLayout) mProgressDialogView.findViewById(R.id.dialog_window_background);
dialog_view_bg = (RelativeLayout) mProgressDialogView.findViewById(R.id.dialog_view_bg);
tvShow = (TextView) mProgressDialogView.findViewById(R.id.tvShow);
horizontalProgressBar = (ProgressBar) mProgressDialogView.findViewById(R.id.horizontalProgressBar);
circularProgressBar = (MCircularProgressBar) mProgressDialogView.findViewById(R.id.circularProgressBar);
horizontalProgressBar.setVisibility(View.GONE);
circularProgressBar.setVisibility(View.GONE);
horizontalProgressBar.setProgress(0);
horizontalProgressBar.setSecondaryProgress(0);
circularProgressBar.setProgress(0);
tvShow.setText("");
//默认配置
configView();
}