Skip to content

Commit

Permalink
Issue #202 feat: LoadingDialog 생성 함수 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
TRASALBY committed Dec 12, 2022
1 parent c3e2a78 commit 84e7365
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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)
}
}
}
19 changes: 19 additions & 0 deletions app/src/main/res/layout/dialog_loading.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/tv_loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:text="로딩 테스트"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 84e7365

Please sign in to comment.