本文整理匯總了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();
}