Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
This commit is contained in:
@ -13,9 +13,9 @@ open class LinkEntity(
|
||||
var type: String? = "",
|
||||
var text: String? = "",
|
||||
var value: String? = "",
|
||||
@SerializedName("community_id",alternate = ["community"])
|
||||
@SerializedName("community_id")
|
||||
var communityId: String? = "",
|
||||
@SerializedName("link_community")
|
||||
@SerializedName("link_community",alternate = ["community"])
|
||||
var community: CommunityEntity? = CommunityEntity(),
|
||||
var display: Display? = null // 板块
|
||||
) : Parcelable
|
||||
@ -258,7 +258,10 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
DisplayUtils.setLightStatusBar(requireActivity(), false);
|
||||
int currentItem = ((MainWrapperFragment) getParentFragment()).getCurrentItem();
|
||||
if (currentItem == INDEX_PERSONAL) {
|
||||
DisplayUtils.setLightStatusBar(requireActivity(), false);
|
||||
}
|
||||
}
|
||||
|
||||
private void showNotifier(MessageUnreadEntity messageUnread) {
|
||||
|
||||
@ -175,7 +175,9 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
uploadVideoStreamingPlaying("打开评论弹窗")
|
||||
when (videoEntity.status) {
|
||||
"pass" -> {
|
||||
(context as? VideoDetailActivity)?.isPauseVideo = false
|
||||
if (mViewModel != null) {
|
||||
VideoDetailContainerFragment.pauseVideo[mViewModel!!.uuid] = false
|
||||
}
|
||||
val intent = CommentActivity.getVideoCommentIntent(context, videoEntity.id, videoEntity.commentCount, "", false)
|
||||
(context as Activity).startActivityForResult(intent, CommentActivity.REQUEST_CODE)
|
||||
}
|
||||
@ -374,24 +376,24 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
override fun onClickUiToggle() {
|
||||
byStartedClick = true
|
||||
//处理小于30s视频点击空白不能隐藏控件
|
||||
if (mCurrentState == GSYVideoView.CURRENT_STATE_PLAYING) {
|
||||
if (mStartButton != null) {
|
||||
if (mStartButton.visibility == View.VISIBLE) {
|
||||
changeUiToPlayingClear()
|
||||
} else {
|
||||
changeUiToPlayingShow()
|
||||
}
|
||||
}
|
||||
} else if (mCurrentState == GSYVideoView.CURRENT_STATE_PAUSE)
|
||||
if (mStartButton != null) {
|
||||
if (mStartButton.visibility == View.VISIBLE) {
|
||||
changeUiToPauseClear()
|
||||
} else {
|
||||
changeUiToPauseShow()
|
||||
}
|
||||
} else {
|
||||
super.onClickUiToggle()
|
||||
}
|
||||
/* if (mCurrentState == GSYVideoView.CURRENT_STATE_PLAYING) {
|
||||
if (mStartButton != null) {
|
||||
if (mStartButton.visibility == View.VISIBLE) {
|
||||
changeUiToPlayingClear()
|
||||
} else {
|
||||
changeUiToPlayingShow()
|
||||
}
|
||||
}
|
||||
} else if (mCurrentState == GSYVideoView.CURRENT_STATE_PAUSE)
|
||||
if (mStartButton != null) {
|
||||
if (mStartButton.visibility == View.VISIBLE) {
|
||||
changeUiToPauseClear()
|
||||
} else {
|
||||
changeUiToPauseShow()
|
||||
}
|
||||
} else {
|
||||
super.onClickUiToggle()
|
||||
}*/
|
||||
}
|
||||
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar) {
|
||||
@ -416,6 +418,10 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
}
|
||||
}
|
||||
uploadVideoStreamingPlaying("结束拖动", (currentPositionWhenPlaying / 1000).toString())
|
||||
//拖动进度条松开手指后,直接从当前具体的秒数开始播放
|
||||
if (mCurrentState == GSYVideoView.CURRENT_STATE_PAUSE) {
|
||||
onVideoResume()
|
||||
}
|
||||
}
|
||||
|
||||
override fun getEnlargeImageRes(): Int {
|
||||
@ -517,6 +523,9 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.surface_container -> {
|
||||
mStartButton.performClick()
|
||||
}
|
||||
R.id.start -> {
|
||||
if (currentState != GSYVideoView.CURRENT_STATE_PLAYING) {
|
||||
MtaHelper.onEvent("视频详情", "播放", mCombinedTitleAndId)
|
||||
@ -621,5 +630,13 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
gameName.getLocationInWindow(location)
|
||||
return location[1]
|
||||
}
|
||||
|
||||
fun getCurrentPosition(): Long {
|
||||
return mCurrentPosition
|
||||
}
|
||||
|
||||
fun setCurrentPosition(mCurrentPosition: Long) {
|
||||
this.mCurrentPosition = mCurrentPosition
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@ import com.lightgame.download.DownloadStatus
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
|
||||
import com.shuyu.gsyvideoplayer.utils.OrientationUtils
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
|
||||
import kotlinx.android.synthetic.main.layout_video_detail_surface.view.*
|
||||
import java.util.*
|
||||
|
||||
@ -97,6 +98,11 @@ class VideoAdapter(val mContext: Context, val mRecyclerView: RecyclerView, val m
|
||||
fullVideoPlayer.hideAllButton(true)
|
||||
fullVideoPlayer.updateViewDetail(videoList[position])
|
||||
fullVideoPlayer.updateMuteStatus()
|
||||
//金进入全屏后直接播放
|
||||
if (fullVideoPlayer.currentState == GSYVideoView.CURRENT_STATE_PAUSE) {
|
||||
fullVideoPlayer.setCurrentPosition(videoView.getCurrentPosition())
|
||||
fullVideoPlayer.onVideoResume()
|
||||
}
|
||||
}
|
||||
|
||||
videoView.isNeedShowWifiTip = HaloApp.get(Constants.SHOULD_SHOW_VIDEO_MOBILE_WARNING, false) as Boolean?
|
||||
@ -126,7 +132,7 @@ class VideoAdapter(val mContext: Context, val mRecyclerView: RecyclerView, val m
|
||||
|
||||
DownloadItemUtils.setOnClickListener(mContext, this,
|
||||
game, 0, this@VideoAdapter,
|
||||
mViewModel.path, BaseActivity.mergeEntranceAndPath(mViewModel.path, "视频详情"), exposureEvent,object :EmptyCallback{
|
||||
mViewModel.path, BaseActivity.mergeEntranceAndPath(mViewModel.path, "视频详情"), exposureEvent, object : EmptyCallback {
|
||||
override fun onCallback() {
|
||||
when (download_btn.text) {
|
||||
"下载" -> MtaHelper.onEvent("视频详情", "下载游戏", "${videoList[position].title}(${videoList[position].id})")
|
||||
@ -201,6 +207,7 @@ class VideoAdapter(val mContext: Context, val mRecyclerView: RecyclerView, val m
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setDownloadBtnStatus(context: Context, gameEntity: GameEntity, downloadBtn: TextView, pluginLocation: PluginLocation) {
|
||||
val status = GameUtils.getDownloadBtnText(context, gameEntity, pluginLocation)
|
||||
downloadBtn.setTextColor(Color.WHITE)
|
||||
|
||||
@ -12,7 +12,7 @@ import java.util.*
|
||||
// 由于兼容性问题,本游戏详情页不应该被低于 Android 4.4 的设备打开
|
||||
class VideoDetailActivity : BaseActivity() {
|
||||
var uuid = UUID.randomUUID()
|
||||
var isPauseVideo = true//跳转页面时是否需要暂停视频
|
||||
// var isPauseVideo = true//跳转页面时是否需要暂停视频
|
||||
var mLastTime = 0L
|
||||
var mIsDown = false
|
||||
private val mIntervalTime = 500
|
||||
@ -50,21 +50,21 @@ class VideoDetailActivity : BaseActivity() {
|
||||
return super.dispatchTouchEvent(ev)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
/*override fun onPause() {
|
||||
if (isPauseVideo) {
|
||||
CustomManager.onPause("detail_$uuid")
|
||||
}
|
||||
super.onPause()
|
||||
}
|
||||
}*/
|
||||
|
||||
override fun onResume() {
|
||||
/*override fun onResume() {
|
||||
if (isPauseVideo) {
|
||||
CustomManager.onResume("detail_$uuid")
|
||||
} else {
|
||||
isPauseVideo = true
|
||||
}
|
||||
super.onResume()
|
||||
}
|
||||
}*/
|
||||
|
||||
override fun onDestroy() {
|
||||
CustomManager.releaseAllVideos("detail_$uuid")
|
||||
|
||||
@ -58,6 +58,10 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
|
||||
|
||||
private var mExposureListener: ExposureListener? = null
|
||||
|
||||
companion object {
|
||||
var pauseVideo = HashMap<String, Boolean>()//跳转页面时是否需要暂停视频
|
||||
}
|
||||
|
||||
private val dataWatcher = object : DataWatcher() {
|
||||
override fun onDataChanged(downloadEntity: DownloadEntity) {
|
||||
if (::mAdapter.isInitialized) {
|
||||
@ -87,6 +91,7 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
|
||||
mViewModel.showComment = arguments?.getBoolean(EntranceUtils.KEY_SHOW_COMMENT) ?: false
|
||||
mViewModel.location = mLocation
|
||||
mViewModel.isHomeVideo = mIsHomeVideo
|
||||
pauseVideo[mViewModel.uuid] = true
|
||||
|
||||
mViewModel.getVideoDetailList(mInitialVideoId, mLocation, isLoadNext = true)
|
||||
ClassicsFooter.REFRESH_FOOTER_NOTHING = "没有内容了"
|
||||
@ -391,14 +396,20 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
|
||||
override fun onFragmentResume() {
|
||||
findFirstCompletelyVisibleVideoViewByPosition()?.uploadVideoStreamingPlaying("恢复页面")
|
||||
DownloadManager.getInstance(requireContext()).addObserver(dataWatcher)
|
||||
CustomManager.onResume("detail_${mViewModel.uuid}")
|
||||
if (pauseVideo[mViewModel.uuid] == true) {
|
||||
CustomManager.onResume("detail_${mViewModel.uuid}")
|
||||
} else {
|
||||
pauseVideo[mViewModel.uuid] = true
|
||||
}
|
||||
super.onFragmentResume()
|
||||
}
|
||||
|
||||
override fun onFragmentPause() {
|
||||
DownloadManager.getInstance(requireContext()).removeObserver(dataWatcher)
|
||||
findFirstCompletelyVisibleVideoViewByPosition()?.uploadVideoStreamingPlaying("暂停页面")
|
||||
CustomManager.onPause("detail_${mViewModel.uuid}")
|
||||
if (pauseVideo[mViewModel.uuid] == true) {
|
||||
CustomManager.onPause("detail_${mViewModel.uuid}")
|
||||
}
|
||||
super.onFragmentPause()
|
||||
}
|
||||
|
||||
@ -409,6 +420,7 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
|
||||
if (mAdCountDownTimer != null && !mAdCountDownTimer!!.isDisposed) {
|
||||
mAdCountDownTimer?.dispose()
|
||||
}
|
||||
pauseVideo.remove(mViewModel.uuid)
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user