diff --git a/.gradle/7.2/executionHistory/executionHistory.bin b/.gradle/7.2/executionHistory/executionHistory.bin index 9e97135..50acc3a 100644 Binary files a/.gradle/7.2/executionHistory/executionHistory.bin and b/.gradle/7.2/executionHistory/executionHistory.bin differ diff --git a/.gradle/7.2/executionHistory/executionHistory.lock b/.gradle/7.2/executionHistory/executionHistory.lock index 7becb1a..545b75c 100644 Binary files a/.gradle/7.2/executionHistory/executionHistory.lock and b/.gradle/7.2/executionHistory/executionHistory.lock differ diff --git a/.gradle/7.2/fileHashes/fileHashes.bin b/.gradle/7.2/fileHashes/fileHashes.bin index 02b191a..0a4b70c 100644 Binary files a/.gradle/7.2/fileHashes/fileHashes.bin and b/.gradle/7.2/fileHashes/fileHashes.bin differ diff --git a/.gradle/7.2/fileHashes/fileHashes.lock b/.gradle/7.2/fileHashes/fileHashes.lock index e04ecee..29e4a45 100644 Binary files a/.gradle/7.2/fileHashes/fileHashes.lock and b/.gradle/7.2/fileHashes/fileHashes.lock differ diff --git a/.gradle/7.2/fileHashes/resourceHashesCache.bin b/.gradle/7.2/fileHashes/resourceHashesCache.bin index 2fa17ff..d9bfb07 100644 Binary files a/.gradle/7.2/fileHashes/resourceHashesCache.bin and b/.gradle/7.2/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index afb1a41..9bba18c 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index 4a45d1f..82b5538 100644 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/checksums/checksums.lock b/.gradle/checksums/checksums.lock index fb8a611..73ba134 100644 Binary files a/.gradle/checksums/checksums.lock and b/.gradle/checksums/checksums.lock differ diff --git a/.gradle/checksums/md5-checksums.bin b/.gradle/checksums/md5-checksums.bin index 81c6216..23ad1ed 100644 Binary files a/.gradle/checksums/md5-checksums.bin and b/.gradle/checksums/md5-checksums.bin differ diff --git a/.gradle/checksums/sha1-checksums.bin b/.gradle/checksums/sha1-checksums.bin index 8cfc9e7..800f039 100644 Binary files a/.gradle/checksums/sha1-checksums.bin and b/.gradle/checksums/sha1-checksums.bin differ diff --git a/app/build.gradle b/app/build.gradle index 4190eba..1da211e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -67,6 +67,10 @@ android { dependencies { + + implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer:v8.2.0-release-jitpack' + + //权限申请 implementation 'com.guolindev.permissionx:permissionx:1.6.1' diff --git a/app/src/main/java/com/coldmint/rust/pro/UserHomePageActivity.kt b/app/src/main/java/com/coldmint/rust/pro/UserHomePageActivity.kt index 4120d30..91383f5 100644 --- a/app/src/main/java/com/coldmint/rust/pro/UserHomePageActivity.kt +++ b/app/src/main/java/com/coldmint/rust/pro/UserHomePageActivity.kt @@ -2,34 +2,28 @@ package com.coldmint.rust.pro import android.annotation.SuppressLint import android.app.ActivityOptions -import android.os.Bundle -import com.coldmint.rust.pro.databinding.ActivityUserHomePageBinding -import com.coldmint.rust.pro.base.BaseActivity - import android.content.Context import android.content.Intent -import android.content.res.ColorStateList import android.graphics.Color +import android.os.Bundle import android.view.Gravity import android.view.View import android.view.inputmethod.EditorInfo import android.widget.EditText -import android.widget.Toast import androidx.core.view.isVisible -import androidx.viewpager2.widget.ViewPager2 import com.afollestad.materialdialogs.LayoutMode import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.bottomsheets.BottomSheet import com.afollestad.materialdialogs.input.getInputField import com.afollestad.materialdialogs.input.input import com.bumptech.glide.Glide -import com.bumptech.glide.request.RequestOptions import com.coldmint.rust.core.dataBean.ApiResponse -import com.coldmint.rust.core.dataBean.follow.FollowUserListData import com.coldmint.rust.core.dataBean.user.SpaceInfoData import com.coldmint.rust.core.interfaces.ApiCallBack import com.coldmint.rust.core.web.* import com.coldmint.rust.pro.adapters.UserHomeStateAdapter +import com.coldmint.rust.pro.base.BaseActivity +import com.coldmint.rust.pro.databinding.ActivityUserHomePageBinding import com.coldmint.rust.pro.tool.AppSettings import com.coldmint.rust.pro.tool.GlobalMethod import com.google.android.material.appbar.AppBarLayout @@ -37,8 +31,10 @@ import com.google.android.material.appbar.CollapsingToolbarLayout import com.google.android.material.snackbar.Snackbar import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayoutMediator -import com.google.gson.Gson import com.gyf.immersionbar.ktx.immersionBar +import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder +import com.shuyu.gsyvideoplayer.utils.GSYVideoHelper +import com.shuyu.gsyvideoplayer.utils.GSYVideoType class UserHomePageActivity : BaseActivity() { @@ -50,6 +46,9 @@ class UserHomePageActivity : BaseActivity() { val userHomeStateAdapter by lazy { UserHomeStateAdapter(this, userId) } + val videoHelper by lazy { + GSYVideoHelper(this) + } val appID by lazy { @@ -97,7 +96,22 @@ class UserHomePageActivity : BaseActivity() { } initButton() + loadVideo() + } + + fun loadVideo() { + viewBinding.coverView.visibility = View.INVISIBLE + viewBinding.appBar.setBackgroundResource(R.drawable.transparent) + viewBinding.tabLayout.setBackgroundResource(R.drawable.transparent) + viewBinding.videoView.setUp("http://39.105.229.249/resources/mp4/vicious.mp4", true, null) + videoHelper.setGsyVideoOptionBuilder( + GSYVideoHelper.GSYVideoHelperBuilder().setHideActionBar(true).setHideStatusBar(false) + ) + GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_FULL) + viewBinding.videoView.isLooping = true + viewBinding.videoView.isAutoFullWithSize = true + viewBinding.videoView.startPlayLogic() } /** @@ -193,9 +207,11 @@ class UserHomePageActivity : BaseActivity() { val gender = spaceInfoData.data.gender if (gender > 0) { - Glide.with(this).load(R.drawable.boy).apply(GlobalMethod.getRequestOptions()).into(viewBinding.genderView) + Glide.with(this).load(R.drawable.boy).apply(GlobalMethod.getRequestOptions()) + .into(viewBinding.genderView) } else { - Glide.with(this).load(R.drawable.girl).apply(GlobalMethod.getRequestOptions()).into(viewBinding.genderView) + Glide.with(this).load(R.drawable.girl).apply(GlobalMethod.getRequestOptions()) + .into(viewBinding.genderView) } val permission = spaceInfoData.data.permission @@ -229,7 +245,8 @@ class UserHomePageActivity : BaseActivity() { val cover = spaceInfoData.data.cover if (cover != null) { - Glide.with(this).load(ServerConfiguration.getRealLink(cover)).apply(GlobalMethod.getRequestOptions()) + Glide.with(this).load(ServerConfiguration.getRealLink(cover)) + .apply(GlobalMethod.getRequestOptions()) .into(viewBinding.coverView) } diff --git a/app/src/main/res/drawable/transparent.xml b/app/src/main/res/drawable/transparent.xml new file mode 100644 index 0000000..c7eb101 --- /dev/null +++ b/app/src/main/res/drawable/transparent.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_user_home_page.xml b/app/src/main/res/layout/activity_user_home_page.xml index 7ee18a8..89a9c0e 100644 --- a/app/src/main/res/layout/activity_user_home_page.xml +++ b/app/src/main/res/layout/activity_user_home_page.xml @@ -4,6 +4,18 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + + + + + + +