1 package com.android.healthconnect.testapps.toolbox.utils 2 3 import android.app.Dialog 4 import android.content.Context 5 import android.view.LayoutInflater 6 import androidx.appcompat.app.AlertDialog 7 import com.android.healthconnect.testapps.toolbox.R 8 9 class LoadingDialog(context: Context) { 10 11 private val dialog: Dialog 12 13 init { 14 val inflater = LayoutInflater.from(context) 15 dialog = 16 AlertDialog.Builder(context) 17 .setTitle("Loading") 18 .setView(inflater.inflate(R.layout.loading, null)) 19 .create() 20 dialog.setCancelable(false) 21 } 22 showDialognull23 fun showDialog() { 24 dialog.show() 25 } 26 dismissDialognull27 fun dismissDialog() { 28 dialog.dismiss() 29 } 30 } 31