package com.sylva.sylvabbsclient.view

import android.app.ProgressDialog
import android.view.View
import android.widget.TextView

/**
 * Created by sylva on 2016/3/19.
 */
interface TProgressDialogView :IRunBackgroundView {
    override fun showProgressView(message:String){
        if (mPd == null) {
            mPd = ProgressDialog(ctx)
            mPd?.setProgressStyle(ProgressDialog.STYLE_SPINNER)
            mPd?.isIndeterminate = true
            mPd?.setCancelable(false)
        }
        mPd?.setMessage(message)
        mPd?.show()
    }
    override fun modifyProgressText(message:String){
        mPd?.setMessage(message)
    }
    override fun hideProgressView(){
        mPd?.dismiss()
        mPd=null
    }
    companion object{
        private var mPd: ProgressDialog?=null
    }
}