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