Commit 0875cc9f by 范玉宾

currentDuration value err & tips content err

parent efb77ca4
...@@ -8,13 +8,13 @@ ext { ...@@ -8,13 +8,13 @@ ext {
"m-confide" : "0.0.49.74", "m-confide" : "0.0.49.74",
"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.19", "m-user" : "0.0.62.24",
"m-home" : "0.0.23.75", "m-home" : "0.0.23.75",
"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.56", "m-muse" : "0.0.28.57",
"m-tests" : "0.0.24.18", "m-tests" : "0.0.24.18",
"m-course" : "0.0.43.37", "m-course" : "0.0.43.37",
...@@ -93,13 +93,13 @@ ext { ...@@ -93,13 +93,13 @@ ext {
"m-confide" : "0.0.49.74", "m-confide" : "0.0.49.74",
"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.19", "m-user" : "0.0.62.24",
"m-home" : "0.0.23.75", "m-home" : "0.0.23.75",
"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.56", "m-muse" : "0.0.28.57",
"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 层 --------------
......
<?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>
...@@ -30,23 +30,25 @@ ...@@ -30,23 +30,25 @@
android:layout_height="102dp" android:layout_height="102dp"
android:scaleType="centerCrop"/> android:scaleType="centerCrop"/>
<View <!-- <View-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="match_parent" <!-- android:layout_height="30dp"-->
android:background="#88000000"/> <!-- android:background="#88000000"-->
<!-- android:layout_gravity="bottom|start" />-->
<TextView <TextView
android:id="@+id/tv_meditation_type" android:id="@+id/tv_meditation_type"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|start" android:layout_gravity="bottom|start"
tools:text="溪流" android:background="@drawable/bg_meditation_type"
tools:text="溪流溪流溪流溪流溪流"
android:singleLine="true" android:singleLine="true"
android:ellipsize="end" android:ellipsize="end"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14sp" android:textSize="14sp"
android:layout_marginHorizontal="6dp" android:paddingHorizontal="6dp"
android:layout_marginVertical="5dp" /> android:paddingVertical="5dp"/>
</FrameLayout> </FrameLayout>
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
<activity <activity
android:name=".activity.PlayMeditationActivity" android:name=".activity.PlayMeditationActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/muse_Transparent" />
<activity <activity
android:name=".activity.MeditationTimeOffActivity" android:name=".activity.MeditationTimeOffActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/muse_Transparent" />
<activity android:name=".activity.ChooseMusicActivity" <activity android:name=".activity.ChooseMusicActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/un_full_screen_activity"/> android:theme="@style/un_full_screen_activity"/>
......
...@@ -105,7 +105,7 @@ class MeditationTimeOffActivity : BaseActivity() { ...@@ -105,7 +105,7 @@ class MeditationTimeOffActivity : BaseActivity() {
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
StatusBarUtils.setTransparent(this)
} }
override fun layoutResId(): Int { override fun layoutResId(): Int {
......
...@@ -17,12 +17,10 @@ import com.ydl.ydlcommon.base.BaseActivity ...@@ -17,12 +17,10 @@ import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.event.MeditationEvent import com.ydl.ydlcommon.event.MeditationEvent
import com.ydl.ydlcommon.modular.ModularServiceManager 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.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper.Companion.show import com.ydl.ydlcommon.utils.remind.ToastHelper.Companion.show
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.home.http.MuseHttp import com.yidianling.home.http.MuseHttp
import com.yidianling.muse.R import com.yidianling.muse.R
...@@ -99,8 +97,6 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -99,8 +97,6 @@ class PlayMeditationActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
setTransparentForImageView(this, null)
statusBarLightMode(this)
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
PlayerFloatHelper.removeView(mContext) PlayerFloatHelper.removeView(mContext)
...@@ -121,8 +117,8 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -121,8 +117,8 @@ class PlayMeditationActivity : BaseActivity() {
getData() getData()
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
StatusBarUtils.setTransparent(this)
} }
private fun getData() { private fun getData() {
...@@ -561,7 +557,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -561,7 +557,7 @@ class PlayMeditationActivity : BaseActivity() {
initMediaPlayer(mMediaUrl, currentPosition, mMediaIdFromLocal == mMediaId) initMediaPlayer(mMediaUrl, currentPosition, mMediaIdFromLocal == mMediaId)
} else { } else {
ToastUtil.toastShort("当前已经是第一首") ToastUtil.toastShort("暂无内容")
} }
} }
...@@ -600,7 +596,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -600,7 +596,7 @@ class PlayMeditationActivity : BaseActivity() {
initMediaPlayer(mMediaUrl, currentPosition, mMediaIdFromLocal == mMediaId) initMediaPlayer(mMediaUrl, currentPosition, mMediaIdFromLocal == mMediaId)
} else { } else {
ToastUtil.toastShort("当前已经是最后一首") ToastUtil.toastShort("暂无内容")
} }
} }
...@@ -692,7 +688,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -692,7 +688,7 @@ class PlayMeditationActivity : BaseActivity() {
mMediaPlayer?.setOnCompletionListener { mMediaPlayer?.setOnCompletionListener {
val duration = currentMeditation?.duration?.toInt()?:0 val duration = currentMeditation?.duration?.toInt()?:0
val currentDuration = mMediaPlayer?.currentPosition?:0 val currentDuration = (mMediaPlayer?.currentPosition?:0)/1000
if(currentDuration==duration){ if(currentDuration==duration){
val playTime = (seekbar_play_progress.progress / 1000.00).roundToInt() val playTime = (seekbar_play_progress.progress / 1000.00).roundToInt()
...@@ -844,6 +840,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -844,6 +840,7 @@ class PlayMeditationActivity : BaseActivity() {
EventBus.getDefault().post(event) EventBus.getDefault().post(event)
} else { } else {
initPlayCompletionListener() initPlayCompletionListener()
MediaPlayerManager.getInstance(this)?.dispose()
mDisposable?.dispose() mDisposable?.dispose()
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
...@@ -871,6 +868,7 @@ class PlayMeditationActivity : BaseActivity() { ...@@ -871,6 +868,7 @@ class PlayMeditationActivity : BaseActivity() {
val timeOff = MediaPlayerManager.getInstance(this)?.getTimeOff() val timeOff = MediaPlayerManager.getInstance(this)?.getTimeOff()
if (timeOff!=null && timeOff>0 && mMeditationType!=null){ if (timeOff!=null && timeOff>0 && mMeditationType!=null){
mDisposable?.dispose()
initRxTimeOff(timeOff, mMeditationType!!) initRxTimeOff(timeOff, mMeditationType!!)
} }
......
...@@ -87,6 +87,16 @@ class MediaPlayerManager private constructor() { ...@@ -87,6 +87,16 @@ class MediaPlayerManager private constructor() {
} }
fun initRxTimeOff(time: Long) { 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) mObservable = Observable.interval(0, 1, TimeUnit.SECONDS)
.take(time / 1000 + 1) .take(time / 1000 + 1)
.map { t -> time - t * 1000 } .map { t -> time - t * 1000 }
...@@ -121,7 +131,7 @@ class MediaPlayerManager private constructor() { ...@@ -121,7 +131,7 @@ class MediaPlayerManager private constructor() {
} }
private fun dispose() { fun dispose() {
mDisposable?.dispose() mDisposable?.dispose()
} }
......
...@@ -24,6 +24,7 @@ import com.bumptech.glide.Glide ...@@ -24,6 +24,7 @@ import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.GranularRoundedCorners import com.bumptech.glide.load.resource.bitmap.GranularRoundedCorners
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.home.http.MuseHttp import com.yidianling.home.http.MuseHttp
import com.yidianling.muse.R import com.yidianling.muse.R
import com.yidianling.muse.activity.PlayMeditationActivity import com.yidianling.muse.activity.PlayMeditationActivity
...@@ -239,8 +240,7 @@ class MeditationWindowService : LifecycleService() { ...@@ -239,8 +240,7 @@ class MeditationWindowService : LifecycleService() {
mMediaPlayer?.setOnCompletionListener { mMediaPlayer?.setOnCompletionListener {
val duration = meditation?.duration?.toInt()?:0 val duration = meditation?.duration?.toInt()?:0
val currentDuration = mMediaPlayer?.currentPosition?:0 val currentDuration = (mMediaPlayer?.currentPosition?:0)/1000
if(meditation.mediaId!=null && meditation.meditationId!=null){ if(meditation.mediaId!=null && meditation.meditationId!=null){
val playTime = (ivProgress?.curProcess?.div(1000.00))?.roundToInt() ?: 0 val playTime = (ivProgress?.curProcess?.div(1000.00))?.roundToInt() ?: 0
if(duration == currentDuration){ if(duration == currentDuration){
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
android:id="@+id/root_layout" android:id="@+id/root_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="false"
android:background="#B3000000"> android:background="#B3000000">
<ImageView <ImageView
...@@ -22,7 +21,8 @@ ...@@ -22,7 +21,8 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:paddingTop="30dp">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/csl_layout" android:id="@+id/csl_layout"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0.5dp" android:layout_height="0.5dp"
android:background="#FFD8D8D8"/> android:background="#88D8D8D8"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<View <View
android:layout_width="0.5dp" android:layout_width="0.5dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#FFD8D8D8"/> android:background="#88D8D8D8"/>
<TextView <TextView
android:id="@+id/tv_cancel_quit" android:id="@+id/tv_cancel_quit"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="muse_Transparent" parent="@style/Base.Theme.AppCompat"> <style name="muse_Transparent" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="colorPrimary">@color/transparent</item> <item name="android:windowTranslucentStatus">true</item>
<item name="colorPrimaryDark">@color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">true</item>
</style> </style>
<style name="share_meditation_dialog" parent="Theme.Design.BottomSheetDialog"> <style name="share_meditation_dialog" parent="Theme.Design.BottomSheetDialog">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment