Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
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
杨凯
YDL-Component-Medical
Commits
3c51b5b3
Commit
3c51b5b3
authored
May 28, 2022
by
范玉宾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
parent
f870d439
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
55 deletions
+50
-55
PlayFragment.java
app/src/main/java/com/ydl/component/music/PlayFragment.java
+1
-1
config.gradle
config.gradle
+2
-2
PlayMeditationActivity.kt
m-muse/src/main/java/com/yidianling/muse/activity/PlayMeditationActivity.kt
+15
-8
MeditationFloatEvent.kt
m-muse/src/main/java/com/yidianling/muse/event/MeditationFloatEvent.kt
+4
-3
MeditationWindowService.kt
m-muse/src/main/java/com/yidianling/muse/service/MeditationWindowService.kt
+27
-40
activity_play_meditation.xml
m-muse/src/main/res/layout/activity_play_meditation.xml
+1
-1
No files found.
app/src/main/java/com/ydl/component/music/PlayFragment.java
View file @
3c51b5b3
...
...
@@ -67,7 +67,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
EventBus
.
getDefault
().
register
(
this
);
initPlayMode
();
MeditationFloatEvent
event
=
new
MeditationFloatEvent
(
false
,
true
,
null
,
null
);
MeditationFloatEvent
event
=
new
MeditationFloatEvent
(
false
,
true
,
null
,
null
,
null
);
EventBus
.
getDefault
().
post
(
event
);
onChangeImpl
(
AudioPlayer
.
Companion
.
get
().
getPlayMusic
());
...
...
config.gradle
View file @
3c51b5b3
...
...
@@ -14,7 +14,7 @@ ext {
"m-dynamic"
:
"0.0.7.73"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.4
6
"
,
"m-muse"
:
"0.0.28.4
7
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.37"
,
...
...
@@ -99,7 +99,7 @@ ext {
"m-dynamic"
:
"0.0.7.73"
,
"m-article"
:
"0.0.0.8"
,
"m-muse"
:
"0.0.28.4
6
"
,
"m-muse"
:
"0.0.28.4
7
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.37"
,
//-------------- 业务模块 API 层 --------------
...
...
m-muse/src/main/java/com/yidianling/muse/activity/PlayMeditationActivity.kt
View file @
3c51b5b3
...
...
@@ -357,6 +357,7 @@ class PlayMeditationActivity : BaseActivity() {
isComplete
=
0
)
stopPlay
()
finish
()
}
else
{
stopPlay
()
finish
()
...
...
@@ -679,16 +680,22 @@ class PlayMeditationActivity : BaseActivity() {
}
private
fun
initPlayCompletionListener
(
isLoop
:
Boolean
=
false
,
isSingle
:
Boolean
=
false
)
{
mMediaPlayer
?.
setOnCompletionListener
{
val
playTime
=
(
seekbar_play_progress
.
progress
/
1000.00
).
roundToInt
()
MediaPlayerTimeUtil
.
uploadPlayRecord
(
meditationId
=
mMeditationId
?.
toInt
(),
mediaId
=
mMediaId
,
isQuit
=
0
,
playTime
=
playTime
,
isComplete
=
1
)
val
duration
=
currentMeditation
?.
duration
?.
toInt
()
?:
0
val
currentDuration
=
mMediaPlayer
?.
currentPosition
?:
0
if
(
currentDuration
==
duration
){
val
playTime
=
(
seekbar_play_progress
.
progress
/
1000.00
).
roundToInt
()
MediaPlayerTimeUtil
.
uploadPlayRecord
(
meditationId
=
mMeditationId
?.
toInt
(),
mediaId
=
mMediaId
,
isQuit
=
0
,
playTime
=
playTime
,
isComplete
=
1
)
}
if
(
isLoop
){
if
(
isSingle
||
meditations
.
size
==
1
){
...
...
m-muse/src/main/java/com/yidianling/muse/event/MeditationFloatEvent.kt
View file @
3c51b5b3
...
...
@@ -4,8 +4,9 @@ import com.yidianling.muse.bean.MeditationPlayModuleBean
class
MeditationFloatEvent
(
val
show
:
Boolean
,
val
stop
:
Boolean
?=
null
,
val
time
:
Long
?=
null
,
val
meditation
:
MeditationPlayModuleBean
.
MeditationDetail
?=
null
val
stop
:
Boolean
?
=
null
,
val
time
:
Long
?
=
null
,
val
meditation
:
MeditationPlayModuleBean
.
MeditationDetail
?
=
null
,
val
meditations
:
ArrayList
<
MeditationPlayModuleBean
.
MeditationDetail
>?
=
null
)
m-muse/src/main/java/com/yidianling/muse/service/MeditationWindowService.kt
View file @
3c51b5b3
...
...
@@ -151,7 +151,6 @@ class MeditationWindowService : LifecycleService() {
}
}
mSeekBar
.
progress
=
2
mSeekBar
.
max
=
event
.
meditation
?.
duration
?.
toInt
()
?:
0
...
...
@@ -235,12 +234,22 @@ class MeditationWindowService : LifecycleService() {
},
0
,
50
)
mMediaPlayer
?.
setOnCompletionListener
{
postPlayRecord
(
0
,
(
ivProgress
?.
curProcess
?.
div
(
1000.00
))
?.
roundToInt
()
?:
0
,
1
,
meditation
.
meditationId
.
toInt
(),
meditation
.
mediaId
?:
0L
)
val
duration
=
meditation
?.
duration
?.
toInt
()
?:
0
val
currentDuration
=
mMediaPlayer
?.
currentPosition
?:
0
if
(
meditation
.
mediaId
!=
null
&&
meditation
.
meditationId
!=
null
){
val
playTime
=
(
ivProgress
?.
curProcess
?.
div
(
1000.00
))
?.
roundToInt
()
?:
0
if
(
duration
==
currentDuration
){
MediaPlayerTimeUtil
.
uploadPlayRecord
(
meditationId
=
meditation
.
meditationId
.
toInt
(),
mediaId
=
meditation
.
mediaId
,
isQuit
=
0
,
playTime
=
playTime
,
isComplete
=
1
)
}
}
if
(
mMediaPlayer
?.
isPlaying
==
true
)
{
ivPlayOrPause
?.
setImageResource
(
R
.
drawable
.
icon_meditation_float_play
)
}
else
{
...
...
@@ -252,12 +261,17 @@ class MeditationWindowService : LifecycleService() {
//悬浮窗关闭点击事件
ActionCountUtils
.
count
(
MuseBIConstants
.
YDL_MUSE_MEDITATION_WINDOW_CLOSE_CLICK
,
""
)
postPlayRecord
(
1
,
(
ivProgress
?.
curProcess
?.
div
(
1000.00
))
?.
roundToInt
()
?:
0
,
0
,
meditation
.
meditationId
.
toInt
(),
meditation
.
mediaId
?:
0L
)
if
(
meditation
.
mediaId
!=
null
&&
meditation
.
meditationId
!=
null
){
val
playTime
=
(
ivProgress
?.
curProcess
?.
div
(
1000.00
))
?.
roundToInt
()
?:
0
MediaPlayerTimeUtil
.
uploadPlayRecord
(
meditationId
=
meditation
.
meditationId
.
toInt
(),
mediaId
=
meditation
.
mediaId
,
isQuit
=
0
,
playTime
=
playTime
,
isComplete
=
0
)
}
MediaPlayerManager
.
getInstance
(
this
)
?.
stop
()
hideFloatWindow
()
}
...
...
@@ -344,30 +358,4 @@ class MeditationWindowService : LifecycleService() {
}
private
fun
postPlayRecord
(
isQuit
:
Int
,
playTime
:
Int
,
isComplete
:
Int
,
meditationId
:
Int
,
mediaId
:
Long
)
{
MuseHttp
.
getInstance
().
postMeditationPlayRecord
(
meditationId
=
meditationId
,
isQuit
=
isQuit
,
mediaId
=
mediaId
,
playTime
=
playTime
,
isComplete
=
isComplete
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
},
{
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
}
}
})
}
}
\ No newline at end of file
m-muse/src/main/res/layout/activity_play_meditation.xml
View file @
3c51b5b3
...
...
@@ -6,7 +6,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#
CC282E3F
"
>
android:background=
"#
B3000000
"
>
<ImageView
android:id=
"@+id/iv_bg"
...
...
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