| | |
| | | applicationId "com.sinata.xqmuse" |
| | | minSdkVersion 21 |
| | | targetSdkVersion 30 |
| | | versionCode 3 |
| | | versionName "1.2" |
| | | versionCode 8 |
| | | versionName "1.7" |
| | | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| | | } |
| | | |
| | |
| | | <!--用于访问网络,网络定位需要上网--> |
| | | <uses-permission android:name="android.permission.INTERNET" /> |
| | | <!--用于读取手机当前的状态--> |
| | | <uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
| | | <!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />--> |
| | | <!--用于写入缓存数据到扩展存储卡--> |
| | | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
| | | <!--用于申请调用A-GPS模块--> |
| | |
| | | override fun onCreate() { |
| | | super.onCreate() |
| | | registerActivityLifecycleCallbacks(this) |
| | | UMConfigure.preInit(this, Const.UMENG_KEY, "") |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | private fun startBgm() { |
| | | val bgm = SPUtils.instance().getString(Const.User.BGM) |
| | | if (!bgm.isNullOrEmpty()){ |
| | | HttpManager.getHomeBackgroundMusicByUserId().request(this){_,data-> |
| | | if (!data?.audioFile.isNullOrEmpty()){ |
| | | if (bgPlayer == null) |
| | | bgPlayer = AudioUtils() |
| | | val volume = SPUtils.instance().getInt(Const.User.VOLUME,50) |
| | | bgPlayer?.setVolume(volume.toFloat()/100) |
| | | bgPlayer?.loopPlayMusic(this,bgm) |
| | | bgPlayer?.loopPlayMusic(this,data?.audioFile) |
| | | } |
| | | (fragments[0] as HomeFragment).changeBg(data?.imageUrl?:"") |
| | | } |
| | | } |
| | | |
| | |
| | | startBgm() |
| | | else |
| | | isBGMChanged = true //正在播放疗愈,无法立即切换背景音乐 |
| | | (fragments[0] as HomeFragment).changeBg() |
| | | }else if(e.code == Const.EventCode.START_THINK){ |
| | | startThink() |
| | | }else if(e.code == Const.EventCode.FINISH_THINK){ |
| | |
| | | package com.sinata.xqmuse.dialog |
| | | |
| | | import android.content.DialogInterface |
| | | import android.view.Gravity |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.activity.BaseActivity |
| | |
| | | override fun setContentView() = R.layout.dialog_comment |
| | | |
| | | override fun setGravity() = Gravity.BOTTOM |
| | | |
| | | private val voiceId by lazy { arguments?.getString("id")?:"" } |
| | | private var page = 1 |
| | | private val list = arrayListOf<Comment>() |
| | | private val adapter by lazy { CommentAdapter(list,requireActivity() as BaseActivity) } |
| | | var callback:StringCallback? = null |
| | | private var dismissed = false |
| | | |
| | | override fun initView() { |
| | | iv_close.setOnClickListener { dismissAllowingStateLoss() } |
| | |
| | | |
| | | private fun getData(){ |
| | | HttpManager.getMeditationQuestionPage(voiceId,page).request(requireActivity() as BaseActivity,success = { _, data-> |
| | | if (!dismissed){ |
| | | tv_count.text = "${data?.total}条提问" |
| | | if (page == 1) |
| | | list.clear() |
| | |
| | | refreshLayout.finishRefresh() |
| | | else |
| | | refreshLayout.finishLoadMore() |
| | | } |
| | | }){_,_-> |
| | | if (!dismissed){ |
| | | if (page == 1) |
| | | refreshLayout.finishRefresh(false) |
| | | else |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun onDismiss(dialog: DialogInterface) { |
| | | super.onDismiss(dialog) |
| | | dismissed = true |
| | | } |
| | | } |
| | |
| | | fun verifyCellPhone( |
| | | @Header("Authorization") token: String, |
| | | @Body body: String |
| | | ): Flowable<ResultData<Any>> |
| | | ): Flowable<ResultData<LoginBean>> |
| | | |
| | | @GET(Apis.getTagList) |
| | | fun getTagList(): Flowable<ResultData<ArrayList<TagBean>>> |
| | |
| | | @Query("id") id: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.saveUserHomeBackgroundMusic) |
| | | fun saveUserHomeBackgroundMusic( |
| | | @Query("id") id: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @GET(Apis.getHomeBackgroundMusicByUserId) |
| | | fun getHomeBackgroundMusicByUserId(): Flowable<ResultData<BGMBean>> |
| | | |
| | | @POST(Apis.gvieCourse) |
| | | fun gvieCourse( |
| | | @Query("targetId") courseId: String, |
| | |
| | | const val confirmOrderVoice = "meditation/client/meditation/meditation/confirmOrder" |
| | | const val successOrderVoice = "meditation/client/meditation/meditation/successOrder" |
| | | const val saveViewingHistory = "user/user/app-user-viewing-history/saveViewingHistory" |
| | | const val saveUserHomeBackgroundMusic = "meditation/client/meditation/home/saveUserHomeBackgroundMusic" |
| | | const val getHomeBackgroundMusicByUserId = "meditation/client/meditation/home/getHomeBackgroundMusicByUserId" |
| | | |
| | | /** |
| | | * 我的 |
| | |
| | | /** |
| | | * 微信登录-绑定手机号 |
| | | */ |
| | | fun verifyCellPhone(token:String,phone: String,code: String,openid: String): Flowable<ResultData<Any>> { |
| | | fun verifyCellPhone(token:String,phone: String,code: String,openid: String): Flowable<ResultData<LoginBean>> { |
| | | return request().verifyCellPhone(" $token",Gson().toJson(ReqBindWxPhone(code,phone,openid))) |
| | | } |
| | | |
| | |
| | | return request().saveViewingHistory(time,id) |
| | | } |
| | | |
| | | fun saveUserHomeBackgroundMusic(id: String): Flowable<ResultData<Any>> { |
| | | return request().saveUserHomeBackgroundMusic(id) |
| | | } |
| | | |
| | | fun getHomeBackgroundMusicByUserId(): Flowable<ResultData<BGMBean>> { |
| | | return request().getHomeBackgroundMusicByUserId() |
| | | } |
| | | |
| | | /** |
| | | * 支付成功 |
| | | */ |
| | |
| | | }) |
| | | |
| | | 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() |
| | | if (list.isNotEmpty()){ //存bgm和bg |
| | | 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)) |
| | | } |
| | | toast("保存成功") |
| | | startActivity<MainActivity>() |
| | | }){_,_-> |
| | | tv_action.isEnabled = true |
| | | } |
| | | } |
| | | if (fromPrivacy) |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_GUIDE_AUDIO)) |
| | | } |
| | |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.guide.GuideActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.umeng.commonsdk.UMConfigure |
| | | import kotlinx.android.synthetic.main.activity_splash.* |
| | | import org.jetbrains.anko.startActivity |
| | | import java.io.ByteArrayInputStream |
| | |
| | | // Log.e("mmp","解析参数:音频id=${code}") |
| | | // } |
| | | } |
| | | AMapLocationClient.updatePrivacyShow(this,true,true) |
| | | AMapLocationClient.updatePrivacyAgree(this,true) |
| | | AMapUtilCoreApi.setCollectInfoEnable(false) |
| | | if (SPUtils.instance().getBoolean(Const.User.IS_AGREE)){ |
| | | AMapLocationClient.updatePrivacyShow(this,true,true) |
| | | AMapLocationClient.updatePrivacyAgree(this,true) |
| | | startNext() |
| | | }else{ |
| | | getAgreement() |
| | |
| | | userRuleDialog.arguments = bundleOf("privacy" to privacy, "user" to user) |
| | | userRuleDialog.setDismissCallback(object : UserRuleDialog.OnDismiss { |
| | | override fun onDismiss() { |
| | | if (!SPUtils.instance().getBoolean(Const.User.IS_AGREE, false)) |
| | | if (!SPUtils.instance().getBoolean(Const.User.IS_AGREE, false)){ |
| | | finish() |
| | | else |
| | | AMapLocationClient.updatePrivacyShow(this@SplashActivity,true,true) |
| | | AMapLocationClient.updatePrivacyAgree(this@SplashActivity,true) |
| | | } else |
| | | startNext() |
| | | } |
| | | }) |
| | |
| | | * 判断是否第一次启动 |
| | | */ |
| | | private fun startNext(){ |
| | | UMConfigure.preInit(this, Const.UMENG_KEY, "") |
| | | (application as JkApplication).initSdk() |
| | | if (SPUtils.instance().getBoolean(Const.FIRST_LAUNCH,true)){ //第一次启动显示引导页 |
| | | SPUtils.instance().put(Const.FIRST_LAUNCH,false).apply() |
| | |
| | | package com.sinata.xqmuse.ui.discovery |
| | | |
| | | import android.Manifest |
| | | import android.util.Log |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import com.amap.api.location.AMapLocation |
| | | import com.amap.api.location.AMapLocationClient |
| | | import com.amap.api.location.AMapLocationClientOption |
| | | import com.amap.api.location.AMapLocationListener |
| | | import com.sinata.xqmuse.JkApplication |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.TipDialog |
| | |
| | | locationClient?.stopLocation() |
| | | locationClient?.startLocation() |
| | | } |
| | | |
| | | |
| | | |
| | | private fun getData(){ |
| | | HttpManager.getMeditationPage(page, search, JkApplication.lat, JkApplication.lon).requestByF( |
| | |
| | | getList() |
| | | getBottomMenu() |
| | | initClick() |
| | | changeBg() |
| | | } |
| | | |
| | | fun refreshData(){ |
| | |
| | | iv_pri_empty.setOnClickListener { startActivity<LoginActivity>() } |
| | | } |
| | | |
| | | fun changeBg(){ |
| | | val bg = SPUtils.instance().getString(Const.User.BG) |
| | | fun changeBg(bg:String){ |
| | | if (!bg.isNullOrEmpty()) |
| | | iv_home.setImageURI(bg) |
| | | } |
| | |
| | | } |
| | | HttpManager.verifyCellPhone(token?:"",phone,code,openid?:"").request(this@BindPhoneActivity){_,data-> |
| | | val result = Intent() |
| | | result.putExtra("token",token) |
| | | result.putExtra("token",data?.accessToken?:"") |
| | | setResult(RESULT_OK,result) |
| | | finish() |
| | | } |
| | |
| | | myToast("请输入正确的手机号") |
| | | else{ |
| | | tv_code.isEnabled = false |
| | | HttpManager.getCode(phone,2 ).request(this@BindPhoneActivity,success = { _, _-> |
| | | HttpManager.getCode(phone,4 ).request(this@BindPhoneActivity,success = { _, _-> |
| | | timer.start() |
| | | }){_,_-> |
| | | tv_code.isEnabled = true |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.UserInfo |
| | |
| | | class SettingActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_setting |
| | | private var data : MineInfo? = null |
| | | private var isPush = true //个性推荐 |
| | | |
| | | override fun initClick() { |
| | | iv_back.setOnClickListener { finish() } |
| | |
| | | startActivity<LoginActivity>() |
| | | } |
| | | |
| | | iv_push.setOnClickListener { |
| | | isPush = !isPush |
| | | iv_push.setImageResource(if (isPush) R.mipmap.sw_on else R.mipmap.sw_off) |
| | | SPUtils.instance().put(Const.IS_PUSH,isPush).apply() |
| | | } |
| | | |
| | | tv_rule.setOnClickListener { |
| | | startActivity<RulesActivity>() |
| | | } |
| | |
| | | HttpManager.getH5(LoginRuleDialog.TYPE_ABOUT).request(this){ _, data-> |
| | | data?.let { |
| | | startActivity<H5Activity>( |
| | | "title" to "关于心泉", |
| | | "title" to "关于泉", |
| | | "url" to it.content, |
| | | "showClose" to false |
| | | ) |
| | |
| | | titleBar.gone() |
| | | data = intent.getParcelableExtra("data") |
| | | tv_version.text = "当前版本:"+getAppVersion(this) |
| | | isPush = SPUtils.instance().getBoolean(Const.IS_PUSH,true) |
| | | iv_push.setImageResource(if (isPush) R.mipmap.sw_on else R.mipmap.sw_off) |
| | | } |
| | | |
| | | |
| | |
| | | const val APP_KEY = "BT7NPhA0f775uzcUuftWjCE1TYZlWmHZ" //接口秘钥 |
| | | |
| | | const val FIRST_LAUNCH = "isFirst" |
| | | const val IS_PUSH = "isPush" |
| | | |
| | | val OSS_DOMAIN = "https://xqgwzh.obs.cn-south-1.myhuaweicloud.com/" |
| | | |
| | |
| | | android:id="@+id/tv_rule" |
| | | app:layout_constraintTop_toBottomOf="@id/cl_level" |
| | | android:layout_marginTop="23dp" |
| | | android:text="心泉・疗愈 升级规则" |
| | | android:text="泉・疗愈 升级规则" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:textStyle="bold" |
| | |
| | | android:textSize="20sp" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/darkGreen" |
| | | tools:text="心泉疗愈馆"/> |
| | | tools:text="泉疗愈馆"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_form_text" |
| | | android:text="关于心泉" |
| | | android:text="关于泉" |
| | | android:paddingHorizontal="12dp" |
| | | android:drawableEnd="@mipmap/more_black"/> |
| | | <View |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color"/> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | <TextView |
| | | android:id="@+id/tv_push" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_form_text" |
| | | android:text="个性化推荐" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:paddingHorizontal="12dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_push" |
| | | android:text="关闭后,将不会给您提供个性化推荐服务,你可能会看到不感兴趣的内容" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66"/> |
| | | <ImageView |
| | | android:id="@+id/iv_push" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_push" |
| | | android:src="@mipmap/sw_on" |
| | | android:layout_marginEnd="6dp" |
| | | app:layout_constraintEnd_toEndOf="parent"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:layout_marginTop="12dp" |
| | | android:background="@color/dividing_line_color"/> |
| | | <TextView |
| | | android:id="@+id/tv_rule" |
| | | android:layout_width="match_parent" |
| | |
| | | android:id="@+id/tv_1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="邀好友赚分佣抽成" |
| | | android:text="" |
| | | android:textSize="35sp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="Invite friends to earn a commission" |
| | | android:text="" |
| | | android:textSize="9sp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | app:actualImageScaleType="centerCrop" |
| | | app:placeholderImage="@mipmap/splash" |
| | | app:placeholderImage="@color/white" |
| | | app:placeholderImageScaleType="centerCrop" /> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_marginEnd="11dp" |
| | | android:background="@drawable/bg_white_15dp" |
| | | android:layout_marginTop="40dp" |
| | | android:text="推荐心泉疗愈给好友\n" |
| | | android:text="推荐泉疗愈给好友\n" |
| | | android:paddingHorizontal="10dp" |
| | | android:gravity="center_vertical" |
| | | android:textColor="@color/textColor" |
| | |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="17sp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_msg" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_cancel" |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_marginEnd="15dp" |
| | | android:background="@drawable/bg_green_line_30dp" |
| | | app:layout_constraintTop_toTopOf="@id/tv_ok" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_ok" |
| | | android:layout_width="0dp" |
| | |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="25dp" |
| | | android:text="心 泉 疗 愈" |
| | | android:text="泉 疗 愈" |
| | | android:textSize="20sp" |
| | | android:textColor="@color/black" |
| | | android:fontFamily="@font/sourcehansanscn_regular" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:text="XIN QUAN" |
| | | android:textSize="8sp" |
| | | android:visibility="gone" |
| | | android:textColor="@color/textColor" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | |
| | | app:layout_constraintEnd_toEndOf="@id/iv_bg" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBottom_toBottomOf="@id/iv_bg" |
| | | android:background="@drawable/bg_white_alpha50_bottom_10"> |
| | | android:background="@drawable/bg_black_alpha50_bottom_10"> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:textSize="13sp" |
| | | android:ellipsize="end" |
| | | android:textColor="@color/darkGreen" |
| | | android:text="心泉疗愈馆"/> |
| | | android:text="泉疗愈馆"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:id="@+id/share_1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="邀好友赚分佣抽成" |
| | | android:text="" |
| | | android:textSize="35sp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="Invite friends to earn a commission" |
| | | android:text="" |
| | | android:textSize="9sp" |
| | | app:layout_constraintTop_toBottomOf="@id/share_1" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | |
| | | <uses-permission android:name="android.permission.INTERNET" /> |
| | | <uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
| | | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
| | | <uses-permission android:name="android.permission.CALL_PHONE" /> |
| | | |
| | | <application> |
| | | <activity |