From e73f141d599ca54290497d0356e5253173632af4 Mon Sep 17 00:00:00 2001 From: aibingbing Date: Fri, 10 Mar 2023 00:29:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=B0=86=E6=98=8E=E5=90=9B?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=9A=84=E5=AE=A3=E4=BC=A0=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E4=BC=98=E5=8C=96=E5=A4=8D=E5=88=B6=E5=88=B0?= =?UTF-8?q?=E5=85=AC=E5=85=B1module;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/wigets/video/VideoPlayerView.kt | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerView.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerView.kt index b74b4acb64..d5d218220a 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerView.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerView.kt @@ -522,7 +522,7 @@ class AdvanceGSYVideoPlayer : StandardGSYVideoPlayer { hideWidget() } - private fun hideWidget() { + private fun hideWidget(){ setViewShowState(mBottomContainer, INVISIBLE) setViewShowState(mProgressBar, INVISIBLE) setViewShowState(mCurrentTimeTextView, INVISIBLE) @@ -535,22 +535,19 @@ class AdvanceGSYVideoPlayer : StandardGSYVideoPlayer { setViewShowState( mLockScreen, INVISIBLE ) + setIsTouchWiget(false) isFocusableInTouchMode = false } fun setCacheImageViewVisible() { - if (mThumbImageViewLayout.visibility == INVISIBLE) { - setViewShowState(mThumbImageViewLayout, VISIBLE) - setViewShowState(mThumbImageView, VISIBLE) - } + setViewShowState(mThumbImageViewLayout, VISIBLE) + setViewShowState(mThumbImageView, VISIBLE) } fun setCacheImageViewGone() { - if (mThumbImageViewLayout.visibility == VISIBLE) { - setViewShowState(mThumbImageViewLayout, INVISIBLE) - setViewShowState(mThumbImageView, INVISIBLE) - } + setViewShowState(mThumbImageViewLayout, INVISIBLE) + setViewShowState(mThumbImageView, INVISIBLE) } //失去焦点声音压低 @@ -563,17 +560,17 @@ class AdvanceGSYVideoPlayer : StandardGSYVideoPlayer { setNeedMute(false) } - private fun setStreamVolume(percent: Float) { + private fun setStreamVolume(percent: Float){ var mAudioManager = mContext?.getSystemService(Context.AUDIO_SERVICE) as AudioManager var maxVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC) var volume = (percent * maxVolume).toInt() - if (volume < 0) { + if (volume < 0 ){ volume = 0 } - mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, volume, 0) + mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC,volume,0) } - private fun setNeedMute(isMute: Boolean) { + private fun setNeedMute(isMute: Boolean){ gsyVideoManager?.player?.setNeedMute(isMute) } } \ No newline at end of file