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
33f5c1d9
Commit
33f5c1d9
authored
May 30, 2022
by
范玉宾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
0875cc9f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
24 deletions
+52
-24
config.gradle
config.gradle
+4
-4
bg_meditation_video.png
m-home/src/main/res/drawable-xhdpi/bg_meditation_video.png
+0
-0
home_muse_view.xml
m-home/src/ydl/res/layout/home_muse_view.xml
+3
-3
PlayMeditationActivity.kt
m-muse/src/main/java/com/yidianling/muse/activity/PlayMeditationActivity.kt
+14
-7
MediaPlayerManager.kt
m-muse/src/main/java/com/yidianling/muse/helper/MediaPlayerManager.kt
+13
-7
bg_meditation_play_float.xml
m-muse/src/main/res/drawable/bg_meditation_play_float.xml
+2
-1
dialog_choose_music.xml
m-muse/src/main/res/layout/dialog_choose_music.xml
+16
-2
No files found.
config.gradle
View file @
33f5c1d9
...
...
@@ -9,12 +9,12 @@ ext {
"m-consultant"
:
"0.0.60.25"
,
"m-fm"
:
"0.0.30.08"
,
"m-user"
:
"0.0.62.24"
,
"m-home"
:
"0.0.23.7
5
"
,
"m-home"
:
"0.0.23.7
6
"
,
"m-im"
:
"0.0.21.44"
,
"m-dynamic"
:
"0.0.7.73"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.5
7
"
,
"m-muse"
:
"0.0.28.5
8
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.37"
,
...
...
@@ -94,12 +94,12 @@ ext {
"m-consultant"
:
"0.0.60.25"
,
"m-fm"
:
"0.0.30.08"
,
"m-user"
:
"0.0.62.24"
,
"m-home"
:
"0.0.23.7
5
"
,
"m-home"
:
"0.0.23.7
6
"
,
"m-im"
:
"0.0.21.44"
,
"m-dynamic"
:
"0.0.7.73"
,
"m-article"
:
"0.0.0.8"
,
"m-muse"
:
"0.0.28.5
7
"
,
"m-muse"
:
"0.0.28.5
8
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.37"
,
//-------------- 业务模块 API 层 --------------
...
...
m-home/src/main/res/drawable-xhdpi/bg_meditation_video.png
0 → 100644
View file @
33f5c1d9
255 KB
m-home/src/ydl/res/layout/home_muse_view.xml
View file @
33f5c1d9
...
...
@@ -31,10 +31,10 @@
android:focusable=
"false"
android:focusableInTouchMode=
"false"
/>
<View
<
Image
View
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:
background=
"#88999999
"
/>
android:
src=
"@drawable/bg_meditation_video
"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
...
...
@@ -84,7 +84,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"0.5dp"
android:layout_marginBottom=
"14dp"
android:background=
"#
66
FFFFFF"
/>
android:background=
"#
33
FFFFFF"
/>
<androidx.viewpager2.widget.ViewPager2
android:id=
"@+id/view_pager"
...
...
m-muse/src/main/java/com/yidianling/muse/activity/PlayMeditationActivity.kt
View file @
33f5c1d9
...
...
@@ -36,6 +36,8 @@ import com.yidianling.user.api.service.IUserService
import
de.greenrobot.event.EventBus
import
io.reactivex.Observable
import
io.reactivex.Observer
import
io.reactivex.Scheduler
import
io.reactivex.Single
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.disposables.Disposable
import
io.reactivex.functions.Consumer
...
...
@@ -45,6 +47,7 @@ import kotlinx.android.synthetic.main.activity_play_meditation.iv_close
import
kotlinx.android.synthetic.main.activity_play_meditation.tv_title
import
kotlinx.android.synthetic.main.layout_meditation_play_float_view.*
import
kotlinx.android.synthetic.main.player_control_view.*
import
org.reactivestreams.Subscription
import
java.util.*
import
java.util.concurrent.TimeUnit
import
kotlin.math.roundToInt
...
...
@@ -85,7 +88,7 @@ class PlayMeditationActivity : BaseActivity() {
private
var
isSeekbarChanging
=
false
private
var
mDisposable
:
Disposable
?
=
null
private
var
mObservable
:
Observable
<
Long
>?
=
null
private
lateinit
var
mObservable
:
Observable
<
Long
>
private
var
mObserver
:
Observer
<
Long
>?
=
null
private
var
mBuried
:
String
?
=
null
...
...
@@ -828,20 +831,25 @@ class PlayMeditationActivity : BaseActivity() {
tv_time_off_pure_music
.
visibility
=
View
.
VISIBLE
tv_time_off
.
visibility
=
View
.
GONE
mDisposable
?.
dispose
()
mDisposable
=
null
MediaPlayerManager
.
getInstance
(
this
)
?.
setTimeOffStatus
(
true
)
initRxTimeOff
((
minute
*
60
*
1000
).
toLong
(),
0
)
}
else
{
initPlayCompletionListener
(
isLoop
=
true
,
isSingle
=
false
)
tv_time_off_pure_music
.
visibility
=
View
.
GONE
tv_time_off
.
visibility
=
View
.
VISIBLE
mDisposable
?.
dispose
()
mDisposable
=
null
MediaPlayerManager
.
getInstance
(
this
)
?.
setTimeOffStatus
(
true
)
initRxTimeOff
((
minute
*
60
*
1000
).
toLong
(),
1
)
}
val
event
=
MeditationFloatEvent
(
false
,
time
=
(
minute
*
60
*
1000
).
toLong
())
EventBus
.
getDefault
().
post
(
event
)
}
else
{
initPlayCompletionListener
()
MediaPlayerManager
.
getInstance
(
this
)
?.
dispose
(
)
MediaPlayerManager
.
getInstance
(
this
)
?.
setTimeOffStatus
(
false
)
mDisposable
?.
dispose
()
mDisposable
=
null
tv_time_off
.
visibility
=
View
.
GONE
tv_time_off_pure_music
.
visibility
=
View
.
GONE
mMediaPlayer
?.
isLooping
=
false
...
...
@@ -866,13 +874,12 @@ class PlayMeditationActivity : BaseActivity() {
}
)
if
(
MediaPlayerManager
.
getInstance
(
this
)
?.
getTimeOffStatus
()
==
true
){
val
timeOff
=
MediaPlayerManager
.
getInstance
(
this
)
?.
getTimeOff
()
if
(
timeOff
!=
null
&&
timeOff
>
0
&&
mMeditationType
!=
null
){
mDisposable
?.
dispose
()
initRxTimeOff
(
timeOff
,
mMeditationType
!!
)
}
}
}
private
fun
initRxTimeOff
(
time
:
Long
,
meditationType
:
Int
)
{
...
...
@@ -899,7 +906,7 @@ class PlayMeditationActivity : BaseActivity() {
}
override
fun
onError
(
e
:
Throwable
)
{
mDisposable
?.
dispose
()
}
override
fun
onComplete
()
{
...
...
@@ -917,7 +924,7 @@ class PlayMeditationActivity : BaseActivity() {
}
if
(
mObserver
!=
null
&&
mObserver
is
Observer
<
Long
>)
{
mObservable
?
.
subscribe
(
mObserver
as
Observer
<
Long
>)
mObservable
.
subscribe
(
mObserver
as
Observer
<
Long
>)
}
if
(
mDisposable
?.
isDisposed
==
true
&&
mObserver
!=
null
&&
mObserver
is
Observer
<
Long
>)
{
...
...
m-muse/src/main/java/com/yidianling/muse/helper/MediaPlayerManager.kt
View file @
33f5c1d9
...
...
@@ -21,6 +21,7 @@ class MediaPlayerManager private constructor() {
private
var
mMediaId
:
Long
?
=
null
private
var
mTime
=
0L
private
var
mTimeOffStatus
=
false
private
var
mDisposable
:
Disposable
?
=
null
private
var
mObservable
:
Observable
<
Long
>?
=
null
...
...
@@ -34,6 +35,16 @@ class MediaPlayerManager private constructor() {
fun
getTimeOff
():
Long
=
mTime
fun
getTimeOffStatus
():
Boolean
=
mTimeOffStatus
fun
setTimeOffStatus
(
timeOffStatus
:
Boolean
){
mTimeOffStatus
=
timeOffStatus
}
fun
setTimeOff
(
time
:
Long
){
mTime
=
time
}
fun
setAudioPath
(
path
:
String
,
isLoop
:
Boolean
=
false
){
val
attrs
=
AudioAttributes
.
Builder
()
...
...
@@ -88,13 +99,7 @@ class MediaPlayerManager private constructor() {
fun
initRxTimeOff
(
time
:
Long
)
{
if
(
time
==
null
&&
time
<=
0
){
if
(
mObserver
!=
null
&&
mObserver
is
Observer
<
Long
>)
{
mObservable
?.
subscribe
(
mObserver
as
Observer
<
Long
>)
}
if
(
mDisposable
?.
isDisposed
==
true
&&
mObserver
!=
null
&&
mObserver
is
Observer
<
Long
>)
{
mObservable
?.
subscribe
(
mObserver
as
Observer
<
Long
>)
}
mDisposable
?.
dispose
()
}
mObservable
=
Observable
.
interval
(
0
,
1
,
TimeUnit
.
SECONDS
)
...
...
@@ -132,6 +137,7 @@ class MediaPlayerManager private constructor() {
}
fun
dispose
()
{
mTime
=
0
mDisposable
?.
dispose
()
}
...
...
m-muse/src/main/res/drawable/bg_meditation_play_float.xml
View file @
33f5c1d9
...
...
@@ -3,6 +3,6 @@
<corners
android:radius=
"12dp"
/>
<solid
android:color=
"#
99
000000"
/>
<solid
android:color=
"#
CC
000000"
/>
</shape>
\ No newline at end of file
m-muse/src/main/res/layout/dialog_choose_music.xml
View file @
33f5c1d9
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"150dp"
android:background=
"@drawable/shape_bg_solid_282e3f_r_top_20"
>
<androidx.cardview.widget.CardView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"-20dp"
app:cardCornerRadius=
"20dp"
>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<WebView
android:id=
"@+id/wv_choose_music"
android:layout_width=
"match_parent"
...
...
@@ -27,4 +36,8 @@
android:layout_marginTop=
"12dp"
/>
</LinearLayout>
</FrameLayout>
</androidx.cardview.widget.CardView>
</FrameLayout>
\ No newline at end of file
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