|
@@ -8,6 +8,8 @@ import androidx.core.content.ContextCompat |
|
@@ -8,6 +8,8 @@ import androidx.core.content.ContextCompat |
8
|
import com.br_technology.securitytrain_master.R
|
8
|
import com.br_technology.securitytrain_master.R
|
9
|
import com.br_technology.securitytrain_master.databinding.PopClassifyBinding
|
9
|
import com.br_technology.securitytrain_master.databinding.PopClassifyBinding
|
10
|
import com.br_technology.securitytrain_master.expand.addItemDecoration
|
10
|
import com.br_technology.securitytrain_master.expand.addItemDecoration
|
|
|
11
|
+import com.br_technology.securitytrain_master.expand.dp2px
|
|
|
12
|
+import com.br_technology.securitytrain_master.expand.screenHeight
|
11
|
import com.br_technology.securitytrain_master.expand.screenWidth
|
13
|
import com.br_technology.securitytrain_master.expand.screenWidth
|
12
|
import com.br_technology.securitytrain_master.ui.home.adapter.TextCourseTypeAdapter
|
14
|
import com.br_technology.securitytrain_master.ui.home.adapter.TextCourseTypeAdapter
|
13
|
import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
|
15
|
import com.br_technology.securitytrain_master.view.listener.OnItemClickListener
|
|
@@ -26,9 +28,19 @@ class ClassifyPop(context: Activity) : PopupWindow(context) { |
|
@@ -26,9 +28,19 @@ class ClassifyPop(context: Activity) : PopupWindow(context) { |
26
|
init {
|
28
|
init {
|
27
|
contentView = binding.root
|
29
|
contentView = binding.root
|
28
|
width = contentView.screenWidth()
|
30
|
width = contentView.screenWidth()
|
29
|
- height = height
|
|
|
30
|
- setBackgroundDrawable(ContextCompat.getDrawable(context, R.color.white))
|
31
|
+ height = 252.dp2px()
|
|
|
32
|
+ setBackgroundDrawable(ContextCompat.getDrawable(context, android.R.color.transparent))
|
|
|
33
|
+ isOutsideTouchable = false
|
31
|
|
34
|
|
|
|
35
|
+// val attributes = context.window.attributes
|
|
|
36
|
+// attributes.alpha = 0.5f
|
|
|
37
|
+// context.window.attributes = attributes
|
|
|
38
|
+//
|
|
|
39
|
+// setOnDismissListener {
|
|
|
40
|
+// val attributes = context.window.attributes
|
|
|
41
|
+// attributes.alpha = 1f
|
|
|
42
|
+// context.window.attributes = attributes
|
|
|
43
|
+// }
|
32
|
|
44
|
|
33
|
binding.apply {
|
45
|
binding.apply {
|
34
|
courseType.addItemDecoration(3, 14)
|
46
|
courseType.addItemDecoration(3, 14)
|
|
@@ -53,6 +65,12 @@ class ClassifyPop(context: Activity) : PopupWindow(context) { |
|
@@ -53,6 +65,12 @@ class ClassifyPop(context: Activity) : PopupWindow(context) { |
53
|
})
|
65
|
})
|
54
|
courseType.adapter = textCourseTypeAdapter
|
66
|
courseType.adapter = textCourseTypeAdapter
|
55
|
textCourseTypeAdapter.addList(list)
|
67
|
textCourseTypeAdapter.addList(list)
|
|
|
68
|
+
|
|
|
69
|
+ complete.setOnClickListener {
|
|
|
70
|
+ dismiss()
|
|
|
71
|
+ }
|
|
|
72
|
+
|
|
|
73
|
+
|
56
|
}
|
74
|
}
|
57
|
}
|
75
|
}
|
58
|
|
76
|
|