Commit 4264b44f by 范玉宾

Merge branch 'd/lancet/4.3.93_muse' into d/4.3.93_muse

# Conflicts:
#	config.gradle
#	m-muse/src/main/res/layout/activity_play_meditation.xml
parents b4051592 37323969
...@@ -53,10 +53,13 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -53,10 +53,13 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
DemoContract.View { DemoContract.View {
private var secretDescriptionDialog: SecretDescriptionDialog? = null private var secretDescriptionDialog: SecretDescriptionDialog? = null
private var serviceConnection: ServiceConnection? = null private var serviceConnection: ServiceConnection? = null
private var meditationServiceConnection:ServiceConnection? = null
private var secretDialog: SecretDialog? = null private var secretDialog: SecretDialog? = null
protected var playService: PlayService? = null protected var playService: PlayService? = null
private var meditationIntent:Intent?=null protected var meditationService:MeditationWindowService?=null
override fun getContentViewId(): Int { override fun getContentViewId(): Int {
return R.id.lce_content_view return R.id.lce_content_view
...@@ -89,9 +92,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -89,9 +92,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
// 初始化一键登录sdk // 初始化一键登录sdk
OneKeyLoginHelp.sdkInit(this, OneKeyLoginHelp.YDL_USER_APP, PhoneNumberAuthHelper.SERVICE_TYPE_LOGIN) OneKeyLoginHelp.sdkInit(this, OneKeyLoginHelp.YDL_USER_APP, PhoneNumberAuthHelper.SERVICE_TYPE_LOGIN)
bindService() bindService()
bindMeditationService()
meditationIntent = Intent(this,MeditationWindowService::class.java)
startService(meditationIntent)
reLoadData() reLoadData()
requestPermission() requestPermission()
...@@ -264,6 +265,13 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -264,6 +265,13 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE) bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE)
} }
private fun bindMeditationService(){
val intent = Intent()
intent.setClass(this,MeditationWindowService::class.java)
meditationServiceConnection = MeditationServiceConnection()
bindService(intent,meditationServiceConnection,Context.BIND_AUTO_CREATE)
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
MobclickAgent.onResume(this) MobclickAgent.onResume(this)
...@@ -287,10 +295,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -287,10 +295,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
if (serviceConnection != null) { if (serviceConnection != null) {
unbindService(serviceConnection) unbindService(serviceConnection)
} }
if(meditationIntent!=null){ if(meditationServiceConnection!=null){
EventBus.getDefault().post(MeditationFloatEvent(false)) EventBus.getDefault().post(MeditationFloatEvent(false))
MediaPlayerManager.getInstance(this)?.stop() MediaPlayerManager.getInstance(this)?.stop()
stopService(meditationIntent) unbindService(meditationServiceConnection)
} }
if(EventBus.getDefault().isRegistered(this)){ if(EventBus.getDefault().isRegistered(this)){
EventBus.getDefault().unregister(this) EventBus.getDefault().unregister(this)
...@@ -308,6 +316,17 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -308,6 +316,17 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
} }
} }
private inner class MeditationServiceConnection:ServiceConnection {
override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
meditationService = (service as MeditationWindowService.MeditationBinder).service
}
override fun onServiceDisconnected(name: ComponentName?) {
}
}
private fun showEnsureDialog() { private fun showEnsureDialog() {
secretDialog = SecretDialog(this, object : OnSecretDialogListener { secretDialog = SecretDialog(this, object : OnSecretDialogListener {
override fun onCancel() { override fun onCancel() {
......
...@@ -22,11 +22,13 @@ import com.ydl.media.view.PlayTypeEnum; ...@@ -22,11 +22,13 @@ import com.ydl.media.view.PlayTypeEnum;
import com.ydl.media.view.PlayerFloatHelper; import com.ydl.media.view.PlayerFloatHelper;
import com.ydl.ydlcommon.utils.LogUtil; import com.ydl.ydlcommon.utils.LogUtil;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.muse.event.MeditationFloatEvent;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
import java.util.Objects; import java.util.Objects;
/** /**
* Created by haorui on 2019-10-28 . * Created by haorui on 2019-10-28 .
* Des: * Des:
...@@ -62,6 +64,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -62,6 +64,7 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
public void onActivityCreated(@Nullable Bundle savedInstanceState) { public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
initPlayMode(); initPlayMode();
onChangeImpl(AudioPlayer.Companion.get().getPlayMusic()); onChangeImpl(AudioPlayer.Companion.get().getPlayMusic());
AudioPlayer.Companion.get().addOnPlayEventListener(this); AudioPlayer.Companion.get().addOnPlayEventListener(this);
} }
...@@ -290,4 +293,6 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -290,4 +293,6 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
ivPrev = bindSource.findViewById(R.id.iv_prev); ivPrev = bindSource.findViewById(R.id.iv_prev);
ivCover = bindSource.findViewById(R.id.iv_cover); ivCover = bindSource.findViewById(R.id.iv_cover);
} }
} }
...@@ -2,16 +2,20 @@ package com.ydl.component.service.web; ...@@ -2,16 +2,20 @@ package com.ydl.component.service.web;
import android.app.Activity; import android.app.Activity;
import android.content.Intent;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.ydl.confide.api.IConfideService; import com.ydl.confide.api.IConfideService;
import com.ydl.webview.H5JsBean; import com.ydl.webview.H5JsBean;
import com.ydl.webview.H5Params; import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity; import com.ydl.webview.NewH5Activity;
import com.ydl.ydl_router.manager.YDLRouterManager;
import com.ydl.ydl_router.manager.YDLRouterParams;
import com.ydl.ydlcommon.modular.ModularServiceManager; import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.yidianling.common.tools.LogUtil; import com.yidianling.common.tools.LogUtil;
import com.yidianling.im.api.service.IImService; import com.yidianling.im.api.service.IImService;
import com.yidianling.muse.activity.ChooseMusicActivity;
//import static com.ydl.ydlcommon.router.IYDLRouterConstant.ROUTER_MUSE_PLAY;
/** /**
* webview 点击事件监听 抽象类 * webview 点击事件监听 抽象类
...@@ -322,7 +326,9 @@ public class WVClickAbstractListener implements WebViewClientClickListener { ...@@ -322,7 +326,9 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
@Override @Override
public void switchDownRefresh(H5JsBean.H5JsCmd.Params params) { public void switchDownRefresh(H5JsBean.H5JsCmd.Params params) {
if (mContext != null && mContext instanceof NewH5Activity) {
((NewH5Activity) mContext).hasShowDownRefresh(params.getSwitch());
}
} }
@Override @Override
...@@ -453,12 +459,19 @@ public class WVClickAbstractListener implements WebViewClientClickListener { ...@@ -453,12 +459,19 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
public void playMeditation(int mediaId, long meditationId, int meditationType, String mediaCoverUrl) { public void playMeditation(int mediaId, long meditationId, int meditationType, String mediaCoverUrl) {
if (mContext instanceof NewH5Activity) { if (mContext instanceof NewH5Activity) {
// YDLRouterManager.Companion.router(ROUTER_MUSE_PLAY,
// new YDLRouterParams().putExtra("MEDITATION_ID", String.valueOf(meditationId))
// .putExtra("MEDIA_ID", String.valueOf(mediaId))
// .putExtra("MEDITATION_TYPE", String.valueOf(meditationType))
// .putExtra("MEDIA_COVER_URL", mediaCoverUrl));
ARouter.getInstance().build("/muse/play") ARouter.getInstance().build("/muse/play")
.withLong("MEDITATION_ID", meditationId) .withLong("MEDITATION_ID", meditationId)
.withLong("MEDIA_ID", mediaId) .withLong("MEDIA_ID", mediaId)
.withInt("MEDITATION_TYPE", meditationType) .withInt("MEDITATION_TYPE", meditationType)
.withString("MEDIA_COVER_URL", mediaCoverUrl) .withString("MEDIA_COVER_URL", mediaCoverUrl)
.navigation(); .navigation();
} }
} }
...@@ -469,6 +482,23 @@ public class WVClickAbstractListener implements WebViewClientClickListener { ...@@ -469,6 +482,23 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
if (mContext instanceof NewH5Activity) { if (mContext instanceof NewH5Activity) {
((NewH5Activity) mContext).switchSound(mediaId, meditationId, meditationType, ((NewH5Activity) mContext).switchSound(mediaId, meditationId, meditationType,
businessType, buried, mediaUrl, mediaCoverUrl, title, desc, status); businessType, buried, mediaUrl, mediaCoverUrl, title, desc, status);
} else if (mContext instanceof ChooseMusicActivity) {
((ChooseMusicActivity) mContext).switchSound(mediaId, meditationId, meditationType,
businessType, buried, mediaUrl, mediaCoverUrl, title, desc, status);
}
}
@Override
public void reloadUrl(String url) {
if (mContext instanceof NewH5Activity) {
((NewH5Activity) mContext).loadUrl(url);
}
}
@Override
public void setWebViewBG(String rgb, String alpha) {
if (mContext instanceof NewH5Activity){
((NewH5Activity)mContext).setBG(rgb, alpha);
} }
} }
} }
...@@ -414,6 +414,20 @@ class WebJavascriptHandler : IJavascriptHandler{ ...@@ -414,6 +414,20 @@ class WebJavascriptHandler : IJavascriptHandler{
} }
} }
"loadUrl" -> {
jsData.cmd?.params?.let{
wvEnventPro?.reloadUrl(jsData.cmd?.params?.url)
}
}
"webViewBackgroundColor" -> {
jsData.cmd?.params?.let{
val rgb = it.color
val alpha = it.alpha
wvEnventPro?.setWebViewBG(rgb,alpha)
}
}
} }
} }
} }
...@@ -189,5 +189,9 @@ public interface WebViewClientClickListener { ...@@ -189,5 +189,9 @@ public interface WebViewClientClickListener {
String desc,int status){ String desc,int status){
} }
//页面内跳转url
void reloadUrl(String url);
default void setWebViewBG(String rgb,String alpha){}
} }
...@@ -9,13 +9,14 @@ ext { ...@@ -9,13 +9,14 @@ 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.16", "m-user" : "0.0.62.24",
"m-home" : "0.0.23.63", "m-home" : "0.0.23.78",
"m-im" : "0.0.21.44", "m-im" : "0.0.21.50",
"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.38", "m-muse" : "0.0.28.62",
"m-tests" : "0.0.24.18", "m-tests" : "0.0.24.18",
"m-course" : "0.0.43.37", "m-course" : "0.0.43.37",
...@@ -36,13 +37,13 @@ ext { ...@@ -36,13 +37,13 @@ ext {
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.23", "ydl-tuicore" : "0.0.23",
//第一步 //第一步
"ydl-platform" : "0.0.41.15", "ydl-platform" : "0.0.41.24",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.79", "ydl-webview" : "0.0.38.86",
"ydl-media" : "0.0.21.44", "ydl-media" : "0.0.21.46",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.90", "m-audioim" : "0.0.49.29.94",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
...@@ -95,14 +96,14 @@ ext { ...@@ -95,14 +96,14 @@ 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.16", "m-user" : "0.0.62.24",
"m-home" : "0.0.23.63", "m-home" : "0.0.23.78",
"m-im" : "0.0.21.50",
"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.38", "m-muse" : "0.0.28.62",
"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 层 --------------
...@@ -121,13 +122,13 @@ ext { ...@@ -121,13 +122,13 @@ ext {
//mdt组件 //mdt组件
"ydl-tuicore" : "0.0.23", "ydl-tuicore" : "0.0.23",
//第一步 //第一步
"ydl-platform" : "0.0.41.15", "ydl-platform" : "0.0.41.24",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.79", "ydl-webview" : "0.0.38.86",
"ydl-media" : "0.0.21.44", "ydl-media" : "0.0.21.46",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.90", "m-audioim" : "0.0.49.29.94",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
......
package com.yidianling.home package com.yidianling.home
//import com.ydl.ydlcommon.router.IYDLRouterConstant.Companion.ROUTER_MUSE_PLAY
import android.content.Context import android.content.Context
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.ImageView import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.cardview.widget.CardView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
...@@ -16,6 +17,8 @@ import com.ydl.webview.H5Params ...@@ -16,6 +17,8 @@ import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.model.bean.MeditationModuleBean import com.yidianling.home.model.bean.MeditationModuleBean
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.ydl.home_fragment.* import kotlinx.android.synthetic.ydl.home_fragment.*
...@@ -24,9 +27,10 @@ class MeditationTypeAdapter( ...@@ -24,9 +27,10 @@ class MeditationTypeAdapter(
private val context: Context, private val context: Context,
private val data: List<MeditationModuleBean.MeditationDetail>?, private val data: List<MeditationModuleBean.MeditationDetail>?,
private val moreLink: String?, private val moreLink: String?,
private val homeLink:String?=null, private val homeLink: String? = null,
private val cateId:Long?=null, private val cateId: Long? = null,
private val mark:Int?=null, private val buried: String? = null,
private val mark: Int? = null,
private val meditationType: Int? = null private val meditationType: Int? = null
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() { ) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
...@@ -52,9 +56,11 @@ class MeditationTypeAdapter( ...@@ -52,9 +56,11 @@ class MeditationTypeAdapter(
when (holder) { when (holder) {
is MeditationTypeViewHolder -> { is MeditationTypeViewHolder -> {
holder.ivType?.let { holder.ivType?.let {
Glide.with(context) Glide.with(context)
.load(data?.get(position)?.coverImageUrl) .load(data?.get(position)?.coverImageUrl)
.thumbnail(0.1f)
.transition(DrawableTransitionOptions.withCrossFade()) .transition(DrawableTransitionOptions.withCrossFade())
.into(it) .into(it)
} }
...@@ -64,33 +70,52 @@ class MeditationTypeAdapter( ...@@ -64,33 +70,52 @@ class MeditationTypeAdapter(
} }
holder.cvLayout?.setOnClickListener { holder.cvLayout?.setOnClickListener {
if (meditationType == 0){ ActionCountUtils.baiDuCountSign3(
HomeBIConstants.YDL_USER_MAIN_PAGE_MUSE,
HomeBIConstants.YDL_HOME_MEDITATION_CLICK,
buried ?: "",
(position + 1).toString(),
""
)
if (meditationType == 0) {
if (Utils.isFastClick()) { if (Utils.isFastClick()) {
//防止连击 //防止连击
return@setOnClickListener return@setOnClickListener
} }
if(!ModularServiceManager.provide(IUserService::class.java).loginByOneKeyLogin(context,true)){ if (!ModularServiceManager.provide(IUserService::class.java)
.loginByOneKeyLogin(context, true)
) {
return@setOnClickListener return@setOnClickListener
} }
if(data==null){ if (data == null) {
return@setOnClickListener return@setOnClickListener
} }
ARouter.getInstance().build("/muse/play") ARouter.getInstance().build("/muse/play")
.withLong("MEDITATION_ID", data[position]?.meditationId) .withLong("MEDITATION_ID", data[position]?.meditationId)
.withInt("MEDITATION_TYPE", meditationType) .withInt("MEDITATION_TYPE", meditationType)
.withFloat("MEDIA_DURATION", data[position].duration?:0.0f) .withFloat("MEDIA_DURATION", data[position].duration ?: 0.0f)
.withString("MEDIA_URL", data[position].mediaIdCoverImageUrl) .withString("MEDIA_URL", data[position].mediaIdCoverImageUrl)
.withString("MEDIA_COVER_URL", data[position].mediaIdCoverImageUrl) .withString("MEDIA_COVER_URL", data[position].mediaIdCoverImageUrl)
.navigation() .navigation()
}else{
// YDLRouterManager.router(ROUTER_MUSE_PLAY,
// YDLRouterParams().putExtra("MEDITATION_ID" , data[position]?.meditationId.toString())
// .putExtra("MEDITATION_TYPE", meditationType.toString())
// .putExtra("MEDIA_DURATION", (data[position].duration?:0).toString())
// .putExtra("MEDIA_URL", data[position].mediaIdCoverImageUrl.toString())
// .putExtra("MEDIA_COVER_URL", data[position].mediaIdCoverImageUrl.toString()))
} else {
if (Utils.isFastClick()) { if (Utils.isFastClick()) {
//防止连击 //防止连击
return@setOnClickListener return@setOnClickListener
} }
if(data==null){ if (data == null) {
return@setOnClickListener return@setOnClickListener
} }
val homeLink = "${homeLink}mark=$mark&cateId=$cateId&meditationId=${data[position]?.meditationId}" val homeLink =
"${homeLink}mark=$mark&cateId=$cateId&meditationId=${data[position]?.meditationId}"
if (!homeLink.isNullOrBlank()) { if (!homeLink.isNullOrBlank()) {
NewH5Activity.start(context, H5Params(homeLink, null)) NewH5Activity.start(context, H5Params(homeLink, null))
} }
...@@ -103,6 +128,12 @@ class MeditationTypeAdapter( ...@@ -103,6 +128,12 @@ class MeditationTypeAdapter(
//防止连击 //防止连击
return@setOnClickListener return@setOnClickListener
} }
//冥想助眠更多点击事件
ActionCountUtils.count(
HomeBIConstants.YDL_HOME_MEDITATION_VOICE_MORE_CLICK,
buried ?: ""
)
val moreLink = "${moreLink}mark=$mark&cateId=$cateId" val moreLink = "${moreLink}mark=$mark&cateId=$cateId"
if (!moreLink.isNullOrBlank()) { if (!moreLink.isNullOrBlank()) {
NewH5Activity.start(context, H5Params(moreLink, null)) NewH5Activity.start(context, H5Params(moreLink, null))
...@@ -132,7 +163,7 @@ class MeditationTypeAdapter( ...@@ -132,7 +163,7 @@ class MeditationTypeAdapter(
} }
inner class MeditationTypeViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { inner class MeditationTypeViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val cvLayout: CardView? = itemView.findViewById(R.id.card_view) val cvLayout: FrameLayout? = itemView.findViewById(R.id.fl_layout)
val ivType: ImageView? = itemView.findViewById(R.id.iv_meditation_type) val ivType: ImageView? = itemView.findViewById(R.id.iv_meditation_type)
val tvName: TextView? = itemView.findViewById(R.id.tv_meditation_type) val tvName: TextView? = itemView.findViewById(R.id.tv_meditation_type)
} }
......
...@@ -27,6 +27,7 @@ class MeditationViewPagerAdapter(private val context: Context, private val data: ...@@ -27,6 +27,7 @@ class MeditationViewPagerAdapter(private val context: Context, private val data:
moreLink = it.lowerFloorMore?:"", moreLink = it.lowerFloorMore?:"",
homeLink = it.mditationDetailUrl, homeLink = it.mditationDetailUrl,
cateId = it.cateId, cateId = it.cateId,
buried = it.buried,
mark = it.mark, mark = it.mark,
meditationType = it.meditionType) meditationType = it.meditionType)
} }
......
...@@ -41,7 +41,13 @@ class HomeBIConstants { ...@@ -41,7 +41,13 @@ class HomeBIConstants {
const val YDL_HOME_ZHUMIANICON: String = YDL_USER_MAIN_PAGE + "ydl_user_sleep_aid_type_click" // 首页_助眠_icon const val YDL_HOME_ZHUMIANICON: String = YDL_USER_MAIN_PAGE + "ydl_user_sleep_aid_type_click" // 首页_助眠_icon
const val YDL_HOME_SEARCH_TAG: String = YDL_USER_MAIN_PAGE + "ydl_user_search_tag" // 首页_定制咨询点击tag const val YDL_HOME_SEARCH_TAG: String = YDL_USER_MAIN_PAGE + "ydl_user_search_tag" // 首页_定制咨询点击tag
const val YDL_HOME_POPUPWINDOWS_PAGE_POPUP: String = YDL_USER_MAIN_PAGE + "popupwindows_page_popup" // 首页弹窗页面弹出事件(99元3小时弹出事件) const val YDL_HOME_POPUPWINDOWS_PAGE_POPUP: String = YDL_USER_MAIN_PAGE + "popupwindows_page_popup" // 首页弹窗页面弹出事件(99元3小时弹出事件)
//首页_冥想(ydl_user_main_page)
const val YDL_USER_MAIN_PAGE_MUSE: String = "ydl_user_main_page"//壹点灵用户版首页 partId
const val YDL_HOME_MEDITATION_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "main_meditation_more_click" // 冥想助眠更多点击事件
const val YDL_HOME_MEDITATION_SUBJECT_CLICK: String = YDL_USER_MAIN_PAGE + "main_meditation_subject_click" // 冥想|声音|睡眠点击事件
const val YDL_HOME_MEDITATION_VOICE_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "main_meditation_voice_more_click" // 冥想|声音|睡眠_更多点击事件
const val YDL_HOME_MEDITATION_CLICK: String = "main_meditation_meditation_click" // 冥想_声音点击事件
} }
......
<?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>
...@@ -12,16 +12,15 @@ import android.view.View ...@@ -12,16 +12,15 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator import com.google.android.material.tabs.TabLayoutMediator
import com.ydl.webview.H5Params import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.MeditationViewPagerAdapter import com.yidianling.home.MeditationViewPagerAdapter
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.constract.HomeViewConfig import com.yidianling.home.constract.HomeViewConfig
import com.yidianling.home.event.IHomeEvent import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.MeditationModuleBean import com.yidianling.home.model.bean.MeditationModuleBean
...@@ -62,20 +61,20 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv ...@@ -62,20 +61,20 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv
val moreLink = bean.mditationIndexInfo?.upperFloorMore val moreLink = bean.mditationIndexInfo?.upperFloorMore
homeModuleMuseViewHomeCommonTitleView.setOnClickListener { homeModuleMuseViewHomeCommonTitleView.setOnClickListener {
// homeEvent?.museMoreClick(Gson().toJson(bean))
if (Utils.isFastClick()) { if (Utils.isFastClick()) {
//防止连击 //防止连击
return@setOnClickListener return@setOnClickListener
} }
//冥想助眠更多点击事件
ActionCountUtils.count(HomeBIConstants.YDL_HOME_MEDITATION_MORE_CLICK)
if (!moreLink.isNullOrBlank()) { if (!moreLink.isNullOrBlank()) {
NewH5Activity.start(context, H5Params(moreLink, null)) NewH5Activity.start(context, H5Params(moreLink, null))
} }
} }
video_view?.setOnClickListener { fl_layout?.setOnClickListener {
// homeEvent?.museMoreClick(Gson().toJson(bean))
if (Utils.isFastClick()) { if (Utils.isFastClick()) {
//防止连击 //防止连击
...@@ -115,18 +114,23 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv ...@@ -115,18 +114,23 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv
it?.start() it?.start()
it?.setVolume(0.0F, 0.0F) it?.setVolume(0.0F, 0.0F)
} }
video_view?.setOnCompletionListener { video_view?.start() }
video_view?.setOnCompletionListener { video_view?.start() }
bean.mditationListResponse?.forEach { bean.mditationListResponse?.forEach {
meditationTitles.add(it.comment) meditationTitles.add(it.comment)
} }
view_pager.isUserInputEnabled = false
view_pager.adapter = MeditationViewPagerAdapter(mContext, bean) view_pager.adapter = MeditationViewPagerAdapter(mContext, bean)
tab_layout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { tab_layout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) { override fun onTabSelected(tab: TabLayout.Tab?) {
//冥想|声音|睡眠点击事件
ActionCountUtils.count(HomeBIConstants.YDL_HOME_MEDITATION_SUBJECT_CLICK,
tab?.let { bean?.mditationListResponse?.get(it.position)?.buried } ?:"")
var text: String? = tab?.text.toString().trim() var text: String? = tab?.text.toString().trim()
val spStr = SpannableString(text) val spStr = SpannableString(text)
val styleSpan = StyleSpan(Typeface.BOLD) val styleSpan = StyleSpan(Typeface.BOLD)
......
...@@ -20,22 +20,23 @@ ...@@ -20,22 +20,23 @@
app:cardElevation="0dp"> app:cardElevation="0dp">
<FrameLayout <FrameLayout
android:id="@+id/fl_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#999999"> android:background="@drawable/bg_meditation_video">
<com.yidianling.home.widget.AdaptiveVideoView <com.yidianling.home.widget.AdaptiveVideoView
android:id="@+id/video_view" android:id="@+id/video_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:focusable="false" android:focusable="false"
android:focusableInTouchMode="false" /> android:focusableInTouchMode="false"/>
<!-- <ImageView--> <ImageView
<!-- android:id="@+id/iv_video_background"--> android:layout_width="match_parent"
<!-- android:layout_width="match_parent"--> android:layout_height="match_parent"
<!-- android:layout_height="match_parent"--> android:scaleType="centerCrop"
<!-- android:scaleType="fitCenter"/>--> android:src="@drawable/bg_meditation_video"/>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -67,18 +68,28 @@ ...@@ -67,18 +68,28 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="150dp" android:layout_height="170dp"
android:layout_marginBottom="20dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout" android:id="@+id/tab_layout"
android:layout_width="200dp" android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginBottom="14dp" app:tabTextColor="#88FFFFFF"
app:tabSelectedTextColor="#FFFFFF"
app:tabBackground="@color/transparent"
app:tabRippleColor="@color/transparent"
app:tabMode="auto"
app:tabIndicatorFullWidth="false"
style="@style/MeditationTabLayoutStyle" /> style="@style/MeditationTabLayoutStyle" />
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginBottom="14dp"
android:background="#33FFFFFF"/>
<androidx.viewpager2.widget.ViewPager2 <androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager" android:id="@+id/view_pager"
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingStart="10dp"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_meditation_type" android:id="@+id/rv_meditation_type"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingHorizontal="16dp"
android:clipToPadding="false" android:clipToPadding="false"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/> app:layout_constraintTop_toTopOf="parent"/>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content" android:id="@+id/fl_layout"
android:layout_height="wrap_content" android:layout_width="105dp"
android:paddingHorizontal="6dp"> android:layout_height="102dp"
android:layout_marginBottom="20dp"
android:layout_marginEnd="12dp">
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/card_view" android:id="@+id/card_view"
android:layout_width="105dp" android:layout_width="105dp"
android:layout_height="102dp" android:layout_height="102dp"
android:clipToPadding="false"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:cardCornerRadius="12dp" app:cardCornerRadius="8dp"
app:cardElevation="0dp"> app:cardElevation="0dp">
<FrameLayout <FrameLayout
...@@ -24,24 +26,32 @@ ...@@ -24,24 +26,32 @@
<ImageView <ImageView
android:id="@+id/iv_meditation_type" android:id="@+id/iv_meditation_type"
android:layout_width="match_parent" android:layout_width="105dp"
android:layout_height="match_parent" android:layout_height="102dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"/>
tools:src="@drawable/play_page_default_bg" />
<!-- <View-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="30dp"-->
<!-- 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="wrap_content" 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:ellipsize="end"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14sp" android:textSize="14sp"
android:layout_marginStart="6dp" android:paddingHorizontal="6dp"
android:layout_marginBottom="5dp" /> android:paddingVertical="5dp"/>
</FrameLayout> </FrameLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout> </FrameLayout>
\ No newline at end of file \ No newline at end of file
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:background="@color/baby_blue" tools:background="@color/baby_blue">
android:layout_marginHorizontal="6dp">
<LinearLayout <LinearLayout
android:id="@+id/ll_more_type" android:id="@+id/ll_more_type"
......
...@@ -104,7 +104,6 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase { ...@@ -104,7 +104,6 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
orderId = customAttachment.orderId; orderId = customAttachment.orderId;
serviceId = customAttachment.serviceId; serviceId = customAttachment.serviceId;
flag = customAttachment.status; flag = customAttachment.status;
ToastUtil.toastShort("flag:"+flag);
if (flag == 1) { if (flag == 1) {
// 1代表已确认,0代表待确认 // 1代表已确认,0代表待确认
tv_submit.setText("已确认"); tv_submit.setText("已确认");
......
...@@ -23,6 +23,9 @@ android { ...@@ -23,6 +23,9 @@ android {
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
flavorDimensions "versionCode" flavorDimensions "versionCode"
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
} }
lintOptions { lintOptions {
...@@ -60,6 +63,8 @@ dependencies { ...@@ -60,6 +63,8 @@ dependencies {
implementation 'com.github.weidongjian:androidWheelView:1.0.0' implementation 'com.github.weidongjian:androidWheelView:1.0.0'
implementation 'com.github.feeeei:CircleSeekbar:v1.1.2' implementation 'com.github.feeeei:CircleSeekbar:v1.1.2'
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
// implementation 'jp.wasabeef:blurry:4.0.1'
// solve build problem // solve build problem
// cannot access 'androidx.lifecycle.hasdefaultviewmodelproviderfactory' // cannot access 'androidx.lifecycle.hasdefaultviewmodelproviderfactory'
// Comment out when compiling // Comment out when compiling
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
package="com.yidianling.muse"> package="com.yidianling.muse">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
<application> <application>
<activity <activity
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
<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"
android:screenOrientation="portrait"
android:theme="@style/un_full_screen_activity"/>
<service android:name=".service.MeditationWindowService"/> <service android:name=".service.MeditationWindowService"/>
......
package com.yidianling.muse.activity
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.content.res.Resources
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import android.util.Log
import android.view.View
import android.webkit.WebResourceRequest
import android.webkit.WebSettings
import android.webkit.WebView
import android.webkit.WebViewClient
import com.ydl.utils.WebUrlParamsUtils
import com.ydl.webview.H5Params
import com.ydl.webview.IJavascriptHandler
import com.ydl.webview.TellData
import com.ydl.webview.WebModularServiceUtils.Companion.getWebService
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.event.MeditationEvent
import com.yidianling.common.tools.LogUtil
import com.yidianling.muse.R
import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.dialog_choose_music.*
import org.json.JSONException
import org.json.JSONObject
/**
* Created by Ykai on 2022/5/26.
*/
class ChooseMusicActivity : BaseActivity() {
private val TAG = ChooseMusicActivity::class.java.simpleName
protected var jtoJHandle: IJavascriptHandler? = null
/*** 路由传递过来的参数 */
val ROUTER_PARAMS = "routerParam"
companion object{
const val PARAMS = "h5Params"
/***接收参数 */
private var h5Params: H5Params? = null
fun launch(context: Context, h5Params:H5Params) {
Intent(context, ChooseMusicActivity::class.java).apply {
putExtra(PARAMS, h5Params)
context.startActivity(this)
}
}
}
override fun initDataAndEvent() {
//正常获取入参
}
override fun layoutResId(): Int {
return R.layout.dialog_choose_music
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
getParam()
var tellData = TellData()
jtoJHandle = getWebService().getJavascripHandler(this, tellData.also { tellData = it })
initView()
}
@SuppressLint("SetJavaScriptEnabled", "JavascriptInterface")
private fun initView() {
// 移除有漏洞的系统接口
wv_choose_music.removeJavascriptInterface("searchBoxJavaBridge_")
wv_choose_music.removeJavascriptInterface("accessibility")
wv_choose_music.removeJavascriptInterface("accessibilityTraversal")
val mWebSettings: WebSettings = wv_choose_music.settings
mWebSettings.javaScriptEnabled = true //支持js
mWebSettings.defaultTextEncodingName = "GBK" //设置字符编码
mWebSettings.domStorageEnabled = true
mWebSettings.textZoom = 100 //设置字体不跟随字体变化而变化
mWebSettings.allowFileAccessFromFileURLs = true
mWebSettings.blockNetworkImage = false // 解决图片不显示
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mWebSettings.mixedContentMode = WebSettings.LOAD_NORMAL
}
wv_choose_music.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY //滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上
wv_choose_music.addJavascriptInterface(jtoJHandle, "javascriptHandler")
val url = setUrlHeightParams(h5Params?.url)
LogUtil.e(url)
loadUrl(url,wv_choose_music)
wv_choose_music.webViewClient=object : WebViewClient(){
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
}
override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
loadUrl(request.url.toString(),view)
} else {
loadUrl(request.toString(),view)
}
return true
}
}
ll_close.setOnClickListener {
finish()
}
}
private fun getParam() {
if (null != intent) {
//正常获取入参
h5Params = intent.getSerializableExtra(PARAMS) as H5Params
//路由传递的入参
if (intent.hasExtra(ROUTER_PARAMS)) {
val json = intent.getStringExtra(ROUTER_PARAMS)
try {
val jsonObject = JSONObject(json)
h5Params = H5Params(jsonObject.getString("url"), "")
} catch (e: JSONException) {
e.printStackTrace()
}
}
}
}
fun switchSound(
mediaId: Int, meditationId: Long, meditationType: Int, businessType: Int,
buried: String?, mediaUrl: String?, mediaCoverUrl: String?,
title: String?, desc: String?, status: Int
) {
val event = MeditationEvent(
mediaId, meditationId, meditationType, businessType,
status, buried!!, mediaUrl!!, mediaCoverUrl!!, title!!, desc!!
)
EventBus.getDefault().post(event)
}
fun loadUrl(url: String?,web:WebView) {
if (TextUtils.isEmpty(url)) {
return
}
val resultUrl = if (h5Params?.suffix == true) WebUrlParamsUtils.getSuffix(
url,
jtoJHandle?.getUriAppendSuffix()
) else url
Log.e(TAG, resultUrl)
web.loadUrl(resultUrl)
}
/**
* 专家详情页改版 需要url后面拼接状态栏高度 并且隐藏导航栏
*
* @param url
* @return
*/
private fun setUrlHeightParams(url: String?): String {
var resultUrl: String? = url
try {
val uri = Uri.parse(url)
val host = uri.host
if (!TextUtils.isEmpty(host) && host.contains("nodeapi.ydl")) {
//马亮的需求,在nodeapi.ydl.com 地址后面拼上公共参数,用于判断是否为app
//马亮的需求,在nodeapi.ydl.com 地址后面拼上公共参数,用于判断是否为app
val uriAppendSuffix = jtoJHandle?.getUriAppendSuffix()
resultUrl = WebUrlParamsUtils.getSuffix(url, uriAppendSuffix)
}
} catch (e: Exception) {
e.printStackTrace()
}
return pinjie(resultUrl)
}
private fun pinjie(jumpUrl: String?): String {
var useUrl = StringBuffer().append(jumpUrl).toString()
val res: Resources = resources
val doctorUrlArray = res.getStringArray(R.array.platform_doctorUrls)
for (url in doctorUrlArray) {
if (useUrl.contains(url)) {
var lastUrl = useUrl.replace(url.toRegex(), "")
if (lastUrl.contains("?")) {
lastUrl = lastUrl.substring(0, lastUrl.indexOf("?"))
}
try {
//不报错就说明可以转成long,就说明是专家详情页地址
lastUrl.toLong()
if (!lastUrl.contains("/")) {
if (useUrl.endsWith("?")) {
useUrl = useUrl.substring(0, useUrl.indexOf("?"))
}
}
} catch (e: NumberFormatException) {
e.printStackTrace()
}
}
}
return useUrl
}
}
\ No newline at end of file
package com.yidianling.muse.activity package com.yidianling.muse.activity
import android.content.Intent import android.content.Intent
import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.os.Handler
import com.blankj.utilcode.util.SPUtils import com.blankj.utilcode.util.SPUtils
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.bumptech.glide.request.RequestOptions
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.muse.R import com.yidianling.muse.R
import jp.wasabeef.glide.transformations.BitmapTransformation
import jp.wasabeef.glide.transformations.BlurTransformation
import kotlinx.android.synthetic.main.activity_play_meditation_time_off.* import kotlinx.android.synthetic.main.activity_play_meditation_time_off.*
import kotlinx.android.synthetic.main.activity_play_meditation_time_off.iv_close
class MeditationTimeOffActivity : BaseActivity() { class MeditationTimeOffActivity : BaseActivity() {
private lateinit var mBGImageUrl:String
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
StatusBarUtils.setTransparentForImageView(this, null)
StatusBarUtils.statusBarLightMode(this)
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
mBGImageUrl = intent?.getStringExtra("BG_IMAGE_URL")?:""
initView() initView()
} }
private fun initView() { private fun initView() {
val options = RequestOptions.bitmapTransform(BlurTransformation(25,1))
Glide.with(this)
.load(mBGImageUrl)
.transition(DrawableTransitionOptions.withCrossFade())
.apply(options)
.into(iv_bg)
iv_close?.setOnClickListener { finish() } iv_close?.setOnClickListener { finish() }
tv_save_setting?.setOnClickListener { tv_save_setting?.setOnClickListener {
...@@ -85,7 +105,7 @@ class MeditationTimeOffActivity : BaseActivity() { ...@@ -85,7 +105,7 @@ class MeditationTimeOffActivity : BaseActivity() {
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
StatusBarUtils.setWindowStatusBarColor(this, R.color.platform_main_theme)
} }
override fun layoutResId(): Int { override fun layoutResId(): Int {
......
...@@ -16,7 +16,7 @@ class MeditationPlayModuleBean : HomeItemBaseBean { ...@@ -16,7 +16,7 @@ class MeditationPlayModuleBean : HomeItemBaseBean {
var mediaList: ArrayList<MeditationDetail>? = null var mediaList: ArrayList<MeditationDetail>? = null
data class MeditationDetail( data class MeditationDetail(
val mediaType:Int? = null, val meditationType:Int? = null,
val mediaId:Long?=null, val mediaId:Long?=null,
val meditationId:Long, val meditationId:Long,
val title:String, val title:String,
......
package com.yidianling.muse.constants
/**
* @author liunpeng
* */
class MuseBIConstants {
companion object {
//音乐播放页(meditation_music_play_page)
const val YDL_MUSE_MEDITATION_MUSIC_PLAY_PAGE: String =
"meditation_music_play_page"//音乐播放页(meditation_music_play_page)
const val YDL_MUSE_PLAY_PACK_CLICK: String =
"music_play_pack_click"//收起点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_CLOSE_CLICK: String =
"music_play_close_click" //关闭点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_COLLECT_CLICK: String =
"music_play_collect_click"//收藏点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_SHARE_CLICK: String =
"music_play_share_click"//分享点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_IOC_CLICK: String =
"music_play_ioc_click"//定时 ioc点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_PROGRESS_CLICK: String =
"music_play_progress_click"//进度条点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_SPEED_CLICK: String =
"music_play_speed_click"//快进点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_REW_CLICK: String =
"music_play_rew_click"//快退点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_NEXT_CLICK: String =
"music_play_next_click"//下一个点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_LAST_CLICK: String =
"music_play_last_click"//上一个点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_PAUSE_CLICK: String =
"music_play_pause_click"//暂停点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_PLAY_CLICK: String =
"music_play_play_click"//播放点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_PAGE_VISIT: String =
"music_play_page_visit"//曝光事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_CHANGE_CLICK: String =
"music_play_change_click"//切换音频点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
const val YDL_MUSE_PLAY_LIST_CLICK: String =
"music_play_list_click"//列表点击事件 sign1: 内容标题 sign2(传入字符串): meditation(冥想播放), voice(轻音乐播放), sleep(睡眠播放)
//悬浮窗(meditation_floating_window_play)
private const val YDL_MUSE_MEDITATION_FLOATING_WINDOW: String =
"meditation_floating_window_play|"//悬浮窗
const val YDL_MUSE_MEDITATION_WINDOW_PLAY_CLICK: String =
YDL_MUSE_MEDITATION_FLOATING_WINDOW + "meditation_floating_window_play_click"//悬浮窗播放点击事件
const val YDL_MUSE_MEDITATION_WINDOW_PAUSE_CLICK: String =
YDL_MUSE_MEDITATION_FLOATING_WINDOW + "meditation_floating_window_pause_click"//悬浮窗暂停点击事件
const val YDL_MUSE_MEDITATION_WINDOW_CLOSE_CLICK: String =
YDL_MUSE_MEDITATION_FLOATING_WINDOW + "meditation_floating_window_close_click"//悬浮窗关闭点击事件
const val YDL_MUSE_MEDITATION_WINDOW_CLICK: String =
YDL_MUSE_MEDITATION_FLOATING_WINDOW + "meditation_floating_window_click"//悬浮窗播放区域点击 事件
}
}
\ No newline at end of file
package com.yidianling.muse.dialog
import android.annotation.SuppressLint
import android.app.Activity
import android.app.Dialog
import android.content.res.Resources
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import android.webkit.WebSettings
import com.ydl.utils.WebUrlParamsUtils
import com.ydl.webview.H5Params
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.muse.R
import com.yidianling.muse.activity.PlayMeditationActivity
import kotlinx.android.synthetic.main.dialog_choose_music.*
/**
* Created by Ykai on 2022/5/26.
*
* 选择音乐弹窗,内部是h5页面
*/
class ChooseMusicDialog(activity: Activity,h5Params: H5Params) : Dialog(activity, R.style.music_dialog_style) {
private val mActivity = activity
private val h5Params: H5Params = h5Params
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// 设置宽度全屏
//dialog去除默认边距,宽度占满全屏
val window = window!!
window.setWindowAnimations(R.style.dialog_anim)
// 把 DecorView 的默认 padding 取消,同时 DecorView 的默认大小也会取消
window.decorView.setPadding(0, 0, 0, 0)
val layoutParams = window.attributes
layoutParams.gravity = Gravity.BOTTOM
layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT
layoutParams.height = (RxDeviceTool.getScreenHeight(context)*0.89).toInt()
window.attributes = layoutParams
setContentView(R.layout.dialog_choose_music)
initView()
}
@SuppressLint("SetJavaScriptEnabled")
private fun initView() {
// 移除有漏洞的系统接口
wv_choose_music.removeJavascriptInterface("searchBoxJavaBridge_")
wv_choose_music.removeJavascriptInterface("accessibility")
wv_choose_music.removeJavascriptInterface("accessibilityTraversal")
val mWebSettings: WebSettings = wv_choose_music.settings
mWebSettings.javaScriptEnabled = true //支持js
mWebSettings.defaultTextEncodingName = "GBK" //设置字符编码
mWebSettings.domStorageEnabled = true
mWebSettings.textZoom = 100 //设置字体不跟随字体变化而变化
mWebSettings.allowFileAccessFromFileURLs = true
mWebSettings.blockNetworkImage = false // 解决图片不显示
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mWebSettings.mixedContentMode = WebSettings.LOAD_NORMAL
}
wv_choose_music.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY //滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上
// val jsInterface = JsInterface(mActivity as PlayMeditationActivity)
// wv_choose_music.addJavascriptInterface(jsInterface, "javascriptHandler")
val url = setUrlHeightParams(h5Params.url)
wv_choose_music.loadUrl(url)
ll_close.setOnClickListener {
dismiss()
}
}
/**
* 专家详情页改版 需要url后面拼接状态栏高度 并且隐藏导航栏
*
* @param url
* @return
*/
private fun setUrlHeightParams(url: String): String {
var resultUrl: String? = url
try {
val uri = Uri.parse(url)
val host = uri.host
if (!TextUtils.isEmpty(host) && host.contains("nodeapi.ydl")) {
//马亮的需求,在nodeapi.ydl.com 地址后面拼上公共参数,用于判断是否为app
val uriAppendSuffix = ""
resultUrl = WebUrlParamsUtils.getSuffix(url, uriAppendSuffix)
}
} catch (e: Exception) {
e.printStackTrace()
}
return pinjie(resultUrl)
}
private fun pinjie(jumpUrl: String?): String {
var useUrl = StringBuffer().append(jumpUrl).toString()
val res: Resources = mActivity.resources
val doctorUrlArray = res.getStringArray(R.array.platform_doctorUrls)
for (url in doctorUrlArray) {
if (useUrl.contains(url)) {
var lastUrl = useUrl.replace(url.toRegex(), "")
if (lastUrl.contains("?")) {
lastUrl = lastUrl.substring(0, lastUrl.indexOf("?"))
}
try {
//不报错就说明可以转成long,就说明是专家详情页地址
lastUrl.toLong()
if (!lastUrl.contains("/")) {
if (useUrl.endsWith("?")) {
useUrl = useUrl.substring(0, useUrl.indexOf("?"))
}
}
} catch (e: NumberFormatException) {
e.printStackTrace()
}
}
}
return useUrl
}
}
\ No newline at end of file
...@@ -4,5 +4,9 @@ import com.yidianling.muse.bean.MeditationPlayModuleBean ...@@ -4,5 +4,9 @@ import com.yidianling.muse.bean.MeditationPlayModuleBean
class MeditationFloatEvent( class MeditationFloatEvent(
val show: Boolean, val show: Boolean,
val meditationDetail: MeditationPlayModuleBean.MeditationDetail?=null val stop: Boolean? = null,
) val time: Long? = null,
\ No newline at end of file val meditation: MeditationPlayModuleBean.MeditationDetail? = null,
val meditations: ArrayList<MeditationPlayModuleBean.MeditationDetail>? = null
)
...@@ -34,6 +34,6 @@ class FloatViewTouchListener(val wl: WindowManager.LayoutParams, val windowManag ...@@ -34,6 +34,6 @@ class FloatViewTouchListener(val wl: WindowManager.LayoutParams, val windowManag
} }
} }
return false return true
} }
} }
\ No newline at end of file
...@@ -4,7 +4,12 @@ import android.content.Context ...@@ -4,7 +4,12 @@ import android.content.Context
import android.media.AudioAttributes import android.media.AudioAttributes
import android.media.AudioManager import android.media.AudioManager
import android.media.MediaPlayer import android.media.MediaPlayer
import com.yidianling.muse.helper.MediaPlayerManager.MediaPlayCallBack.Companion.TYPE_LIST import io.reactivex.Observable
import io.reactivex.Observer
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import java.util.concurrent.TimeUnit
import kotlin.properties.Delegates import kotlin.properties.Delegates
class MediaPlayerManager private constructor() { class MediaPlayerManager private constructor() {
...@@ -12,9 +17,34 @@ class MediaPlayerManager private constructor() { ...@@ -12,9 +17,34 @@ class MediaPlayerManager private constructor() {
private var listener:OnMediaPlayerManagerListener?=null private var listener:OnMediaPlayerManagerListener?=null
private var mCurrentListIndex = 0 private var mCurrentListIndex = 0
private var mMediaPlayCallBack:MediaPlayCallBack?=null
private var mAudioPaths = mutableListOf<String>() private var mAudioPaths = mutableListOf<String>()
private var mMediaId:Long? = null
private var mTime = 0L
private var mTimeOffStatus = false
private var mDisposable:Disposable? = null
private var mObservable: Observable<Long>? = null
private var mObserver: Observer<Long>? = null
fun setMediaId(mediaId:Long?){
mMediaId = mediaId
}
fun getMediaId():Long? = mMediaId
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()
...@@ -30,30 +60,10 @@ class MediaPlayerManager private constructor() { ...@@ -30,30 +60,10 @@ class MediaPlayerManager private constructor() {
mMediaPlayer?.prepareAsync() mMediaPlayer?.prepareAsync()
mMediaPlayer?.setOnPreparedListener { mMediaPlayer?.setOnPreparedListener {
listener?.onPrepared(it) listener?.onPrepared(it)
if (isLoop){
mMediaPlayer?.seekTo(0)
}
} }
// mMediaPlayer?.setOnCompletionListener {
// if (it !=null){
// it.stop()
// it.release()
// }
//
// mMediaPlayer = null
// if (mAudioPaths!=null){
// mCurrentListIndex++
// if(mCurrentListIndex<mAudioPaths.size){
// mMediaPlayCallBack?.mediaPlayCallBack(TYPE_LIST,
// MediaPlayCallBack.STATE_CUT, mCurrentListIndex)
// setAudioPath(mAudioPaths[mCurrentListIndex])
// }else{
// mMediaPlayCallBack?.mediaPlayCallBack(TYPE_LIST,
// MediaPlayCallBack.STATE_STOP,mAudioPaths.size
// )
// }
// }
//
// }
} }
fun getMediaPlayer():MediaPlayer? = mMediaPlayer fun getMediaPlayer():MediaPlayer? = mMediaPlayer
...@@ -76,31 +86,59 @@ class MediaPlayerManager private constructor() { ...@@ -76,31 +86,59 @@ class MediaPlayerManager private constructor() {
} }
fun stop() { fun stop() {
mMediaPlayer?.reset() mMediaPlayer?.stop()
} }
fun release() { fun release() {
mMediaPlayer?.reset() mMediaPlayer?.stop()
} }
fun setOnPreparedListener(listener: OnMediaPlayerManagerListener){ fun setOnPreparedListener(listener: OnMediaPlayerManagerListener){
this.listener = listener this.listener = listener
} }
fun startPlayList(audioPaths:ArrayList<String>, fun initRxTimeOff(time: Long) {
playCallBack: MediaPlayCallBack,startIndex:Int){ if (time ==null && time <=0){
if(audioPaths.isNullOrEmpty() || startIndex>=mAudioPaths.size){ mDisposable?.dispose()
return
} }
mMediaPlayCallBack = playCallBack
mAudioPaths = audioPaths
mCurrentListIndex = startIndex
mMediaPlayCallBack?.mediaPlayCallBack(TYPE_LIST, mObservable = Observable.interval(0, 1, TimeUnit.SECONDS)
MediaPlayCallBack.STATE_START,mCurrentListIndex) .take(time / 1000 + 1)
.map { t -> time - t * 1000 }
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
setAudioPath(mAudioPaths[mCurrentListIndex]) mObserver = object : Observer<Long> {
override fun onSubscribe(d: Disposable) {
mDisposable = d
}
override fun onNext(t: Long) {
mTime = t
}
override fun onError(e: Throwable) {
}
override fun onComplete() {
}
}
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>)
}
}
fun dispose() {
mTime = 0
mDisposable?.dispose()
} }
companion object { companion object {
...@@ -134,23 +172,4 @@ class MediaPlayerManager private constructor() { ...@@ -134,23 +172,4 @@ class MediaPlayerManager private constructor() {
fun onPrepared(mediaPlayer: MediaPlayer) fun onPrepared(mediaPlayer: MediaPlayer)
} }
interface MediaPlayCallBack {
companion object{
const val STATE_START = 0
const val STATE_PLAY = 1
const val STATE_PAUSE = 2
const val STATE_STOP = 3
const val STATE_CUT = 4
const val TYPE_SINGLE = 0
const val TYPE_LIST = 1
}
fun mediaPlayCallBack(type:Int,state:Int,position:Int){}
}
} }
\ No newline at end of file
package com.yidianling.muse.utils package com.yidianling.muse.utils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.yidianling.home.http.MuseHttp
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
class MediaPlayerTimeUtil { class MediaPlayerTimeUtil {
companion object{ companion object{
...@@ -64,6 +69,29 @@ class MediaPlayerTimeUtil { ...@@ -64,6 +69,29 @@ class MediaPlayerTimeUtil {
} }
fun uploadPlayRecord(meditationId:Int?,mediaId:Long?,
isQuit:Int,playTime:Int,isComplete:Int){
if (meditationId != null && mediaId != null) {
MuseHttp.getInstance().postMeditationPlayRecord(
meditationId = meditationId!!.toInt(),
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
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="200"
android:interpolator="@android:anim/decelerate_interpolator">
<translate
android:fromYDelta="100%"
android:toYDelta="0%" />
<alpha
android:fromAlpha="0"
android:toAlpha="1"/>
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="200"
android:interpolator="@android:anim/accelerate_interpolator">
<translate
android:fromYDelta="0%"
android:toYDelta="100%" />
<alpha
android:fromAlpha="1"
android:toAlpha="0" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="12dp" />
<solid android:color="#CC000000" />
</shape>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt" android:width="36dp"
android:width="32dp" android:height="36dp"
android:height="32dp" android:viewportWidth="36"
android:viewportWidth="32" android:viewportHeight="36">
android:viewportHeight="32">
<path <path
android:pathData="M21.408,4C18.4904,4 16.4004,6.6075 15.4998,7.9867C14.5981,6.6075 12.5091,4 9.5915,4C5.4049,4 2,7.7419 2,12.3409C2,14.4914 3.4707,17.5744 5.256,19.1879C7.7255,22.3349 14.6683,28 15.5254,28C16.3976,28 23.1914,22.445 25.7056,19.2256C27.5222,17.5838 29,14.4966 29,12.3409C29,7.7419 25.5945,4 21.408,4" android:pathData="M24.084,4.5C20.8017,4.5 18.4505,7.4335 17.4372,8.985C16.4228,7.4335 14.0727,4.5 10.7905,4.5C6.0805,4.5 2.25,8.7097 2.25,13.8835C2.25,16.3028 3.9045,19.7712 5.9129,21.5863C8.6912,25.1267 16.5018,31.5 17.466,31.5C18.4473,31.5 26.0903,25.2506 28.9188,21.6288C30.9625,19.7818 32.625,16.3087 32.625,13.8835C32.625,8.7096 28.7938,4.5 24.084,4.5"
android:strokeWidth="1" android:strokeWidth="1"
android:fillColor="#FF675B"
android:fillType="nonZero" android:fillType="nonZero"
android:strokeColor="#00000000"> android:strokeColor="#00000000"/>
<aapt:attr name="android:fillColor">
<gradient
android:startY="6.5185184"
android:startX="9.634766"
android:endY="22.049383"
android:endX="20.429688"
android:type="linear">
<item android:offset="0" android:color="#FFFFB5A5"/>
<item android:offset="1" android:color="#FFFF7366"/>
</gradient>
</aapt:attr>
</path>
</vector> </vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp" android:width="36dp"
android:height="32dp" android:height="36dp"
android:viewportWidth="32" android:viewportWidth="36"
android:viewportHeight="32"> android:viewportHeight="36">
<path <path
android:pathData="M20.566,5C24.187,5 27.313,7.466 28.232,10.92C28.409,11.588 28.5,12.28 28.5,12.983C28.5,14.556 28.168,15.598 27.368,16.977C27.191,17.282 26.857,17.473 26.49,17.481C26.124,17.488 25.781,17.309 25.591,17.012C25.402,16.715 25.394,16.344 25.57,16.04C26.216,14.928 26.448,14.195 26.448,12.983C26.448,12.44 26.378,11.908 26.242,11.395C25.547,8.782 23.219,6.944 20.566,6.944C19.043,6.944 17.594,7.543 16.49,8.631C16.297,8.822 16.03,8.929 15.751,8.929C15.473,8.93 15.206,8.822 15.013,8.632C13.918,7.558 12.435,6.944 10.934,6.944C7.708,6.944 5.052,9.64 5.052,12.983C5.052,14.623 5.539,15.709 6.796,17.544C7.794,19.012 9.532,20.759 11.71,22.602C12.338,23.132 12.968,23.643 13.585,24.124L14.173,24.576L14.635,24.925L15.078,25.251L15.146,25.3C15.323,25.43 15.528,25.496 15.749,25.496C15.972,25.496 15.809,25.482 16.363,25.292C16.918,25.102 17.466,25.426 17.72,25.657C17.965,25.879 17.965,26.529 17.613,26.834C17.26,27.14 16.425,27.441 15.75,27.44C15.133,27.441 14.531,27.263 14.024,26.93L13.831,26.794L13.369,26.455L12.756,25.991C11.935,25.363 11.131,24.717 10.345,24.052C8.04,22.102 6.192,20.246 5.074,18.6C3.619,16.477 3,15.098 3,12.983C3,8.594 6.542,5 10.934,5C12.643,5 14.317,5.57 15.679,6.589L15.748,6.641L15.822,6.584C17.127,5.603 18.7,5.048 20.35,5.003L20.566,5Z" android:pathData="M23.1364,5.625C27.2107,5.625 30.727,8.3997 31.7605,12.285C31.9603,13.0368 32.0625,13.8148 32.0625,14.6054C32.0625,16.3752 31.6893,17.5476 30.7891,19.0993C30.5904,19.4417 30.214,19.6576 29.8017,19.6657C29.3894,19.6738 29.0039,19.4729 28.7904,19.1386C28.5769,18.8043 28.5677,18.3874 28.7665,18.045C29.4926,16.7939 29.7543,15.9696 29.7543,14.6054C29.7543,13.9954 29.6752,13.3967 29.5222,12.8199C28.74,9.8796 26.1212,7.8123 23.1364,7.8123C21.4231,7.8123 19.7928,8.486 18.551,9.7102C18.3337,9.9242 18.0338,10.0453 17.7203,10.0455C17.4069,10.0458 17.1068,9.9252 16.8891,9.7115C15.6572,8.5022 13.9894,7.8123 12.3011,7.8123C8.6713,7.8123 5.6832,10.8445 5.6832,14.6054C5.6832,16.4508 6.2319,17.6726 7.6458,19.7373C8.7682,21.3884 10.7236,23.3539 13.1743,25.4268C13.8799,26.023 14.5895,26.5979 15.2833,27.1391L15.9441,27.6484L16.4644,28.0403L16.963,28.4071L17.0388,28.4621C17.2386,28.6083 17.4695,28.6833 17.7181,28.6833C17.9687,28.6833 17.7849,28.6676 18.4086,28.454C19.0322,28.2403 19.6488,28.6043 19.9351,28.8639C20.2112,29.1142 20.2112,29.8454 19.8146,30.1888C19.418,30.5322 18.478,30.8711 17.7188,30.87C17.0249,30.8714 16.3472,30.6712 15.7772,30.2963L15.5596,30.1432L15.0406,29.762L14.3501,29.2395C13.4273,28.5336 12.5229,27.8064 11.6377,27.0585C9.0446,24.865 6.9665,22.7764 5.7083,20.9247C4.0714,18.5362 3.375,16.9851 3.375,14.6054C3.375,9.6683 7.3596,5.625 12.3011,5.625C14.2235,5.625 16.1063,6.2668 17.639,7.4123L17.7161,7.4711L17.7999,7.4073C19.2679,6.3037 21.0379,5.6787 22.8937,5.6281L23.1364,5.625Z"
android:strokeWidth="0.6" android:strokeWidth="0.6"
android:fillColor="#FFFFFF" android:fillColor="#FFFFFF"
android:strokeColor="#FFFFFF" android:strokeColor="#FFFFFF"
android:fillType="nonZero"/> android:fillType="nonZero"/>
<path <path
android:pathData="M25.403,21.32C25.97,21.32 26.436,21.816 26.459,22.445C26.482,23.073 26.055,23.61 25.49,23.662L25.403,23.666L19.357,23.666C18.79,23.666 18.324,23.17 18.301,22.541C18.278,21.913 18.705,21.376 19.27,21.324L19.357,21.32L25.403,21.32L25.403,21.32Z" android:pathData="M28.5779,23.985C29.2159,23.9853 29.7402,24.5434 29.7665,25.2503C29.7927,25.9571 29.3116,26.5612 28.6758,26.6197L28.5779,26.6243L21.7771,26.6243C21.1391,26.6239 20.6148,26.0658 20.5885,25.359C20.5623,24.6521 21.0434,24.0481 21.6792,23.9895L21.7771,23.985L28.5779,23.985L28.5779,23.985Z"
android:strokeWidth="1" android:strokeWidth="1"
android:fillColor="#FFFFFF" android:fillColor="#FFFFFF"
android:fillType="nonZero" android:fillType="nonZero"
android:strokeColor="#00000000"/> android:strokeColor="#00000000"/>
<path <path
android:pathData="M23.546,19.216L23.55,19.303L23.55,25.347C23.549,25.915 23.053,26.381 22.425,26.404C21.797,26.427 21.26,26 21.208,25.435L21.204,25.347L21.204,19.303C21.204,18.719 21.729,18.245 22.377,18.245C22.987,18.245 23.495,18.667 23.546,19.216Z" android:pathData="M26.4888,21.6176L26.4934,21.7155L26.4934,28.5159C26.4931,29.1539 25.9349,29.6781 25.2281,29.7044C24.5212,29.7307 23.9172,29.2496 23.8586,28.6138L23.8541,28.5159L23.8541,21.7155C23.8541,21.0586 24.4453,20.5254 25.1737,20.5254C25.8604,20.5254 26.4323,21.0004 26.4888,21.6176Z"
android:strokeWidth="1" android:strokeWidth="1"
android:fillColor="#FFFFFF" android:fillColor="#FFFFFF"
android:fillType="nonZero" android:fillType="nonZero"
......
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp" android:width="36dp"
android:height="32dp" android:height="36dp"
android:viewportWidth="32" android:viewportWidth="36"
android:viewportHeight="32"> android:viewportHeight="36">
<path <path
android:pathData="M18.654,1C19.129,1 19.515,1.372 19.515,1.83L19.515,2.662C19.515,3.12 19.129,3.492 18.654,3.492L17.793,3.492L17.793,5.156C17.793,5.177 17.782,5.196 17.78,5.217C24.4,5.875 29.325,11.417 28.983,17.825C28.642,24.234 23.154,29.261 16.5,29.261C9.846,29.261 4.358,24.234 4.017,17.825C3.675,11.417 8.6,5.875 15.22,5.217C15.22,5.196 15.207,5.177 15.207,5.156L15.207,3.494L14.346,3.494C14.118,3.494 13.898,3.407 13.736,3.251C13.575,3.095 13.484,2.884 13.484,2.664L13.484,1.83C13.484,1.372 13.869,1 14.344,1M16.679,8.05C13.218,8.005 9.999,9.755 8.255,12.632C6.511,15.509 6.511,19.067 8.255,21.944C9.999,24.821 13.218,26.572 16.679,26.526C21.93,26.458 26.15,22.342 26.15,17.288C26.15,12.235 21.93,8.119 16.679,8.05ZM16.93,10.973C17.406,10.973 17.791,11.345 17.791,11.803L17.791,16.79L21.24,16.79C21.716,16.79 22.101,17.161 22.101,17.62L22.101,18.452C22.101,18.911 21.716,19.282 21.24,19.284L16.068,19.284C15.839,19.284 15.621,19.197 15.459,19.041C15.298,18.885 15.207,18.674 15.207,18.454L15.207,11.801C15.207,11.343 15.592,10.971 16.068,10.971L16.929,10.971L16.93,10.973Z" android:pathData="M20.9855,1.125C21.5204,1.125 21.9539,1.5431 21.9539,2.0588L21.9539,2.9946C21.9539,3.5103 21.5204,3.9284 20.9855,3.9284L20.0171,3.9284L20.0171,5.8C20.0171,5.8239 20.0048,5.8457 20.0027,5.8696C27.4495,6.6089 32.9901,12.8444 32.6062,20.0537C32.2224,27.263 26.0486,32.9185 18.5625,32.9185C11.0764,32.9185 4.9027,27.263 4.5188,20.0537C4.1349,12.8444 9.6755,6.6089 17.1223,5.8696C17.1223,5.8457 17.1079,5.8239 17.1079,5.8L17.1079,3.9304L16.1395,3.9304C15.8823,3.9309 15.6354,3.8328 15.4534,3.6576C15.2713,3.4824 15.169,3.2446 15.169,2.9966L15.169,2.0588C15.169,1.5431 15.6026,1.125 16.1374,1.125M18.7637,9.0562C14.87,9.0052 11.2493,10.9749 9.287,14.2115C7.3248,17.448 7.3248,21.4504 9.287,24.687C11.2493,27.9235 14.87,29.8932 18.7637,29.8423C24.6714,29.765 29.4184,25.1346 29.4184,19.4492C29.4184,13.7639 24.6714,9.1334 18.7637,9.0562ZM19.0467,12.3446C19.5815,12.3446 20.0151,12.7627 20.0151,13.2784L20.0151,18.8892L23.8948,18.8892C24.4305,18.8892 24.8632,19.3065 24.8632,19.8231L24.8632,20.7589C24.8632,21.2754 24.4305,21.6927 23.8948,21.6947L18.0762,21.6947C17.8194,21.6947 17.5731,21.5963 17.3915,21.4211C17.2099,21.246 17.1079,21.0085 17.1079,20.7608L17.1079,13.2765C17.1079,12.7607 17.5414,12.3426 18.0762,12.3426L19.0446,12.3426L19.0467,12.3446Z"
android:strokeWidth="1" android:strokeWidth="1"
android:fillColor="#FFFFFF" android:fillColor="#FFFFFF"
android:fillType="nonZero" android:fillType="nonZero"
......
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp" android:width="36dp"
android:height="32dp" android:height="36dp"
android:viewportWidth="32" android:viewportWidth="36"
android:viewportHeight="32"> android:viewportHeight="36">
<path <path
android:pathData="M5.4974,9.7329L22.7015,9.7329C22.9762,9.7329 23.1989,9.4787 23.1989,9.1653L23.1989,7.5675C23.1989,7.2551 22.9762,7 22.7015,7L5.4974,7C5.2227,7 5,7.2542 5,7.5675L5,9.1653C5,9.4778 5.2227,9.7329 5.4974,9.7329M5.4979,17.9315L18.8706,17.9315C19.1462,17.9315 19.3685,17.6773 19.3685,17.364L19.3685,15.7662C19.3685,15.4528 19.1462,15.1986 18.8706,15.1986L5.4987,15.1986C5.2232,15.1986 5.0009,15.4528 5.0009,15.7662L5.0009,17.364C5.0009,17.6773 5.2232,17.9315 5.4987,17.9315M14.0771,23.3973L5.5013,23.3973C5.2243,23.3973 5,23.6906 5,24.0531L5,25.4742C5,25.8368 5.2243,26.1301 5.5013,26.1301L14.0771,26.1301C14.3541,26.1301 14.5784,25.8368 14.5784,25.4742L14.5784,24.0531C14.5784,23.6906 14.3541,23.3973 14.0771,23.3973M27.5537,11.2257C25.3607,11.4482 23.6014,13.2989 23.5679,15.6311L23.5672,15.6311L23.5672,19.484C23.0651,19.2341 22.5141,19.1048 21.9559,19.1061C19.9407,19.1061 18.3294,20.7404 18.3294,22.7838C18.3294,24.8273 19.9407,26.4615 21.9559,26.4615C23.9703,26.4615 25.6493,24.8273 25.5816,22.7838L25.5816,15.6989C25.5816,14.457 26.4743,13.4436 27.6474,13.2722C27.8484,13.2445 27.9988,13.0693 28,12.8615L28,11.6379C27.9995,11.5207 27.9508,11.4092 27.8658,11.3307C27.7809,11.2523 27.6675,11.2141 27.5537,11.2257" android:pathData="M6.1846,10.9495L25.5392,10.9495C25.8482,10.9495 26.0988,10.6636 26.0988,10.311L26.0988,8.5135C26.0988,8.162 25.8482,7.875 25.5392,7.875L6.1846,7.875C5.8756,7.875 5.625,8.1609 5.625,8.5135L5.625,10.311C5.625,10.6625 5.8756,10.9495 6.1846,10.9495M6.1851,20.1729L21.2294,20.1729C21.5394,20.1729 21.7895,19.887 21.7895,19.5345L21.7895,17.7369C21.7895,17.3844 21.5394,17.0985 21.2294,17.0985L6.1861,17.0985C5.8761,17.0985 5.626,17.3844 5.626,17.7369L5.626,19.5345C5.626,19.887 5.8761,20.1729 6.1861,20.1729M15.8367,26.3219L6.1889,26.3219C5.8773,26.3219 5.625,26.6519 5.625,27.0598L5.625,28.6585C5.625,29.0664 5.8773,29.3964 6.1889,29.3964L15.8367,29.3964C16.1483,29.3964 16.4007,29.0664 16.4007,28.6585L16.4007,27.0598C16.4007,26.6519 16.1483,26.3219 15.8367,26.3219M30.9979,12.6289C28.5308,12.8792 26.5515,14.9612 26.5139,17.5849L26.513,17.5849L26.513,21.9195C25.9483,21.6384 25.3283,21.493 24.7004,21.4944C22.4333,21.4944 20.6206,23.3329 20.6206,25.6318C20.6206,27.9307 22.4333,29.7692 24.7004,29.7692C26.9666,29.7692 28.8555,27.9307 28.7793,25.6318L28.7793,17.6612C28.7793,16.2641 29.7836,15.1241 31.1033,14.9312C31.3295,14.9 31.4987,14.703 31.5,14.4692L31.5,13.0927C31.4995,12.9608 31.4446,12.8354 31.3491,12.7471C31.2535,12.6588 31.126,12.6159 30.9979,12.6289"
android:strokeWidth="1" android:strokeWidth="1"
android:fillColor="#FFFFFF" android:fillColor="#FFFFFF"
android:fillType="nonZero" android:fillType="nonZero"
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF" />
<corners
android:topLeftRadius="@dimen/platform_dp_20"
android:topRightRadius="@dimen/platform_dp_20" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<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"
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>
</FrameLayout>
</androidx.cardview.widget.CardView>
</FrameLayout>
\ No newline at end of file
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,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" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/play_float_background" android:background="@drawable/bg_meditation_play_float"
android:layout_marginHorizontal="16dp" android:layout_marginHorizontal="16dp"
android:layout_marginBottom="20dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
...@@ -12,8 +11,7 @@ ...@@ -12,8 +11,7 @@
android:id="@+id/csl_root_layout" android:id="@+id/csl_root_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="56dp" android:layout_height="56dp"
android:background="@drawable/bg_play_meditation_float_view" android:background="@drawable/bg_play_meditation_float_view">
tools:background="@drawable/play_float_background">
<ImageView <ImageView
android:id="@+id/iv_close" android:id="@+id/iv_close"
...@@ -38,15 +36,22 @@ ...@@ -38,15 +36,22 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_close" > app:layout_constraintStart_toEndOf="@id/iv_close" >
<ImageView <androidx.cardview.widget.CardView
android:id="@+id/iv_cover" android:layout_width="wrap_content"
android:layout_width="40dp" android:layout_height="wrap_content"
android:layout_height="40dp" app:cardCornerRadius="8dp"
android:scaleType="centerCrop" app:cardElevation="0dp">
android:src="@drawable/platform_loading_logo"
app:layout_constraintTop_toTopOf="parent" <ImageView
app:layout_constraintBottom_toBottomOf="parent" android:id="@+id/iv_cover"
app:layout_constraintStart_toEndOf="@id/iv_close" /> android:layout_width="40dp"
android:layout_height="40dp"
android:scaleType="centerCrop"
android:src="@drawable/platform_loading_logo" />
</androidx.cardview.widget.CardView>
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
...@@ -75,7 +80,7 @@ ...@@ -75,7 +80,7 @@
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_gravity="center" android:layout_gravity="center"
app:wheel_unreached_color="#FF282E3F" app:wheel_unreached_color="#33FFFFFF"
app:wheel_reached_color="#FFFFFF" app:wheel_reached_color="#FFFFFF"
app:wheel_unreached_width="2dp" app:wheel_unreached_width="2dp"
app:wheel_reached_width="2dp"/> app:wheel_reached_width="2dp"/>
...@@ -92,4 +97,10 @@ ...@@ -92,4 +97,10 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<com.github.mmin18.widget.RealtimeBlurView
android:layout_width="match_parent"
android:layout_height="56dp"
app:realtimeBlurRadius="10dp"
app:realtimeOverlayColor="#880000"/>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginVertical="28dp" android:layout_marginVertical="28dp"
android:text="确定要结束联系吗?" android:text="确定要结束练习吗?"
android:textColor="#FF242424" android:textColor="#FF242424"
android:textSize="16sp" android:textSize="16sp"
android:layout_gravity="center_horizontal"/> android:layout_gravity="center_horizontal"/>
...@@ -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">
...@@ -16,4 +13,35 @@ ...@@ -16,4 +13,35 @@
</style> </style>
<style name="music_dialog_style" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
<!-- 弹框-底部弹出动画 -->
<style name="dialog_anim" mce_bogus="1" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/dialog_bottom_enter</item>
<item name="android:windowExitAnimation">@anim/dialog_bottom_exit</item>
</style>
<style name="un_full_screen_activity" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="windowNoTitle">true</item>
<item name="background">@color/transparent</item>
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowIsFloating">false</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:backgroundDimAmount">0.5</item>
</style>
</resources> </resources>
\ No newline at end of file
...@@ -492,8 +492,15 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -492,8 +492,15 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
jtv_test?.postDelayed({ YdlBuryPointUtil.sendPv("PvEvent") }, 300) jtv_test?.postDelayed({ YdlBuryPointUtil.sendPv("PvEvent") }, 300)
jtv_test?.postDelayed({ YdlBuryPointUtil.sendClick("ClickEvent") }, 500) jtv_test?.postDelayed({ YdlBuryPointUtil.sendClick("ClickEvent") }, 500)
} else if (id == R.id.ll_meditation) { //冥想 } else if (id == R.id.ll_meditation) { //冥想
val h5Params3 = H5Params(MH5_URL + "meditation?hideNavBar=1", null) count(UserMyPageEvent.YDL_USER_MY_MIDDLE_TYPE_CLICK, "冥想")
NewH5Activity.start(activity, h5Params3) mActivity?.let {
if (!startLoginByStatus(it, true)) {
return
}
val h5Params3 = H5Params(MH5_URL + "meditation/list?hideNavBar=1", null)
NewH5Activity.start(it, h5Params3)
}
} }
} }
......
...@@ -13,8 +13,10 @@ import com.ydl.media.audio.manager.NotifyManager ...@@ -13,8 +13,10 @@ import com.ydl.media.audio.manager.NotifyManager
import com.ydl.media.audio.model.Music import com.ydl.media.audio.model.Music
import com.ydl.media.audio.receiver.NoisyAudioStreamReceiver import com.ydl.media.audio.receiver.NoisyAudioStreamReceiver
import com.ydl.media.audio.utils.PlayProgressUtil import com.ydl.media.audio.utils.PlayProgressUtil
import com.ydl.ydlcommon.event.MeditationFloatEvent
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import de.greenrobot.event.EventBus
import tv.danmaku.ijk.media.player.IMediaPlayer import tv.danmaku.ijk.media.player.IMediaPlayer
import tv.danmaku.ijk.media.player.IjkMediaPlayer import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.io.IOException import java.io.IOException
...@@ -341,6 +343,10 @@ class AudioPlayer private constructor() { ...@@ -341,6 +343,10 @@ class AudioPlayer private constructor() {
listener.onPlayerStart() listener.onPlayerStart()
} }
} }
val event = MeditationFloatEvent(show = false, stop = true, time = null)
EventBus.getDefault().post(event)
} }
/** /**
......
package com.ydl.ydlcommon.event
class MeditationFloatEvent(
val show: Boolean,
val stop: Boolean? = null,
val time: Long? = null
// val meditation: MeditationPlayModuleBean.MeditationDetail? = null,
// val meditations: ArrayList<MeditationPlayModuleBean.MeditationDetail>? = null
)
\ No newline at end of file
...@@ -61,6 +61,8 @@ interface IYDLRouterConstant{ ...@@ -61,6 +61,8 @@ interface IYDLRouterConstant{
const val ROUTER_CHAT_CONSULT_ASSISTANT = ROUTER_BASE + "chat/ChatService" const val ROUTER_CHAT_CONSULT_ASSISTANT = ROUTER_BASE + "chat/ChatService"
//冥想过渡页面 //冥想过渡页面
const val ROUTER_MUSE_CENTER = ROUTER_BASE + "muse/MuseService" const val ROUTER_MUSE_CENTER = ROUTER_BASE + "muse/MuseService"
//冥想播放页面
const val ROUTER_MUSE_PLAY = ROUTER_BASE + "muse/play"
/** /**
* 参数名称 * 参数名称
*/ */
......
...@@ -167,6 +167,9 @@ class H5JsBean { ...@@ -167,6 +167,9 @@ class H5JsBean {
var buried:String?=null var buried:String?=null
val color:String?=null
val alpha:String?=null
// meditation end // meditation end
} }
......
...@@ -9,6 +9,7 @@ import android.content.Context; ...@@ -9,6 +9,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
...@@ -1065,12 +1066,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -1065,12 +1066,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
} }
} }
public void onEvent(ReloadUrlEvent event) {
//刷新页面
loadUrl(event.getUrl());
shouldClearHistory = true;
}
public void onEvent(UserBindPhoneEvent event) { public void onEvent(UserBindPhoneEvent event) {
//刷新页面 //刷新页面
loadUrl(h5Params.getUrl()); loadUrl(h5Params.getUrl());
...@@ -1517,4 +1512,16 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -1517,4 +1512,16 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
EventBus.getDefault().post(event); EventBus.getDefault().post(event);
} }
public void setBG(String color,String alpha){
try {
store_house_ptr_frame.setBackgroundColor(Color.parseColor(color));
int a = Integer.valueOf(alpha);
store_house_ptr_frame.getBackground().setAlpha(a);
}catch (Exception ex){
}
}
} }
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:id="@+id/rl_root">
<com.ydl.ydlcommon.ui.LogoLoadingView <com.ydl.ydlcommon.ui.LogoLoadingView
android:id="@+id/v_loading" android:id="@+id/v_loading"
...@@ -51,6 +52,7 @@ ...@@ -51,6 +52,7 @@
android:id="@+id/wv_content" android:id="@+id/wv_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/platform_transparent"/> android:background="@color/platform_transparent"/>
</in.srain.cube.views.ptr.PtrFrameLayout> </in.srain.cube.views.ptr.PtrFrameLayout>
</LinearLayout> </LinearLayout>
......
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