package com.zhl.cbprogressbar.view;



import com.jx.jyhd.R;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

public class Downloadprogress {
	static CBProgressBar cbProgress;
	static TextView text;
	private static Dialog mDialog;

	public static void show(Context mContext, int max) {

		mDialog = new Dialog(mContext, R.style.Theme_audioDialog);

		LayoutInflater inflater = LayoutInflater.from(mContext);
		View view = inflater.inflate(R.layout.saaa, null);
		cbProgress = (CBProgressBar) view.findViewById(R.id.my_progress);
		cbProgress.setMax(max);
		text = (TextView) view.findViewById(R.id.text);
		text.setText("下载中...");
		mDialog.setContentView(view);
		mDialog.setCancelable(false);
		mDialog.show();

	}

	public static void setProgress(int Progress) {
		if (Progress > 0) {
			cbProgress.setProgress(Progress);
		}

	}

	public static void setText(String text1) {
		if (mDialog != null) {
			text.setText(text1);
		}

	}

	public static void dismiss() {
		if (mDialog != null) {
			mDialog.dismiss();
		}

	}
}
