| | |
| | | <activity android:name=".ui.course.CourseSearchResultActivity" android:label="泉疗愈"/> |
| | | <activity android:name=".ui.course.StudyActivity" android:configChanges="orientation|screenSize|keyboardHidden"/> |
| | | <activity android:name=".ui.home.BuyVoiceActivity" android:label="确认订单"/> |
| | | <activity android:name=".ui.home.MicroVideoActivity" android:launchMode="singleTask" android:configChanges="orientation|screenSize|keyboardHidden" /> |
| | | |
| | | <service android:name="com.amap.api.location.APSService"/> |
| | | |
| | |
| | | bgPlayer?.setVolume(volume.toFloat()/100) |
| | | bgPlayer?.loopPlayMusic(this,data?.audioFile) |
| | | } |
| | | (fragments[0] as HomeFragment).changeBg(data?.imageUrl?:"") |
| | | (fragments[0] as HomeFragment).changeBg(data?.imageUrl?:"",data?.backUrl?:"") |
| | | } |
| | | } |
| | | |
| | |
| | | open fun heightMatch() = false |
| | | |
| | | var isFirstResume = true |
| | | var canceledOnTouchOutside = true |
| | | open var canceledOnTouchOutside = true |
| | | |
| | | var mCancelable = true; |
| | | |
| | |
| | | private val isAlert by lazy { //是否仅显示提示信息 |
| | | arguments?.getBoolean("isAlert",false)?:false |
| | | } |
| | | private val title by lazy { //标题 |
| | | arguments?.getString("title")?:"提示" |
| | | } |
| | | private val msg by lazy { //提示信息 |
| | | arguments?.getString("msg")?:"是否确定取消订单?" |
| | | } |
| | |
| | | tv_msg.text = SpanBuilder(msg).color(requireContext(),6,msg.length-2,R.color.colorPrimary).build() |
| | | else |
| | | tv_msg.text = msg |
| | | tv_title.text = title |
| | | tv_ok.text = ok |
| | | tv_cancel.text = cancel |
| | | |
| | |
| | | } |
| | | |
| | | companion object{ |
| | | fun show(fm:FragmentManager,msg:String,callback: OnClickCallback,ok:String = "确认",cancel:String="关闭",isAlert:Boolean = false){ |
| | | fun show(fm:FragmentManager,msg:String,callback: OnClickCallback,ok:String = "确认",cancel:String="关闭",isAlert:Boolean = false,title:String = "提示"){ |
| | | val tipDialog = TipDialog() |
| | | tipDialog.arguments = bundleOf("msg" to msg,"ok" to ok,"cancel" to cancel,"isAlert" to isAlert) |
| | | tipDialog.arguments = bundleOf("msg" to msg,"ok" to ok,"cancel" to cancel,"isAlert" to isAlert,"title" to title) |
| | | tipDialog.setCallback(callback) |
| | | tipDialog.showAllowingStateLoss(fm,"tip") |
| | | } |
| | |
| | | package com.sinata.xqmuse.dialog |
| | | |
| | | import android.content.DialogInterface |
| | | import android.view.Gravity |
| | | import android.view.KeyEvent |
| | | import androidx.core.os.bundleOf |
| | | import androidx.fragment.app.FragmentManager |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import com.sinata.xqmuse.R |
| | | import kotlinx.android.synthetic.main.dialog_tip_tree.* |
| | | import org.jetbrains.anko.support.v4.toast |
| | | |
| | | class TreeTipDialog:BaseDialogFragment() { |
| | | override fun setContentView() = R.layout.dialog_tip_tree |
| | |
| | | private val title by lazy { arguments?.getString("title") } |
| | | private val msg by lazy { arguments?.getString("msg") } |
| | | |
| | | var onDismissCallback:OnDismissCallback? = null |
| | | override var canceledOnTouchOutside = false |
| | | |
| | | override fun initView() { |
| | | if (msg!=null) //升级弹窗时,语音播完才能关闭弹窗 |
| | | tv_ok.isEnabled = false |
| | | tv_ok.setOnClickListener { dismissAllowingStateLoss() } |
| | | if (!title.isNullOrEmpty()) |
| | | tv_title.text = title |
| | | if (!msg.isNullOrEmpty()) |
| | | tv_msg.text = msg |
| | | dialog?.setOnKeyListener { dialog, keyCode, event -> |
| | | if (keyCode == KeyEvent.KEYCODE_BACK&&event.action == KeyEvent.ACTION_UP&&!tv_ok.isEnabled){ |
| | | //语音未播完不可返回 |
| | | return@setOnKeyListener true |
| | | } |
| | | return@setOnKeyListener false |
| | | } |
| | | } |
| | | |
| | | fun canDismiss(){ |
| | | tv_ok?.isEnabled = true |
| | | } |
| | | |
| | | override fun onDismiss(dialog: DialogInterface) { |
| | | super.onDismiss(dialog) |
| | | onDismissCallback?.onDismiss() |
| | | } |
| | | |
| | | interface OnDismissCallback{ |
| | | fun onDismiss() |
| | | } |
| | | |
| | | companion object{ |
| | | fun show(fm:FragmentManager,title:String?=null,msg:String?=null){ |
| | | fun show(fm:FragmentManager,title:String?=null,msg:String?=null):TreeTipDialog{ |
| | | val treeTipDialog = TreeTipDialog() |
| | | treeTipDialog.arguments = bundleOf("title" to title,"msg" to msg) |
| | | treeTipDialog.showAllowingStateLoss(fm,"first") |
| | | return treeTipDialog |
| | | } |
| | | } |
| | | } |
| | |
| | | val audioFile: String, |
| | | val audioFileName: String, |
| | | val id: String, |
| | | val imageUrl: String |
| | | val imageUrl: String, |
| | | val backUrl: String |
| | | ) |
| | |
| | | val time: Int?, |
| | | val imageUrl: String, |
| | | val meditationId: String, |
| | | val startPlayTime: String |
| | | val startPlayTime: String, |
| | | //每日疗愈新增字段 |
| | | val meditationVideo: MicroVideo, |
| | | val isShow: Int //0展示每日疗愈 1展示微电影 |
| | | ) |
| | | |
| | | data class CommonItemBean( |
| | |
| | | val id: String, |
| | | val secondIconUrl: String, |
| | | val showType: Int? |
| | | ) |
| | | |
| | | data class MicroVideo( |
| | | val id: String, |
| | | val imageUrl: String, |
| | | val title: String, |
| | | val isShow: Int, |
| | | val updateBy: String, |
| | | val videoName: String, |
| | | val videoSecond: Int, |
| | | val videoUrl: String |
| | | ) |
| | |
| | | private val cardBannerAdapter by lazy { BgmBannerAdapter(list,this) } |
| | | private val fromPrivacy by lazy { intent.getBooleanExtra("fromPrivacy",false) } //从私人定制过来,设置完成需要发送停止引导的事件 |
| | | private val player by lazy { AudioUtils() } |
| | | private var isSilent = false //true:bgm静音 |
| | | |
| | | override fun initClick() { |
| | | iv_back.setOnClickListener { finish() } |
| | |
| | | } |
| | | }) |
| | | |
| | | sb_silent.setOnClickListener { |
| | | isSilent = !isSilent |
| | | sb_silent.setImageResource(if (!isSilent) R.mipmap.sw_on else R.mipmap.sw_off) |
| | | } |
| | | |
| | | tv_action.setOnClickListener { |
| | | if (list.isNotEmpty()){ //存bgm和bg |
| | | tv_action.isEnabled = false |
| | | HttpManager.saveUserHomeBackgroundMusic(list[banner_landscape.currentItem].id).request(this,success = {_,_-> |
| | | //存音量 |
| | | SPUtils.instance().put(Const.User.VOLUME,sb_voice.progress).apply() |
| | | // SPUtils.instance().put(Const.User.VOLUME,sb_voice.progress).apply() |
| | | SPUtils.instance().put(Const.User.VOLUME,if (isSilent) 0 else 50).apply() |
| | | SPUtils.instance().put(Const.User.BG,list[banner_landscape.currentItem].imageUrl) |
| | | .put(Const.User.BGM,list[banner_landscape.currentItem].audioFile).apply() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.CHANGE_BGM)) |
| | |
| | | banner_landscape.setBannerGalleryEffect(110,12,0.85f) |
| | | player.setOnAudioStatusUpdateListener(this) |
| | | sb_voice.progress = SPUtils.instance().getInt(Const.User.VOLUME,50) |
| | | isSilent = SPUtils.instance().getInt(Const.User.VOLUME,50) == 0 |
| | | sb_silent.setImageResource(if (!isSilent) R.mipmap.sw_on else R.mipmap.sw_off) |
| | | player.setVolume(sb_voice.progress.toFloat()/100) |
| | | getData() |
| | | } |
| | |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.XQApplication |
| | | import com.sinata.xqmuse.dialog.TipDialog |
| | | import com.sinata.xqmuse.dialog.UserRuleDialog |
| | | import com.sinata.xqmuse.network.Apis |
| | | import com.sinata.xqmuse.network.HttpManager |
| | |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.umeng.commonsdk.UMConfigure |
| | | import kotlinx.android.synthetic.main.activity_splash.* |
| | | import org.jetbrains.anko.browse |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | import java.io.ByteArrayInputStream |
| | | import java.security.cert.CertificateException |
| | | import java.security.cert.CertificateFactory |
| | |
| | | if (SPUtils.instance().getBoolean(Const.User.IS_AGREE)){ |
| | | AMapLocationClient.updatePrivacyShow(this,true,true) |
| | | AMapLocationClient.updatePrivacyAgree(this,true) |
| | | startNext() |
| | | checkNewVersion() |
| | | }else{ |
| | | getAgreement() |
| | | } |
| | |
| | | AMapLocationClient.updatePrivacyShow(this@SplashActivity,true,true) |
| | | AMapLocationClient.updatePrivacyAgree(this@SplashActivity,true) |
| | | } else |
| | | startNext() |
| | | checkNewVersion() |
| | | } |
| | | }) |
| | | userRuleDialog.show(supportFragmentManager, "rule") |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 检查更新 |
| | | */ |
| | | private fun checkNewVersion() { |
| | | HttpManager.detailVersion().request(this,success = {_,data-> |
| | | if (data?.versionNo.isNullOrEmpty()||data!!.versionNo <= getAppVersion(this)?:"") //已经是新版本 |
| | | startNext() |
| | | else if (data.versionNo == SPUtils.instance().getString(Const.IGNORE_VERSION)){ //已手动跳过当前版本 |
| | | startNext() |
| | | }else |
| | | TipDialog.show(supportFragmentManager,data.remark,object : TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | browse(data.androidFile) |
| | | finish() |
| | | } |
| | | |
| | | override fun onCancel() { |
| | | SPUtils.instance().put(Const.IGNORE_VERSION,data?.versionNo).apply() |
| | | startNext() |
| | | } |
| | | },"立即更新","下次再说",false,"有新版本啦!") |
| | | }){_,_-> |
| | | startNext() |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取版本号 |
| | | * @return 当前应用的版本号 |
| | | */ |
| | | private fun getAppVersion(context: Context): String? { |
| | | return try { |
| | | val manager = context.packageManager |
| | | val info = manager.getPackageInfo(context.packageName, 0) |
| | | info.versionName |
| | | } catch (e: Exception) { |
| | | e.printStackTrace() |
| | | "null" |
| | | } |
| | | } |
| | | |
| | | /*** |
| | | * 跳转下一步 |
| | | */ |
| | | private fun gotoMainOrLogin(){ |
| | | object : CountDownTimer(2000, 500) { |
| | | object : CountDownTimer(1500, 500) { |
| | | override fun onFinish() { |
| | | startActivity<MainActivity>("code" to code) |
| | | finish() |
| | |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.activity_guide.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | |
| | | class GuideActivity : TransparentStatusBarActivity(){ |
| | |
| | | onBackPressed() |
| | | } |
| | | tv_action.setOnClickListener { |
| | | val bgTipDialog = BgTipDialog() |
| | | bgTipDialog.show(supportFragmentManager, "bg") |
| | | startActivity<Guide2Activity>() |
| | | finish() |
| | | // val bgTipDialog = BgTipDialog() |
| | | // bgTipDialog.show(supportFragmentManager, "bg") |
| | | } |
| | | } |
| | | |
| | |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import cn.sinata.xldutils.invisible |
| | | import cn.sinata.xldutils.utils.ellipsize |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.MainActivity |
| | |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import kotlinx.android.synthetic.main.fragment_home.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | import org.jetbrains.anko.support.v4.toast |
| | | |
| | |
| | | getToday() |
| | | getPrivacy() |
| | | getList() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.CHANGE_BGM)) //BGM切换流程 |
| | | } |
| | | |
| | | private fun initClick() { |
| | |
| | | } |
| | | iv_today.setOnClickListener { |
| | | if (today!=null){ |
| | | if (MainActivity.voice?.id == today?.meditationId){ |
| | | if (today?.isShow == 1){ //跳转播放微电影 |
| | | startActivity<MicroVideoActivity>("url" to today?.meditationVideo?.videoUrl,"title" to today?.meditationVideo?.title) |
| | | }else if (MainActivity.voice?.id == today?.meditationId){ |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.PAUSE_OR_RESUME_THINK)) |
| | | if (MainActivity.playing) //播放中 |
| | | iv_play_today.setImageResource(R.mipmap.player_pause) |
| | |
| | | iv_pri_empty.setOnClickListener { startActivity<LoginActivity>() } |
| | | } |
| | | |
| | | fun changeBg(bg:String){ |
| | | if (!bg.isNullOrEmpty()) |
| | | fun changeBg(bg:String,video:String){ |
| | | if (video.isNotEmpty()){ |
| | | iv_home.invisible() |
| | | player.visible() |
| | | player.release() |
| | | player.setUrl(video) |
| | | player.setLooping(true) |
| | | player.start() |
| | | } else if (bg.isNotEmpty()){ |
| | | iv_home.setImageURI(bg) |
| | | player.release() |
| | | player.gone() |
| | | iv_home.visible() |
| | | } |
| | | } |
| | | |
| | | private fun getTopMenu(){ |
| | |
| | | fun getToday() { |
| | | HttpManager.getTodayMeditation().requestByF(this){_,data-> |
| | | today = data |
| | | if (today?.clientMeditationVO?.backgroundUrl.isNullOrEmpty()){ |
| | | iv_daily_empty.visible() |
| | | if (data?.isShow == 0){ |
| | | if (today?.clientMeditationVO?.backgroundUrl.isNullOrEmpty()){ |
| | | iv_daily_empty.visible() |
| | | }else{ |
| | | iv_daily_empty.gone() |
| | | iv_today.setImageURI(today?.imageUrl) |
| | | tv_length_today.text = "${today?.clientMeditationVO?.meditationTitle?.ellipsize(12)} | ${"%02d:%02d".format((data?.time?:0)/60,(data?.time?:0)%60)}" |
| | | tv_today_count.text = "${(today?.clientMeditationVO?.realLearnedNum?:0)+(today?.clientMeditationVO?.virtualLearnedNum?:0)}人已参加学习" |
| | | } |
| | | }else{ |
| | | iv_daily_empty.gone() |
| | | iv_today.setImageURI(today?.imageUrl) |
| | | tv_length_today.text = "${today?.clientMeditationVO?.meditationTitle?.ellipsize(12)} | ${"%02d:%02d".format((data?.time?:0)/60,(data?.time?:0)%60)}" |
| | | tv_today_count.text = "${(today?.clientMeditationVO?.realLearnedNum?:0)+(today?.clientMeditationVO?.virtualLearnedNum?:0)}人已参加学习" |
| | | if (today?.meditationVideo?.videoUrl.isNullOrEmpty()){ |
| | | iv_daily_empty.visible() |
| | | }else{ |
| | | iv_daily_empty.gone() |
| | | iv_today.setImageURI(today?.meditationVideo?.imageUrl) |
| | | tv_length_today.text = "${today?.meditationVideo?.title?.ellipsize(18)} | ${"%02d:%02d".format((today?.meditationVideo?.videoSecond?:0)/60,(today?.meditationVideo?.videoSecond?:0)%60)}" |
| | | tv_today_count.text = "" |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun onPause() { |
| | | super.onPause() |
| | | player?.pause() |
| | | } |
| | | |
| | | override fun onResume() { |
| | | super.onResume() |
| | | player?.resume() |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | | super.onDestroy() |
| | | player?.release() |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.home |
| | | |
| | | import cn.sinata.xldutils.gone |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_micro_video.* |
| | | import xyz.doikki.videocontroller.StandardVideoController |
| | | |
| | | class MicroVideoActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_micro_video |
| | | |
| | | override fun initClick() { |
| | | iv_back.setOnClickListener { finish() } |
| | | } |
| | | |
| | | override fun initView() { |
| | | titleBar.gone() |
| | | val title = intent.getStringExtra("title") |
| | | tv_title.text = title |
| | | val controller = StandardVideoController(this) |
| | | controller.addDefaultControlComponent(title, false) |
| | | mVideoView.setVideoController(controller) //设置控制器 |
| | | mVideoView.release() |
| | | mVideoView.setUrl(intent.getStringExtra("url")) //设置视频地址 |
| | | mVideoView.start() |
| | | } |
| | | |
| | | override fun onPause() { |
| | | super.onPause() |
| | | mVideoView.pause() |
| | | } |
| | | |
| | | override fun onResume() { |
| | | super.onResume() |
| | | mVideoView.resume() |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | | super.onDestroy() |
| | | mVideoView.release() |
| | | } |
| | | |
| | | |
| | | override fun onBackPressed() { |
| | | if (!mVideoView.onBackPressed()) { |
| | | super.onBackPressed() |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import android.content.Context |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.LoginRuleDialog |
| | |
| | | if (data?.versionNo.isNullOrEmpty()||data!!.versionNo <= getAppVersion(this@SettingActivity)?:"") |
| | | toast("已经是最新版本") |
| | | else |
| | | TipDialog.show(supportFragmentManager,"当前有新版本,是否更新?",object :TipDialog.OnClickCallback{ |
| | | TipDialog.show(supportFragmentManager,data.remark,object :TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | // DownloadUtil(this@SettingActivity).downloadAPK(data.androidFile, "泉疗愈") |
| | | // toast("后台开始下载,请等待") |
| | |
| | | |
| | | override fun onCancel() { |
| | | } |
| | | }) |
| | | },"立即更新","下次再说",false,"有新版本啦!") |
| | | } |
| | | } |
| | | } |
| | |
| | | override fun initView() { |
| | | titleBar.gone() |
| | | data = intent.getParcelableExtra("data") |
| | | tv_version.text = "当前版本:"+getAppVersion(this) |
| | | tv_update.text = SpanBuilder("版本更新 当前版本:"+getAppVersion(this)).size(0,4,14).build() |
| | | isPush = SPUtils.instance().getBoolean(Const.IS_PUSH,true) |
| | | iv_push.setImageResource(if (isPush) R.mipmap.sw_on else R.mipmap.sw_off) |
| | | checkVirsion() |
| | | } |
| | | |
| | | private fun checkVirsion() { |
| | | HttpManager.detailVersion().request(this){_,data-> |
| | | if (data?.versionNo.isNullOrEmpty()||data!!.versionNo <= getAppVersion(this@SettingActivity)?:"") |
| | | else |
| | | tv_new.visible() |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | // if (virtualBarHeigh >= getNavigationBarHeight()) //如果虚拟导航栏高度大于或等于导航栏高度,说明虚拟导航栏在显示,需要减去导航栏的高度 |
| | | // behavior.setPeekHeight(dip(63) + getNavigationBarHeight(), true) |
| | | // else |
| | | behavior.setPeekHeight(dip(63), true) |
| | | behavior.setPeekHeight(dip(63), true) |
| | | tv_rule.setOnClickListener { |
| | | HttpManager.getH5(6).requestByF(this){ _, data-> |
| | | data?.let { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | tv_sign.clickDelay { |
| | | HttpManager.sign().requestByF(this){_,data-> |
| | | tv_sign.isEnabled = false |
| | |
| | | // showTreeAnim(tree!!.getTreeApng(),true) |
| | | // audioPlayer.startPlayMusic(requireContext(),tree!!.getLevelUpAudio()) |
| | | // TreeTipDialog.show(childFragmentManager,"升级","恭喜!你的树苗已升级为${tree!!.getLevelName()}阶段!") |
| | | |
| | | if (tree?.energyValue == 0) |
| | | toast("能量值不足") |
| | | // else if (tree?.status == 1) |
| | |
| | | tree?.energyValue = energyValue |
| | | tv_power.text = "当前能量值:${(tree?.energyValue?:0)}" |
| | | if (tree!!.treeLevelType != data.treeLevelType){ |
| | | tree!!.treeLevelType = data.treeLevelType |
| | | showTreeAnim(tree!!.getTreeApng(),true) |
| | | audioPlayer.startPlayMusic(requireContext(),tree!!.getLevelUpAudio()) |
| | | TreeTipDialog.show(childFragmentManager,"生命之树",tree!!.getLevelName()) |
| | | showGrowUpDialog(data.treeLevelType) |
| | | }else if (tree!!.status != 2){ |
| | | tree!!.status = 2 |
| | | showTreeAnim(tree!!.getTreeApng(),tree!!.treeLevelType != 1) |
| | |
| | | if (data == true) |
| | | showFirst() |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 依次弹窗升级和播放语音 |
| | | */ |
| | | private fun showGrowUpDialog(targetLevel:Int){ |
| | | tree!!.treeLevelType++ |
| | | showTreeAnim(tree!!.getTreeApng(),true) |
| | | audioPlayer.startPlayMusic(requireContext(),tree!!.getLevelUpAudio()) |
| | | val dialog = TreeTipDialog.show(childFragmentManager,"生命之树",tree!!.getLevelName()) |
| | | audioPlayer.setOnAudioStatusUpdateListener(object :AudioUtils.OnAudioStatusUpdateListener{ |
| | | override fun onUpdate(db: Double, time: Long) { |
| | | } |
| | | |
| | | override fun onStop(filePath: String?) { |
| | | } |
| | | |
| | | override fun onStartPlay() { |
| | | } |
| | | |
| | | override fun onFinishPlay() { |
| | | dialog.canDismiss() |
| | | } |
| | | |
| | | override fun onGetDuration(duration: Int) { |
| | | } |
| | | }) |
| | | dialog.onDismissCallback = object :TreeTipDialog.OnDismissCallback{ |
| | | override fun onDismiss() { |
| | | if (tree!!.treeLevelType != targetLevel) //继续展示下一级 |
| | | showGrowUpDialog(targetLevel) |
| | | else{ |
| | | audioPlayer.setOnAudioStatusUpdateListener(null) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | fun getTree(){ |
| | |
| | | val resourceId: Int = resources.getIdentifier("navigation_bar_height", "dimen", "android") |
| | | val height: Int = resources.getDimensionPixelSize(resourceId) |
| | | return height |
| | | } |
| | | |
| | | companion object{ |
| | | const val TAG_TREE = "TAG_TREE" |
| | | } |
| | | } |
| | |
| | | |
| | | const val FIRST_LAUNCH = "isFirst" |
| | | const val IS_PUSH = "isPush" |
| | | const val IGNORE_VERSION = "ignoreVersion" //手动跳过的版本号 |
| | | |
| | | val OSS_DOMAIN = "https://xqgwzh.obs.cn-south-1.myhuaweicloud.com/" |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="#BEF3FA"/> |
| | | <corners android:radius="13dp"/> |
| | | </shape> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <item android:state_selected="true" android:drawable="@mipmap/ic_full"/> |
| | | <item android:drawable="@mipmap/ic_origin"/> |
| | | <item android:state_selected="true" android:drawable="@mipmap/ic_origin"/> |
| | | <item android:drawable="@mipmap/ic_full"/> |
| | | |
| | | </selector> |
| | |
| | | android:layout_marginTop="28dp" |
| | | android:layout_marginStart="14dp" |
| | | app:layout_constraintStart_toStartOf="parent"/> |
| | | |
| | | <ImageView |
| | | android:id="@+id/sb_silent" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="@id/tv_1" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_1" |
| | | android:src="@mipmap/sw_on" |
| | | android:layout_marginEnd="12dp" |
| | | app:layout_constraintEnd_toEndOf="parent"/> |
| | | |
| | | <SeekBar |
| | | android:layout_width="0dp" |
| | | android:layout_height="16dp" |
| | |
| | | app:layout_constraintStart_toEndOf="@id/iv_silent" |
| | | app:layout_constraintEnd_toStartOf="@id/iv_max" |
| | | android:progress="50" |
| | | android:visibility="gone" |
| | | android:thumb="@drawable/thumb" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | android:layout_marginTop="27dp" |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/jingyin" |
| | | android:visibility="gone" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="@id/sb_voice" |
| | | app:layout_constraintBottom_toBottomOf="@id/sb_voice" |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/yinliang" |
| | | android:visibility="gone" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="@id/sb_voice" |
| | | app:layout_constraintBottom_toBottomOf="@id/sb_voice" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:background="@color/black"> |
| | | <xyz.doikki.videoplayer.player.VideoView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:id="@+id/mVideoView" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent"/> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:id="@+id/cl_title" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="192dp"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/iv_back" |
| | | android:src="@mipmap/icon_back_white" |
| | | android:padding="10dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginTop="44dp" |
| | | android:layout_marginStart="4dp" /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="55dp" |
| | | android:textColor="@color/white" |
| | | android:textSize="18sp" |
| | | android:textStyle="bold" |
| | | android:id="@+id/tv_title"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_form_text" |
| | | android:text="版本更新" |
| | | android:textSize="10sp" |
| | | android:paddingHorizontal="12dp" |
| | | android:drawableEnd="@mipmap/more_black"/> |
| | | <TextView |
| | |
| | | android:layout_centerVertical="true" |
| | | android:layout_alignParentEnd="true" |
| | | android:layout_marginEnd="40dp" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor" |
| | | android:text="当前版本:" |
| | | android:id="@+id/tv_version"/> |
| | | android:textSize="10sp" |
| | | android:textColor="#21A2B5" |
| | | android:paddingVertical="3dp" |
| | | android:visibility="gone" |
| | | android:paddingHorizontal="8dp" |
| | | android:background="@drawable/bg_new_virsion" |
| | | android:text="新版本" |
| | | android:elevation="2dp" |
| | | android:id="@+id/tv_new"/> |
| | | </RelativeLayout> |
| | | |
| | | <View |
| | |
| | | android:textStyle="bold" |
| | | android:layout_marginTop="22dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:background="@drawable/bg_btn_enable" |
| | | android:background="@drawable/selector_bg_btn" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_msg"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | <xyz.doikki.videoplayer.player.VideoView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:screenScaleType="type_center_crop" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintDimensionRatio="39:42" |
| | | app:playerBackgroundColor="@color/white" |
| | | android:id="@+id/player"/> |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | |
| | | android:background="@color/page_bg" |
| | | app:layout_constraintTop_toBottomOf="@id/banner_privacy"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_3" |
| | | android:text="新手冥想指南" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="19dp" |
| | | android:layout_marginEnd="19dp" |
| | | android:drawableEnd="@mipmap/ic_finger" |
| | | app:layout_constraintTop_toBottomOf="@id/banner_privacy" |
| | | android:layout_marginTop="9dp" |
| | | android:textSize="21sp" |
| | |
| | | app:layout_constraintTop_toBottomOf="@id/tv_3" |
| | | android:scaleType="centerCrop" |
| | | android:layout_marginTop="6dp" |
| | | android:visibility="gone" |
| | | android:src="@mipmap/bg_guide"/> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="9dp" |
| | | android:background="@color/page_bg" |
| | | android:layout_marginTop="6dp" |
| | | app:layout_constraintTop_toBottomOf="@id/iv_guide"/> |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | app:layout_constraintTop_toBottomOf="@id/iv_guide" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="50dp" |