王鹏鹏 2 лет назад
Родитель
Сommit
e22123d03f

+ 1 - 0
.idea/misc.xml

@@ -502,6 +502,7 @@
         <entry key="..\:/workspace/hcp-pads/livebroadcast/src/main/res/drawable/selector_live_tab_left.xml" value="0.1715" />
         <entry key="..\:/workspace/hcp-pads/livebroadcast/src/main/res/layout/activity_live_broadcast.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/livebroadcast/src/main/res/layout/activity_live_broadcast_list.xml" value="0.23697916666666666" />
+        <entry key="..\:/workspace/hcp-pads/livebroadcast/src/main/res/layout/activity_video_player.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/livebroadcast/src/main/res/layout/item_live_broadcast.xml" value="0.6" />
         <entry key="..\:/workspace/hcp-pads/login/src/main/res/layout/activity_login.xml" value="0.23697916666666666" />
         <entry key="..\:/workspace/hcp-pads/personalcenter/src/main/res/drawable/bg_setting_center.xml" value="0.1715" />

+ 0 - 1
baselib/src/main/res/layout/dialog_loading.xml

@@ -11,7 +11,6 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
-        android:visibility="gone"
         android:background="@drawable/bg_dialog_ring" />
 
     <androidx.appcompat.widget.AppCompatImageView

+ 1 - 0
game/build.gradle

@@ -16,6 +16,7 @@ android {
 
 dependencies {
     implementation project(path: ':baselib')
+    api project(path: ':superplayerkit')
     api fileTree(exclude: '*.bak', dir: 'libs')
     implementation(rootProject.ext.androidx.kotlin_lib)
     implementation(rootProject.ext.androidx.kotlin_core)

+ 52 - 2
game/src/main/java/com/yingyangfly/game/introduction/GameIntroductionActivity.kt

@@ -1,10 +1,20 @@
 package com.yingyangfly.game.introduction
 
+import android.annotation.SuppressLint
 import android.os.Bundle
 import android.text.TextUtils
+import android.view.MotionEvent
+import android.view.View
 import com.alibaba.android.arouter.facade.annotation.Route
+import com.tencent.liteav.demo.superplayer.SuperPlayerModel
+import com.yingyangfly.baselib.bean.Record
+import com.yingyangfly.baselib.config.AccountConfig
+import com.yingyangfly.baselib.ext.getEndAnimation
+import com.yingyangfly.baselib.ext.getScaleAnimation
 import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
 import com.yingyangfly.baselib.router.RouterUrlCommon
+import com.yingyangfly.baselib.utils.JumpUtil
+import com.yingyangfly.game.R
 import com.yingyangfly.game.databinding.ActivityGameIntroductionBinding
 
 /**
@@ -12,7 +22,8 @@ import com.yingyangfly.game.databinding.ActivityGameIntroductionBinding
  */
 @Route(path = RouterUrlCommon.gameIntroduction)
 class GameIntroductionActivity :
-    BaseMVVMActivity<ActivityGameIntroductionBinding, GameIntroductionViewModel>() {
+    BaseMVVMActivity<ActivityGameIntroductionBinding, GameIntroductionViewModel>(),
+    View.OnTouchListener {
 
     private var url: String = ""
 
@@ -26,8 +37,12 @@ class GameIntroductionActivity :
 
     }
 
+    @SuppressLint("ClickableViewAccessibility")
     override fun initListener() {
-
+        binding {
+            homeImage.setOnTouchListener(this@GameIntroductionActivity)
+            btnStartGame.setOnTouchListener(this@GameIntroductionActivity)
+        }
     }
 
     override fun initData() {
@@ -42,8 +57,43 @@ class GameIntroductionActivity :
             }, success = {
                 if (it != null) {
                     binding.data = it
+                    if (TextUtils.isEmpty(it.gameVideoUrl).not()) {
+                        initPalyer(it)
+                    }
                 }
             })
         }
     }
+
+    /**
+     * 初始化播放器
+     */
+    private fun initPalyer(bean: Record) {
+
+    }
+
+    @SuppressLint("ClickableViewAccessibility")
+    override fun onTouch(v: View, event: MotionEvent): Boolean {
+        when (event.action) {
+            MotionEvent.ACTION_DOWN -> {
+                if (v.id == R.id.homeImage || v.id == R.id.btnStartGame) {
+                    v.startAnimation(getScaleAnimation())
+                }
+            }
+            MotionEvent.ACTION_UP -> {
+                v.startAnimation(getEndAnimation())
+                if (v.id == R.id.homeImage) {
+                    JumpUtil.jumpActivity(RouterUrlCommon.home, mContext)
+                } else if (v.id == R.id.btnStartGame) {
+
+                }
+            }
+            MotionEvent.ACTION_CANCEL -> {
+                if (v.id == R.id.homeImage || v.id == R.id.btnStartGame) {
+                    v.startAnimation(getEndAnimation())
+                }
+            }
+        }
+        return true
+    }
 }

+ 1 - 1
game/src/main/java/com/yingyangfly/game/loading/GameLoadingActivity.kt

@@ -20,7 +20,7 @@ class GameLoadingActivity : BaseActivity<ActivityGameLoadingBinding>() {
 
     private var url: String = ""
     private lateinit var rxTimer: RxTimer
-    private var time: Long = 4
+    private var time: Long = 3
 
     override fun onCreate(savedInstanceState: Bundle?) {
         url = intent.getStringExtra("url") ?: ""

+ 1 - 1
game/src/main/res/layout/activity_game_loading.xml

@@ -25,7 +25,7 @@
             android:layout_height="@dimen/divider_20px"
             android:layout_marginTop="@dimen/divider_41px"
             android:indeterminate="false"
-            android:max="4"
+            android:max="3"
             android:progressDrawable="@drawable/bg_game_progressbar_selector"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"