@@ -6,13 +6,14 @@ import android.widget.ImageView
6
6
import android.widget.PopupWindow
7
7
import android.widget.TextView
8
8
import com.pengxh.kt.lite.R
9
- import com.pengxh.kt.lite.extensions.obtainScreenWidth
9
+ import com.pengxh.kt.lite.extensions.getScreenHeight
10
+ import com.pengxh.kt.lite.extensions.getScreenWidth
10
11
11
12
object AudioPopupWindow {
12
13
fun create (context : Context , listener : IWindowListener ) {
13
14
val view = View .inflate(context, R .layout.popu_microphone, null )
14
- val popWidth = (context.obtainScreenWidth () * 0.35 ).toInt()
15
- val popHeight = (context.obtainScreenWidth () * 0.30 ).toInt()
15
+ val popWidth = (context.getScreenWidth () * 0.30 ).toInt()
16
+ val popHeight = (context.getScreenHeight () * 0.15 ).toInt()
16
17
val window = PopupWindow (view, popWidth, popHeight, true )
17
18
window.animationStyle = R .style.PopupAnimation
18
19
val recodeImageView = view.findViewById<ImageView >(R .id.recodeImageView)
@@ -21,6 +22,6 @@ object AudioPopupWindow {
21
22
}
22
23
23
24
interface IWindowListener {
24
- fun onViewCreated (window : PopupWindow ? , imageView : ImageView ? , textView : TextView ? )
25
+ fun onViewCreated (window : PopupWindow , imageView : ImageView , textView : TextView )
25
26
}
26
27
}
0 commit comments