package com.ccwangluo.accelerator.utils

import android.app.Activity
import android.view.View
import android.view.ViewGroup
import com.ccwangluo.accelerator.R
import com.ccwangluo.accelerator.utils.datareport.DataRePortUtils
import com.github.shadowsocks.http.HttpConfig
import com.umeng.socialize.ShareAction
import com.umeng.socialize.bean.SHARE_MEDIA
import com.umeng.socialize.media.UMWeb
import com.xuexiang.xui.widget.dialog.bottomsheet.BottomSheet


class ServerUtils {
    var mdialog: BottomSheet? = null
    fun choose(activity: Activity) {
        mdialog = BottomSheet(activity)
        val contentView: View = buildViews(activity)
        mdialog?.setContentView(contentView,
                ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
        mdialog?.show()
    }

    fun buildViews(activity: Activity): View {
        val inflate = View.inflate(activity, R.layout.bottom_server_choose, null)

        inflate.findViewById<View>(R.id.share_close).setOnClickListener {
            mdialog?.dismiss()
        }
        return inflate
    }

}