package greasyic

import android.app.AlertDialog
import android.content.Context
import android.text.method.ScrollingMovementMethod
import android.view.LayoutInflater
import com.easy.clean.databinding.HitchhikeicBinding

object Maneic {

    fun Context.showLogDialog(log: String) {
        val dialog = AlertDialog.Builder(this).create()
        val binding = HitchhikeicBinding.inflate(LayoutInflater.from(this))
        dialog.setView(binding.root)
        dialog.setCanceledOnTouchOutside(true)

        dialog.show()

        val params = dialog.window?.attributes
//        params?.width = resources.getDimensionPixelOffset(R.dimen.loopholeic)
//        params?.height = LinearLayout.LayoutParams.WRAP_CONTENT
//        params?.gravity = Gravity.BOTTOM
//        params?.y = 50

        dialog.window?.attributes = params
        dialog.window?.setBackgroundDrawableResource(android.R.color.transparent)

        binding.devastationic.movementMethod = ScrollingMovementMethod()
        binding.devastationic.text = log
    }
}