光环助手V3.7.2 RELEASE(20200108-2100)测试问题汇总2,5,7,8,10 https://gitlab.ghzs.com/pm/halo-app-issues/issues/753
This commit is contained in:
@ -111,6 +111,7 @@ object DefaultWebViewUrlHandler {
|
||||
}
|
||||
return true
|
||||
}
|
||||
if ("http" != uri.scheme && "https" != uri.scheme) return true
|
||||
return false
|
||||
}
|
||||
}
|
||||
@ -107,7 +107,7 @@ open class NewCommentFragment : ListFragment<CommentEntity, NewCommentViewModel>
|
||||
}
|
||||
else -> {
|
||||
mSendingDialog?.dismiss()
|
||||
toast(R.string.post_failure_hint)
|
||||
toast(R.string.comment_failed_userblocked)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@ -3,14 +3,18 @@ package com.gh.gamecenter.video.detail
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.util.AttributeSet
|
||||
import android.view.Surface
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.SeekBar
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.gh.common.AppExecutor
|
||||
import com.gh.common.constant.Constants
|
||||
import com.gh.common.observer.MuteCallback
|
||||
import com.gh.common.observer.VolumeObserver
|
||||
import com.gh.common.runOnIoThread
|
||||
import com.gh.common.util.*
|
||||
import com.gh.download.cache.CacheManager
|
||||
@ -51,6 +55,22 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
private var mContentLength = 0.0
|
||||
var repeatPlayCount = 0 //重复播放次数
|
||||
private var mIsDragSeek = false//是否拖动进度条
|
||||
private var mMuteCallback: MuteCallback
|
||||
private var mVolumeObserver: VolumeObserver
|
||||
|
||||
init {
|
||||
mMuteCallback = object : MuteCallback {
|
||||
override fun onMute(isMute: Boolean) {
|
||||
if (isMute) {
|
||||
mute()
|
||||
} else {
|
||||
unMute()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mVolumeObserver = VolumeObserver(context, Handler(), mMuteCallback)
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
super.init(context)
|
||||
@ -77,6 +97,15 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
volume.setOnClickListener { toggleMute() }
|
||||
}
|
||||
|
||||
fun observeVolume(activity: AppCompatActivity) {
|
||||
activity.contentResolver?.registerContentObserver(
|
||||
android.provider.Settings.System.CONTENT_URI, true, mVolumeObserver)
|
||||
}
|
||||
|
||||
fun unObserveVolume(activity: AppCompatActivity) {
|
||||
activity.contentResolver?.unregisterContentObserver(mVolumeObserver)
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
fun updateViewDetail(videoEntity: VideoEntity) {
|
||||
mVideoEntity = videoEntity
|
||||
@ -423,7 +452,7 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
}
|
||||
|
||||
override fun onStopTrackingTouch(seekBar: SeekBar) {
|
||||
AppExecutor.uiExecutor.executeWithDelay(Runnable{
|
||||
AppExecutor.uiExecutor.executeWithDelay(Runnable {
|
||||
super.onStopTrackingTouch(seekBar)
|
||||
if (currentPositionWhenPlaying == 0) {
|
||||
when (mCurrentState) {
|
||||
@ -440,7 +469,7 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
if (mCurrentState == GSYVideoView.CURRENT_STATE_PAUSE) {
|
||||
onVideoResume()
|
||||
}
|
||||
},500)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
override fun getEnlargeImageRes(): Int {
|
||||
@ -545,7 +574,7 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.surface_container,R.id.thumb -> {
|
||||
R.id.surface_container, R.id.thumb -> {
|
||||
mStartButton.performClick()
|
||||
}
|
||||
R.id.start -> {
|
||||
|
||||
@ -6,6 +6,7 @@ import android.graphics.Color
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.base.BaseActivity
|
||||
@ -87,6 +88,7 @@ class VideoAdapter(val mContext: Context, val mRecyclerView: RecyclerView, val m
|
||||
videoView.updateViewDetail(videoList[position])
|
||||
videoView.updateThumb(videoList[position].getThumb())
|
||||
videoView.updateMuteStatus()
|
||||
videoView.observeVolume(mContext as AppCompatActivity)
|
||||
videoView.fullscreenButton.setOnClickListener {
|
||||
if (mOrientationUtils.isLand == 0) {
|
||||
MtaHelper.onEvent("视频详情", "进入全屏", "${videoList[position].title}(${videoList[position].id})")
|
||||
@ -96,6 +98,7 @@ class VideoAdapter(val mContext: Context, val mRecyclerView: RecyclerView, val m
|
||||
mOrientationUtils.resolveByClick()
|
||||
val fullVideoPlayer = videoView.startWindowFullscreen(mContext, true, true) as DetailPlayerView
|
||||
// fullVideoPlayer.setIsBottomContainerShow(videoView.isBottomContainerShow)
|
||||
fullVideoPlayer.observeVolume(mContext)
|
||||
fullVideoPlayer.setIsBottomContainerShow(true)
|
||||
fullVideoPlayer.setViewModel(mViewModel)
|
||||
fullVideoPlayer.hideAllButton(true)
|
||||
|
||||
@ -11,6 +11,7 @@ import android.widget.LinearLayout
|
||||
import android.widget.PopupWindow
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.OrientationHelper
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.base.fragment.BaseLazyFragment
|
||||
@ -218,6 +219,7 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
|
||||
}
|
||||
val detailPlayerView = recyclerview.findViewHolderForAdapterPosition(position)?.itemView as? DetailPlayerView
|
||||
detailPlayerView?.repeatPlayCount = 0
|
||||
detailPlayerView?.unObserveVolume(requireActivity() as AppCompatActivity)
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,6 +236,7 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
|
||||
val pos = mViewPagerLayoutManager.findFirstCompletelyVisibleItemPosition()
|
||||
|
||||
val videoView = findFirstCompletelyVisibleVideoViewByPosition()
|
||||
videoView?.observeVolume(requireActivity() as AppCompatActivity)
|
||||
|
||||
if (pos + 2 <= mAdapter.videoList.size - 1) {//预加载视频
|
||||
CacheManager.getInstance().download(mAdapter.videoList[pos + 1].url, object : CacheObserver() {})
|
||||
|
||||
Reference in New Issue
Block a user