Created
October 29, 2019 14:01
-
-
Save IvanAbakumov/9a753723641ccb7d5bdddafeee858e20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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