@@ -34,7 +34,6 @@ object ScDisplayUtils {
34
34
if (largeCircle) {
35
35
mProgressBar = ProgressBar (activity.applicationContext, null , android.R .attr.progressBarStyleLarge).apply {
36
36
isIndeterminate = true
37
- setBackgroundColor(ContextCompat .getColor(activity, android.R .color.transparent))
38
37
visibility = View .VISIBLE
39
38
40
39
try {
@@ -49,9 +48,8 @@ object ScDisplayUtils {
49
48
}
50
49
}
51
50
else {
52
- mProgressBar = ProgressBar (activity.applicationContext, null , android.R .attr.progressBarStyleInverse ).apply {
51
+ mProgressBar = ProgressBar (activity.applicationContext, null , android.R .attr.progressBarStyle ).apply {
53
52
isIndeterminate = true
54
- setBackgroundColor(ContextCompat .getColor(activity, android.R .color.transparent))
55
53
visibility = View .VISIBLE
56
54
57
55
try {
@@ -74,7 +72,7 @@ object ScDisplayUtils {
74
72
rl!! .gravity = Gravity .CENTER
75
73
rl!! .addView(mProgressBar)
76
74
rl!! .isClickable = true
77
- // rl!!.setBackgroundColor(Color.parseColor("#80000000"))
75
+ rl!! .setBackgroundColor(Color .parseColor(" #80000000" ))
78
76
79
77
layoutParams.addRule(RelativeLayout .CENTER_IN_PARENT )
80
78
@@ -85,15 +83,15 @@ object ScDisplayUtils {
85
83
* Hide ProgressBar
86
84
*/
87
85
fun hideProgressBar () {
88
- // mProgressBar?.let { it.apply {
89
- // if(visibility == View.VISIBLE) visibility = View.GONE
90
- // } }
86
+ mProgressBar?.let { it.apply {
87
+ if (visibility == View .VISIBLE ) visibility = View .GONE
88
+ } }
91
89
92
- // parent?.let { viewGroup ->
93
- // rl?.let {
94
- // viewGroup.removeView(it)
95
- // }
96
- // }
90
+ parent?.let { viewGroup ->
91
+ rl?.let {
92
+ viewGroup.removeView(it)
93
+ }
94
+ }
97
95
98
96
mProgressBar = null
99
97
rl = null
@@ -130,7 +128,28 @@ object ScDisplayUtils {
130
128
}.show()
131
129
}
132
130
131
+ fun showDialog (context : Context , dialogTitle : String , dialogMsg : String , dialogTwoButtonClickListener : DialogTwoButtonClickListener ? = null, firstButtonText : String = "확인", secondButtonText : String = "취소", dismissOutSideTouch : Boolean = false) {
132
+ context.alert(dialogMsg, dialogTitle) {
133
+ isCancelable = dismissOutSideTouch
134
+ positiveButton(firstButtonText) {
135
+ dialogTwoButtonClickListener?.let {
136
+ it.onClickConfirm()
137
+ }
138
+ }
139
+ negativeButton(secondButtonText) {
140
+ dialogTwoButtonClickListener?.let {
141
+ it.onCLickCancel()
142
+ }
143
+ }
144
+ }.show()
145
+ }
146
+
133
147
interface DialogOneButtonClickListener {
134
148
fun onClick ()
135
149
}
150
+
151
+ interface DialogTwoButtonClickListener {
152
+ fun onClickConfirm ()
153
+ fun onCLickCancel ()
154
+ }
136
155
}
0 commit comments