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
0875cc9f
Commit
0875cc9f
authored
May 30, 2022
by
范玉宾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
currentDuration value err & tips content err
parent
efb77ca4
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
61 additions
and
37 deletions
+61
-37
config.gradle
config.gradle
+4
-4
bg_meditation_type.xml
m-home/src/main/res/drawable/bg_meditation_type.xml
+17
-0
layout_meditation_item.xml
m-home/src/ydl/res/layout/layout_meditation_item.xml
+10
-8
AndroidManifest.xml
m-muse/src/main/AndroidManifest.xml
+2
-2
MeditationTimeOffActivity.kt
m-muse/src/main/java/com/yidianling/muse/activity/MeditationTimeOffActivity.kt
+1
-1
PlayMeditationActivity.kt
m-muse/src/main/java/com/yidianling/muse/activity/PlayMeditationActivity.kt
+7
-9
MediaPlayerManager.kt
m-muse/src/main/java/com/yidianling/muse/helper/MediaPlayerManager.kt
+11
-1
MeditationWindowService.kt
m-muse/src/main/java/com/yidianling/muse/service/MeditationWindowService.kt
+2
-2
activity_play_meditation.xml
m-muse/src/main/res/layout/activity_play_meditation.xml
+2
-2
layout_quit_meditation.xml
m-muse/src/main/res/layout/layout_quit_meditation.xml
+2
-2
styles.xml
m-muse/src/main/res/values/styles.xml
+3
-6
No files found.
config.gradle
View file @
0875cc9f
...
...
@@ -8,13 +8,13 @@ ext {
"m-confide"
:
"0.0.49.74"
,
"m-consultant"
:
"0.0.60.25"
,
"m-fm"
:
"0.0.30.08"
,
"m-user"
:
"0.0.62.
19
"
,
"m-user"
:
"0.0.62.
24
"
,
"m-home"
:
"0.0.23.75"
,
"m-im"
:
"0.0.21.44"
,
"m-dynamic"
:
"0.0.7.73"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.5
6
"
,
"m-muse"
:
"0.0.28.5
7
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.37"
,
...
...
@@ -93,13 +93,13 @@ ext {
"m-confide"
:
"0.0.49.74"
,
"m-consultant"
:
"0.0.60.25"
,
"m-fm"
:
"0.0.30.08"
,
"m-user"
:
"0.0.62.
19
"
,
"m-user"
:
"0.0.62.
24
"
,
"m-home"
:
"0.0.23.75"
,
"m-im"
:
"0.0.21.44"
,
"m-dynamic"
:
"0.0.7.73"
,
"m-article"
:
"0.0.0.8"
,
"m-muse"
:
"0.0.28.5
6
"
,
"m-muse"
:
"0.0.28.5
7
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.37"
,
//-------------- 业务模块 API 层 --------------
...
...
m-home/src/main/res/drawable/bg_meditation_type.xml
0 → 100644
View file @
0875cc9f
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:width=
"105dp"
android:height=
"30dp"
>
<shape
android:shape=
"rectangle"
>
<gradient
android:type=
"linear"
android:useLevel=
"true"
android:startColor=
"#88000000"
android:endColor=
"#00282727"
android:angle=
"90"
/>
<corners
android:topLeftRadius=
"0dp"
android:topRightRadius=
"0dp"
android:bottomLeftRadius=
"8dp"
android:bottomRightRadius=
"8dp"
/>
</shape>
</item>
</layer-list>
m-home/src/ydl/res/layout/layout_meditation_item.xml
View file @
0875cc9f
...
...
@@ -30,23 +30,25 @@
android:layout_height=
"102dp"
android:scaleType=
"centerCrop"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#88000000"
/>
<!-- <View-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="30dp"-->
<!-- android:background="#88000000"-->
<!-- android:layout_gravity="bottom|start" />-->
<TextView
android:id=
"@+id/tv_meditation_type"
android:layout_width=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom|start"
tools:text=
"溪流"
android:background=
"@drawable/bg_meditation_type"
tools:text=
"溪流溪流溪流溪流溪流"
android:singleLine=
"true"
android:ellipsize=
"end"
android:textColor=
"@color/white"
android:textSize=
"14sp"
android:
layout_margin
Horizontal=
"6dp"
android:
layout_marginVertical=
"5dp"
/>
android:
padding
Horizontal=
"6dp"
android:
paddingVertical=
"5dp"
/>
</FrameLayout>
...
...
m-muse/src/main/AndroidManifest.xml
View file @
0875cc9f
...
...
@@ -16,11 +16,11 @@
<activity
android:name=
".activity.PlayMeditationActivity"
android:screenOrientation=
"portrait"
android:theme=
"@style/
platform_NoTitleTheme
"
/>
android:theme=
"@style/
muse_Transparent
"
/>
<activity
android:name=
".activity.MeditationTimeOffActivity"
android:screenOrientation=
"portrait"
android:theme=
"@style/
platform_NoTitleTheme
"
/>
android:theme=
"@style/
muse_Transparent
"
/>
<activity
android:name=
".activity.ChooseMusicActivity"
android:screenOrientation=
"portrait"
android:theme=
"@style/un_full_screen_activity"
/>
...
...
m-muse/src/main/java/com/yidianling/muse/activity/MeditationTimeOffActivity.kt
View file @
0875cc9f
...
...
@@ -105,7 +105,7 @@ class MeditationTimeOffActivity : BaseActivity() {
}
override
fun
initDataAndEvent
()
{
StatusBarUtils
.
setTransparent
(
this
)
}
override
fun
layoutResId
():
Int
{
...
...
m-muse/src/main/java/com/yidianling/muse/activity/PlayMeditationActivity.kt
View file @
0875cc9f
...
...
@@ -17,12 +17,10 @@ import com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.event.MeditationEvent
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.StatusBarUtils.Companion.setTransparentForImageView
import
com.ydl.ydlcommon.utils.StatusBarUtils.Companion.statusBarLightMode
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.remind.ToastHelper.Companion.show
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.home.http.MuseHttp
import
com.yidianling.muse.R
...
...
@@ -99,8 +97,6 @@ class PlayMeditationActivity : BaseActivity() {
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
setTransparentForImageView
(
this
,
null
)
statusBarLightMode
(
this
)
super
.
onCreate
(
savedInstanceState
)
PlayerFloatHelper
.
removeView
(
mContext
)
...
...
@@ -121,8 +117,8 @@ class PlayMeditationActivity : BaseActivity() {
getData
()
}
override
fun
initDataAndEvent
()
{
StatusBarUtils
.
setTransparent
(
this
)
}
private
fun
getData
()
{
...
...
@@ -561,7 +557,7 @@ class PlayMeditationActivity : BaseActivity() {
initMediaPlayer
(
mMediaUrl
,
currentPosition
,
mMediaIdFromLocal
==
mMediaId
)
}
else
{
ToastUtil
.
toastShort
(
"
当前已经是第一首
"
)
ToastUtil
.
toastShort
(
"
暂无内容
"
)
}
}
...
...
@@ -600,7 +596,7 @@ class PlayMeditationActivity : BaseActivity() {
initMediaPlayer
(
mMediaUrl
,
currentPosition
,
mMediaIdFromLocal
==
mMediaId
)
}
else
{
ToastUtil
.
toastShort
(
"
当前已经是最后一首
"
)
ToastUtil
.
toastShort
(
"
暂无内容
"
)
}
}
...
...
@@ -692,7 +688,7 @@ class PlayMeditationActivity : BaseActivity() {
mMediaPlayer
?.
setOnCompletionListener
{
val
duration
=
currentMeditation
?.
duration
?.
toInt
()
?:
0
val
currentDuration
=
mMediaPlayer
?.
currentPosition
?:
0
val
currentDuration
=
(
mMediaPlayer
?.
currentPosition
?:
0
)/
100
0
if
(
currentDuration
==
duration
){
val
playTime
=
(
seekbar_play_progress
.
progress
/
1000.00
).
roundToInt
()
...
...
@@ -844,6 +840,7 @@ class PlayMeditationActivity : BaseActivity() {
EventBus
.
getDefault
().
post
(
event
)
}
else
{
initPlayCompletionListener
()
MediaPlayerManager
.
getInstance
(
this
)
?.
dispose
()
mDisposable
?.
dispose
()
tv_time_off
.
visibility
=
View
.
GONE
tv_time_off_pure_music
.
visibility
=
View
.
GONE
...
...
@@ -871,6 +868,7 @@ class PlayMeditationActivity : BaseActivity() {
val
timeOff
=
MediaPlayerManager
.
getInstance
(
this
)
?.
getTimeOff
()
if
(
timeOff
!=
null
&&
timeOff
>
0
&&
mMeditationType
!=
null
){
mDisposable
?.
dispose
()
initRxTimeOff
(
timeOff
,
mMeditationType
!!
)
}
...
...
m-muse/src/main/java/com/yidianling/muse/helper/MediaPlayerManager.kt
View file @
0875cc9f
...
...
@@ -87,6 +87,16 @@ 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
>)
}
}
mObservable
=
Observable
.
interval
(
0
,
1
,
TimeUnit
.
SECONDS
)
.
take
(
time
/
1000
+
1
)
.
map
{
t
->
time
-
t
*
1000
}
...
...
@@ -121,7 +131,7 @@ class MediaPlayerManager private constructor() {
}
private
fun
dispose
()
{
fun
dispose
()
{
mDisposable
?.
dispose
()
}
...
...
m-muse/src/main/java/com/yidianling/muse/service/MeditationWindowService.kt
View file @
0875cc9f
...
...
@@ -24,6 +24,7 @@ import com.bumptech.glide.Glide
import
com.bumptech.glide.load.resource.bitmap.GranularRoundedCorners
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.home.http.MuseHttp
import
com.yidianling.muse.R
import
com.yidianling.muse.activity.PlayMeditationActivity
...
...
@@ -239,8 +240,7 @@ class MeditationWindowService : LifecycleService() {
mMediaPlayer
?.
setOnCompletionListener
{
val
duration
=
meditation
?.
duration
?.
toInt
()
?:
0
val
currentDuration
=
mMediaPlayer
?.
currentPosition
?:
0
val
currentDuration
=
(
mMediaPlayer
?.
currentPosition
?:
0
)/
1000
if
(
meditation
.
mediaId
!=
null
&&
meditation
.
meditationId
!=
null
){
val
playTime
=
(
ivProgress
?.
curProcess
?.
div
(
1000.00
))
?.
roundToInt
()
?:
0
if
(
duration
==
currentDuration
){
...
...
m-muse/src/main/res/layout/activity_play_meditation.xml
View file @
0875cc9f
...
...
@@ -5,7 +5,6 @@
android:id=
"@+id/root_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fitsSystemWindows=
"false"
android:background=
"#B3000000"
>
<ImageView
...
...
@@ -22,7 +21,8 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:paddingTop=
"30dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/csl_layout"
...
...
m-muse/src/main/res/layout/layout_quit_meditation.xml
View file @
0875cc9f
...
...
@@ -20,7 +20,7 @@
<View
android:layout_width=
"match_parent"
android:layout_height=
"0.5dp"
android:background=
"#
FF
D8D8D8"
/>
android:background=
"#
88
D8D8D8"
/>
<LinearLayout
android:layout_width=
"match_parent"
...
...
@@ -40,7 +40,7 @@
<View
android:layout_width=
"0.5dp"
android:layout_height=
"match_parent"
android:background=
"#
FF
D8D8D8"
/>
android:background=
"#
88
D8D8D8"
/>
<TextView
android:id=
"@+id/tv_cancel_quit"
...
...
m-muse/src/main/res/values/styles.xml
View file @
0875cc9f
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style
name=
"muse_Transparent"
parent=
"@style/Base.Theme.AppCompat"
>
<item
name=
"colorPrimary"
>
@color/transparent
</item>
<item
name=
"colorPrimaryDark"
>
@color/transparent
</item>
<item
name=
"android:windowBackground"
>
@color/transparent
</item>
<item
name=
"android:windowNoTitle"
>
true
</item>
<item
name=
"android:windowIsTranslucent"
>
true
</item>
<style
name=
"muse_Transparent"
parent=
"Theme.AppCompat.DayNight.NoActionBar"
>
<item
name=
"android:windowTranslucentStatus"
>
true
</item>
<item
name=
"android:statusBarColor"
>
@android:color/transparent
</item>
</style>
<style
name=
"share_meditation_dialog"
parent=
"Theme.Design.BottomSheetDialog"
>
...
...
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