Skip to content

Commit

Permalink
#91 로딩 다이얼로그 라운드 코너 미표시 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
pknujsp committed May 31, 2023
1 parent d8517f0 commit 4a17b86
Showing 1 changed file with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
package com.android.mediproject.core.common.dialog

import android.content.Context
import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import com.google.android.material.dialog.MaterialAlertDialogBuilder

object LoadingDialog {

private var dialog: AlertDialog? = null

fun showLoadingDialog(context: Context, textMessage: String?) {
dismiss()
AlertDialog.Builder(context).setView(ProgressIndicator(context, textMessage)).setCancelable(false).create().also {
it.window?.apply {
setClipToOutline(true)
setElevation(8f)
// shadow

attributes = attributes.apply {
width = ViewGroup.LayoutParams.WRAP_CONTENT
height = ViewGroup.LayoutParams.WRAP_CONTENT
dimAmount = 0.5f
}
MaterialAlertDialogBuilder(context).setView(ProgressIndicator(context, textMessage))
.setCancelable(false).create().also {
it.setCanceledOnTouchOutside(false)
it.window?.setBackgroundDrawableResource(android.R.color.transparent)
dismiss()
dialog = it
it.show()
}
it.setCanceledOnTouchOutside(false)
dismiss()
dialog = it
it.show()
}

}

Expand Down

0 comments on commit 4a17b86

Please sign in to comment.