package com.base.datarecovery.view

import android.app.AlertDialog
import android.content.Context
import android.view.LayoutInflater
import com.base.datarecovery.R
import com.base.datarecovery.databinding.DialogFileScanBinding

object FileScanDialog {
    fun Context.showFileScanDialog() {
        val binding = DialogFileScanBinding.inflate(LayoutInflater.from(this))
        val dialog = AlertDialog.Builder(this).create()
        dialog.setView(binding.root)
        dialog.setCanceledOnTouchOutside(false)
        dialog.show()

        dialog.window?.setBackgroundDrawableResource(android.R.color.transparent)
        val params = dialog.window?.attributes
        params?.width = resources.getDimensionPixelOffset(R.dimen.dp_345)
        dialog.window?.attributes = params
    }
}