Skip to content

Instantly share code, notes, and snippets.

@IvanAbakumov
Created October 29, 2019 14:01
Show Gist options
  • Save IvanAbakumov/9a753723641ccb7d5bdddafeee858e20 to your computer and use it in GitHub Desktop.
Save IvanAbakumov/9a753723641ccb7d5bdddafeee858e20 to your computer and use it in GitHub Desktop.
import android.app.Dialog
import android.content.Context
import android.view.Window
import ge.redmed.patient.R
class LoaderDialog(private var context: Context) {
private lateinit var dialog: Dialog
fun showDialog() {
dialog = Dialog(context)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
dialog.setCancelable(false)
dialog.setContentView(R.layout.loader_layout)
dialog.show()
}
//..also create a method which will hide the dialog when some work is done
fun hideDialog() {
dialog.hide()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment