From 84e73658ef3b35d001e885e7749b49e83dc8abef Mon Sep 17 00:00:00 2001 From: TRASALBY Date: Mon, 12 Dec 2022 19:16:33 +0900 Subject: [PATCH] =?UTF-8?q?Issue=20#202=20feat:=20LoadingDialog=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=ED=95=A8=EC=88=98=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rightweight/ui/dialog/LoadingDialog.kt | 20 +++++++++++++++++++ app/src/main/res/layout/dialog_loading.xml | 19 ++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 app/src/main/java/com/lateinit/rightweight/ui/dialog/LoadingDialog.kt create mode 100644 app/src/main/res/layout/dialog_loading.xml diff --git a/app/src/main/java/com/lateinit/rightweight/ui/dialog/LoadingDialog.kt b/app/src/main/java/com/lateinit/rightweight/ui/dialog/LoadingDialog.kt new file mode 100644 index 00000000..608cbcb6 --- /dev/null +++ b/app/src/main/java/com/lateinit/rightweight/ui/dialog/LoadingDialog.kt @@ -0,0 +1,20 @@ +package com.lateinit.rightweight.ui.dialog + +import android.app.Dialog +import android.content.Context +import android.graphics.Color +import android.graphics.drawable.ColorDrawable +import android.view.Window + +class LoadingDialogProvider { + + fun provideLoadingDialog(context: Context, loadingLayout: Int): Dialog { + return Dialog(context).apply { + requestWindowFeature(Window.FEATURE_NO_TITLE) + setCanceledOnTouchOutside(false) + setCancelable(false) + window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) + setContentView(loadingLayout) + } + } +} \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_loading.xml b/app/src/main/res/layout/dialog_loading.xml new file mode 100644 index 00000000..fd4524b5 --- /dev/null +++ b/app/src/main/res/layout/dialog_loading.xml @@ -0,0 +1,19 @@ + + + + + +