Dialog 사용자 정의!

1420 단어
package com.example.furen.com.furenceping;

import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.widget.TextView;

import com.examclass.UIActivity.R;

public class CustomProgressDialog extends Dialog {

	private static CustomProgressDialog customProgressDialog = null;
	public CustomProgressDialog(Context context) {
		super(context);
	}

	public CustomProgressDialog(Context context,int theme){
		super(context,theme);
	}
	public static CustomProgressDialog createDialog(Context context){
		customProgressDialog = new CustomProgressDialog(context,R.style.CustomProgressDialog);
		customProgressDialog.setContentView(R.layout.customprogressdialog);
		customProgressDialog.getWindow().getAttributes().gravity = Gravity.CENTER;
		        return customProgressDialog;
	
		    }

		    public void onWindowFocusChanged(boolean hasFocus){
	
		        if (customProgressDialog == null){

		            return;

		        }
		    }

		    public CustomProgressDialog setTitile(String strTitle){

		        return customProgressDialog;

		    }

		    public CustomProgressDialog setMessage(String strMessage){

		        TextView tvMsg = (TextView)customProgressDialog.findViewById(R.id.id_tv_loadingmsg);

		        if (tvMsg != null){
		            tvMsg.setText(strMessage);

		        }
		        return customProgressDialog;
		    }
	}

좋은 웹페이지 즐겨찾기