Skip to content

Commit bab4520

Browse files
perf(*): 验证修改后的AudioPopupWindow
1 parent cb9c699 commit bab4520

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lite/src/main/java/com/pengxh/kt/lite/widget/audio/AudioPopupWindow.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import android.widget.ImageView
66
import android.widget.PopupWindow
77
import android.widget.TextView
88
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
1011

1112
object AudioPopupWindow {
1213
fun create(context: Context, listener: IWindowListener) {
1314
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()
1617
val window = PopupWindow(view, popWidth, popHeight, true)
1718
window.animationStyle = R.style.PopupAnimation
1819
val recodeImageView = view.findViewById<ImageView>(R.id.recodeImageView)
@@ -21,6 +22,6 @@ object AudioPopupWindow {
2122
}
2223

2324
interface IWindowListener {
24-
fun onViewCreated(window: PopupWindow?, imageView: ImageView?, textView: TextView?)
25+
fun onViewCreated(window: PopupWindow, imageView: ImageView, textView: TextView)
2526
}
2627
}

0 commit comments

Comments
 (0)