Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_vedio
Commits
cc7fb9fa
Commit
cc7fb9fa
authored
Jul 03, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化视频界面resume和pause状态
parent
839517aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
70 deletions
+81
-70
VideoActivity.kt
...rc/main/java/com/mints/wisdomclean/video/VideoActivity.kt
+78
-69
VideoBean.kt
...pp/src/main/java/com/mints/wisdomclean/video/VideoBean.kt
+3
-1
No files found.
video/app/src/main/java/com/mints/wisdomclean/video/VideoActivity.kt
View file @
cc7fb9fa
...
...
@@ -24,6 +24,21 @@ class VideoActivity : BaseActivity() {
override
fun
isApplyKitKatTranslucency
()
=
false
override
fun
onResume
()
{
super
.
onResume
()
Jzvd
.
goOnPlayOnResume
()
}
override
fun
onPause
()
{
super
.
onPause
()
Jzvd
.
goOnPlayOnPause
()
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
Jzvd
.
releaseAllVideos
()
}
fun
initView
()
{
val
recyViewLayoutManager
=
RecyViewLayoutManager
(
this
,
OrientationHelper
.
VERTICAL
...
...
@@ -54,7 +69,6 @@ class VideoActivity : BaseActivity() {
//滑动时,释放上一个
if
(
mCurrentPosition
==
position
)
{
Jzvd
.
releaseAllVideos
()
}
}
...
...
@@ -93,63 +107,6 @@ class VideoActivity : BaseActivity() {
})
}
//加载
fun
loadData
()
{
videos
.
add
(
VideoBean
(
6
,
"遵义观察 "
,
"https://p9-dy.byteimg.com/aweme/100x100/2e1ce00021ee51a2aacdc.jpeg?from=4010531038"
,
"老伴咱走!"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200fe10000bloib0nrri6bf7b1k4fg&ratio=720p&line=0"
,
"https://p29-dy.byteimg.com/obj/tos-cn-p-0015/601c6d730167431184c5412e81cd32d1?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
7
,
"BTV养生堂 "
,
"https://p6-dy-ipv6.byteimg.com/aweme/100x100/3151700027839b153b924.jpeg?from=4010531038"
,
"湿气过重,快收藏这个中医调理方!!"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200f730000bpebr0dqg5balrfhqlog&ratio=720p&line=0"
,
"https://p3-dy-ipv6.byteimg.com/obj/tos-cn-p-0015/0e99f0aca9764e7da53be1096a3bd641_1583136211?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
8
,
"河南都市频道 "
,
"https://p9-dy.byteimg.com/aweme/100x100/312a8000720705660b806.jpeg?from=4010531038"
,
"痛心!手扶梯绞断女童两根手指!带娃搭扶梯的一定要注意了!(上)!"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200f250000bgsu5vamac2seo2gp53g&ratio=720p&line=0"
,
"https://p1-dy-ipv6.byteimg.com/obj/160b4000aa3f373bd14cd?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
9
,
"科学小妙招 "
,
"https://p26-dy.byteimg.com/aweme/100x100/312090000434b4dd10244.jpeg?from=4010531038"
,
"不喜欢的衣服扔了可惜,这样改造一下非常酷#生活小妙招 #生活小技巧 #废物利用 @抖音小助手"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200fe10000bq2bf7s9hq5lufbuoflg&ratio=720p&line=0"
,
"https://p9-dy.byteimg.com/obj/tos-cn-p-0015/9a6784fcbf9b43849081d7a3388db08d_1585756125?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
10
,
"一起装修网 "
,
"https://p29-dy.byteimg.com/aweme/100x100/f77d000eae902034a2bf.jpeg?from=4010531038"
,
"#装修 #黑幕重重 怎样选购浴室柜?揭露浴室柜增项(增项:镜子,水龙头,软管等)@胡 一刀"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0300f9a0000belnavkqn5hfpb70b5kg&ratio=720p&line=0"
,
"https://p29-dy.byteimg.com/obj/c8f200068c30b23f1024?from=2563711402_large"
)
)
}
/**
* 滑动后自动播放。
...
...
@@ -166,17 +123,13 @@ class VideoActivity : BaseActivity() {
}
override
fun
onBackPressed
()
{
if
(
Jzvd
.
backPress
())
{
return
}
super
.
onBackPressed
()
}
override
fun
onPause
()
{
super
.
onPause
()
Jzvd
.
releaseAllVideos
()
}
// override fun onBackPressed() {
// if (Jzvd.backPress()) {
// Jzvd.releaseAllVideos()
// return
// }
// super.onBackPressed()
// }
fun
initData
()
{
videos
.
add
(
...
...
@@ -229,6 +182,62 @@ class VideoActivity : BaseActivity() {
"https://p9-dy.byteimg.com/obj/2c5c600050a7b42352869?from=2563711402_large"
)
)
}
//加载
fun
loadData
()
{
videos
.
add
(
VideoBean
(
6
,
"遵义观察 "
,
"https://p9-dy.byteimg.com/aweme/100x100/2e1ce00021ee51a2aacdc.jpeg?from=4010531038"
,
"老伴咱走!"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200fe10000bloib0nrri6bf7b1k4fg&ratio=720p&line=0"
,
"https://p29-dy.byteimg.com/obj/tos-cn-p-0015/601c6d730167431184c5412e81cd32d1?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
7
,
"BTV养生堂 "
,
"https://p6-dy-ipv6.byteimg.com/aweme/100x100/3151700027839b153b924.jpeg?from=4010531038"
,
"湿气过重,快收藏这个中医调理方!!"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200f730000bpebr0dqg5balrfhqlog&ratio=720p&line=0"
,
"https://p3-dy-ipv6.byteimg.com/obj/tos-cn-p-0015/0e99f0aca9764e7da53be1096a3bd641_1583136211?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
8
,
"河南都市频道 "
,
"https://p9-dy.byteimg.com/aweme/100x100/312a8000720705660b806.jpeg?from=4010531038"
,
"痛心!手扶梯绞断女童两根手指!带娃搭扶梯的一定要注意了!(上)!"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200f250000bgsu5vamac2seo2gp53g&ratio=720p&line=0"
,
"https://p1-dy-ipv6.byteimg.com/obj/160b4000aa3f373bd14cd?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
9
,
"科学小妙招 "
,
"https://p26-dy.byteimg.com/aweme/100x100/312090000434b4dd10244.jpeg?from=4010531038"
,
"不喜欢的衣服扔了可惜,这样改造一下非常酷#生活小妙招 #生活小技巧 #废物利用 @抖音小助手"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200fe10000bq2bf7s9hq5lufbuoflg&ratio=720p&line=0"
,
"https://p9-dy.byteimg.com/obj/tos-cn-p-0015/9a6784fcbf9b43849081d7a3388db08d_1585756125?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
10
,
"一起装修网 "
,
"https://p29-dy.byteimg.com/aweme/100x100/f77d000eae902034a2bf.jpeg?from=4010531038"
,
"#装修 #黑幕重重 怎样选购浴室柜?揭露浴室柜增项(增项:镜子,水龙头,软管等)@胡 一刀"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0300f9a0000belnavkqn5hfpb70b5kg&ratio=720p&line=0"
,
"https://p29-dy.byteimg.com/obj/c8f200068c30b23f1024?from=2563711402_large"
)
)
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/video/VideoBean.kt
View file @
cc7fb9fa
package
com.mints.wisdomclean.video
import
java.io.Serializable
/**
* author : ChenWenJie
* email : 1181620038@qq.com
* date : 2020/9/22
* desc : 视频实体类
*/
class
VideoBean
{
class
VideoBean
:
Serializable
{
// ID
var
id
:
Int
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment