298个文件已删除
109个文件已添加
168个文件已修改
| | |
| | | applicationVariants.all { variant -> |
| | | // 更新至Android Studio 3.3 gradle 4.10.1 |
| | | variant.outputs.all { |
| | | outputFileName = "jk-${defaultConfig.versionName}-${new Date().format("yyyy-MM-dd" , TimeZone.getTimeZone("GMT+08")) }.apk" |
| | | outputFileName = "xqmuse-${defaultConfig.versionName}-${new Date().format("yyyy-MM-dd" , TimeZone.getTimeZone("GMT+08")) }.apk" |
| | | } |
| | | } |
| | | // ndk { |
| | |
| | | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' |
| | | implementation project(path: ':xldutils-kotlin') |
| | | implementation 'com.google.android.material:material:1.2.1' |
| | | implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' |
| | | implementation 'com.youth.banner:banner:2.0.11' |
| | | // implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' |
| | | implementation 'com.youth.banner:banner:2.1.0' |
| | | implementation project(path: ':umeng_sdk') |
| | | implementation project(path: ':zxinglibrary') |
| | | // implementation project(path: ':zxinglibrary') |
| | | implementation 'top.zibin:Luban:1.1.8'//图片压缩 |
| | | |
| | | //播放器 |
| | | implementation 'xyz.doikki.android.dkplayer:dkplayer-java:3.3.7'// # 必选,内部默认使用系统mediaplayer进行解码 |
| | | implementation 'xyz.doikki.android.dkplayer:dkplayer-ui:3.3.7' //# 可选,包含StandardVideoController的实现 |
| | | implementation 'xyz.doikki.android.dkplayer:videocache:3.3.7' //# 可选,如需要缓存或者抖音预加载功能请引入此库 |
| | | // implementation 'xyz.doikki.android.dkplayer:player-exo:3.3.7' //# 可选,使用exoplayer进行解码 |
| | | implementation 'xyz.doikki.android.dkplayer:player-ijk:3.3.7' |
| | | |
| | | implementation 'com.haibin:calendarview:3.6.9'//日历 |
| | | implementation 'cn.bingoogolapple:bga-qrcode-zxing:1.3.7'//二维码 |
| | | // implementation 'com.haibin:calendarview:3.6.9'//日历 |
| | | // implementation 'cn.bingoogolapple:bga-qrcode-zxing:1.3.7'//二维码 |
| | | implementation 'com.github.bumptech.glide:glide:4.11.0'//必须集成 |
| | | annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0' |
| | | // implementation 'com.aliyun.dpa:oss-android-sdk:2.9.2' |
| | |
| | | implementation 'com.scwang.smart:refresh-header-classics:2.0.3' //经典刷新头 |
| | | implementation 'com.scwang.smart:refresh-header-material:2.0.3' //谷歌刷新头 |
| | | implementation 'io.github.lucksiege:pictureselector:v2.7.0-rc02' |
| | | implementation 'com.github.penfeizhou.android.animation:apng:2.26.0' //动画 |
| | | implementation 'com.amap.api:location:latest.integration' //定位 |
| | | |
| | | |
| | | //播放器 |
| | | implementation 'xyz.doikki.android.dkplayer:dkplayer-java:3.3.7'// # 必选,内部默认使用系统mediaplayer进行解码 |
| | | implementation 'xyz.doikki.android.dkplayer:dkplayer-ui:3.3.7' //# 可选,包含StandardVideoController的实现 |
| | | implementation 'xyz.doikki.android.dkplayer:videocache:3.3.7' //# 可选,如需要缓存或者抖音预加载功能请引入此库 |
| | | // implementation 'xyz.doikki.android.dkplayer:player-ijk:3.3.7' |
| | | // implementation 'xyz.doikki.android.dkplayer:player-exo:3.3.7' //# 可选,使用exoplayer进行解码 |
| | | //exo |
| | | api "com.google.android.exoplayer:exoplayer-core:2.19.1" |
| | | api "com.google.android.exoplayer:exoplayer-dash:2.19.1" |
| | | api "com.google.android.exoplayer:exoplayer-hls:2.19.1" |
| | | api "com.google.android.exoplayer:exoplayer-rtsp:2.19.1" |
| | | api "com.google.android.exoplayer:extension-rtmp:2.19.1" |
| | | } |
| | |
| | | <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> |
| | | <uses-permission android:name="android.permission.CAMERA" /> |
| | | |
| | | |
| | | <queries> |
| | | <package android:name="com.eg.android.AlipayGphone" /> |
| | | <package android:name="com.tencent.mm" /> |
| | | <package android:name="com.tencent.map" /> |
| | | <package android:name="com.baidu.BaiduMap" /> |
| | | <package android:name="com.autonavi.minimap" /> |
| | | </queries> |
| | | |
| | | <application |
| | | android:name=".JkApplication" |
| | | android:allowBackup="true" |
| | | android:icon="@mipmap/tab_tree" |
| | | android:icon="@mipmap/ic_launcher" |
| | | android:label="@string/app_name" |
| | | android:largeHeap="true" |
| | | android:networkSecurityConfig="@xml/network_security_config" |
| | |
| | | android:theme="@style/AppTheme"> |
| | | <activity |
| | | android:name=".MainActivity" |
| | | android:launchMode="singleTask" /> |
| | | android:launchMode="singleTask" android:configChanges="orientation|screenSize|keyboardHidden" /> |
| | | <activity android:name=".ui.SplashActivity"> |
| | | <intent-filter> |
| | | <action android:name="android.intent.action.MAIN" /> |
| | |
| | | android:name=".wxapi.WXPayEntryActivity" |
| | | android:exported="true" /> |
| | | <activity |
| | | android:name=".ui.H5Activity" |
| | | android:launchMode="singleTask" /> |
| | | android:name=".ui.H5Activity"/> |
| | | <activity |
| | | android:name=".ui.login.LoginActivity" |
| | | android:label="登录" |
| | |
| | | |
| | | <activity android:name=".ui.guide.GuideActivity" /> |
| | | |
| | | <activity android:name=".ui.home.PayResultActivity" android:label="支付结果"/> |
| | | <activity |
| | | android:name=".ui.course.JoinCourseActivity" |
| | | android:label="课程详情" /> |
| | | |
| | | <activity |
| | | android:name=".ui.home.VideoDetailActivity" |
| | | android:configChanges="orientation|screenSize|keyboardHidden" |
| | | android:screenOrientation="portrait" |
| | | android:label="课程详情" |
| | | android:launchMode="singleTask"/> |
| | | |
| | | <activity |
| | | android:name=".ui.discovery.NoticeDetailActivity" |
| | | android:label="公告详情" /> |
| | | <activity |
| | | android:name=".ui.course.MyCourseActivity" |
| | | android:label="我的课程" /> |
| | | <activity |
| | | android:name=".ui.course.ReportActivity" |
| | | android:label="测试报告" /> |
| | | <activity |
| | | android:name=".ui.mine.UserInfoActivity" |
| | | android:label="个人资料" /> |
| | | <activity |
| | | android:name=".ui.mine.CouponActivity" |
| | | android:label="我的券包" /> |
| | | android:label="个人资料" |
| | | android:windowSoftInputMode="adjustPan"/> |
| | | |
| | | <activity |
| | | android:name=".ui.home.ScannerActivity" |
| | | android:label="扫一扫" /> |
| | | |
| | | <activity android:name=".ui.course.ReceiveGiftActivity" android:label="填写地址"/> |
| | | <activity android:name=".ui.discovery.VideoPlayerActivity" |
| | | android:configChanges="orientation|screenSize|keyboardHidden" |
| | | android:screenOrientation="portrait"/> |
| | | <activity android:name=".ui.discovery.DynamicActivity" android:label="动态详情"/> |
| | | <activity android:name=".ui.discovery.ReplyActivity" android:label="动态详情"/> |
| | | <activity android:name=".ui.discovery.PublishActivity" android:label="发布动态"/> |
| | | <activity android:name=".ui.mine.MsgActivity" android:label="消息通知"/> |
| | | <activity android:name=".ui.mine.FeedbackActivity" android:label="反馈"/> |
| | | <activity android:name=".ui.mine.UseGuideActivity" android:label="使用指南"/> |
| | | <activity android:name=".ui.mine.SettingActivity" android:label="设置"/> |
| | | <activity android:name=".ui.mine.ChangePhoneActivity" android:label="更换绑定手机"/> |
| | | <activity android:name=".ui.mine.ChangePwdActivity" android:label="修改密码"/> |
| | | <activity android:name=".ui.mine.MyDynamicActivity" android:label="我的动态"/> |
| | | <activity android:name=".ui.mine.WalletActivity" /> |
| | | <activity android:name=".ui.mine.WithdrawRecordActivity" android:label="个人钱包"/> |
| | | <activity android:name=".ui.mine.LevelActivity" android:label="成就等级"/> |
| | | <activity android:name=".ui.mine.BindCardActivity" android:label="添加银行卡"/> |
| | | <activity android:name=".ui.mine.ShareActivity" /> |
| | | <activity android:name=".ui.course.CourseFinishActivity" android:label="课程详情"/> |
| | | <activity android:name=".ui.course.PreLoadActivity" android:label="课程详情" android:launchMode="singleTask"/> |
| | | <activity android:name=".ui.login.ForgetActivity" android:label="找回密码"/> |
| | | <activity android:name=".ui.login.InputCodeActivity" android:label="找回密码"/> |
| | | <activity android:name=".ui.login.SetPwdActivity" android:label="找回密码"/> |
| | |
| | | <activity android:name=".ui.mine.ChangePhoneSucActivity" android:label="更换绑定手机"/> |
| | | <activity android:name=".ui.mine.UnregisterActivity" android:label="注销账号" /> |
| | | <activity android:name=".ui.mine.RulesActivity" android:label="协议政策"/> |
| | | <activity android:name=".ui.tree.PowerActivity" android:label="能量值明细"/> |
| | | <activity android:name=".ui.tree.GiftActivity" android:label="能量兑换"/> |
| | | <activity android:name=".ui.tree.ExchangeRecordActivity" android:label="兑换记录"/> |
| | | <activity android:name=".ui.course.PaySuccessActivity" android:label="支付结果"/> |
| | | <activity android:name=".ui.course.HelpCenterActivity" /> |
| | | <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="确认订单"/> |
| | | |
| | | <service android:name="com.amap.api.location.APSService"/> |
| | | |
| | | <meta-data |
| | | android:name="com.amap.api.v2.apikey" |
| | | android:value="bd5f6ea87e4fcfa83804672c547c6b28"/> |
| | | </application> |
| | | |
| | | </manifest> |
| | |
| | | import android.app.Application |
| | | import android.os.Bundle |
| | | import cn.sinata.xldutils.application.BaseApplication |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import com.danikula.videocache.Logger |
| | | import com.sinata.xqmuse.network.Apis |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.exo.ExoMediaPlayerFactory |
| | | import com.umeng.commonsdk.UMConfigure |
| | | import com.umeng.socialize.PlatformConfig |
| | | import io.reactivex.Flowable |
| | | import io.reactivex.disposables.Disposable |
| | | import org.json.JSONObject |
| | | import org.greenrobot.eventbus.EventBus |
| | | import xyz.doikki.videoplayer.BuildConfig |
| | | import xyz.doikki.videoplayer.ijk.IjkPlayerFactory |
| | | import xyz.doikki.videoplayer.player.VideoViewConfig |
| | | import xyz.doikki.videoplayer.player.VideoViewManager |
| | | import java.util.concurrent.TimeUnit |
| | | |
| | | |
| | | class JkApplication :BaseApplication(), Application.ActivityLifecycleCallbacks { |
| | | override fun getSPName() = "JKSp" |
| | | private var heartSubscribe: Disposable? = null |
| | | |
| | | private val activities = ArrayList<Activity>() |
| | | private val activities = ArrayList<Activity>() |
| | | private var showNum = 0 //前台activity数量 |
| | | |
| | | override fun onCreate() { |
| | | super.onCreate() |
| | | registerActivityLifecycleCallbacks(this) |
| | |
| | | // .setPlayOnMobileNetwork(false) |
| | | // 进度管理器,继承ProgressManager,实现自己的管理逻辑 |
| | | // .setProgressManager(new ProgressManagerImpl()) |
| | | .setPlayerFactory(IjkPlayerFactory.create()) |
| | | // .setPlayerFactory(ExoMediaPlayerFactory.create()) |
| | | // .setPlayerFactory(AndroidMediaPlayerFactory.create()) |
| | | // .setPlayerFactory(IjkPlayerFactory.create()) |
| | | .setPlayerFactory(ExoMediaPlayerFactory.create()) |
| | | .build() |
| | | ) |
| | | |
| | |
| | | companion object{ //全局配置 |
| | | var lat:Double? = null |
| | | var lon:Double? = null |
| | | |
| | | var isForeground = true |
| | | var appContext: JkApplication? = null |
| | | fun getInstance(): JkApplication? { |
| | | if (appContext == null) { |
| | |
| | | } |
| | | |
| | | override fun onActivityStarted(p0: Activity) { |
| | | showNum++ |
| | | if (showNum == 1) { |
| | | isForeground = true |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.APP_FOREGROUND)) |
| | | } |
| | | } |
| | | |
| | | override fun onActivityDestroyed(p0: Activity) { |
| | |
| | | } |
| | | |
| | | override fun onActivityStopped(p0: Activity) { |
| | | showNum-- |
| | | if (showNum == 0) { |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.APP_BACKGROUND)) |
| | | isForeground = false |
| | | } |
| | | } |
| | | |
| | | override fun onActivityCreated(p0: Activity, p1: Bundle?) { |
| | |
| | | package com.sinata.xqmuse |
| | | |
| | | import android.content.Intent |
| | | import android.os.Handler |
| | | import android.os.Looper |
| | | import android.os.Message |
| | | import android.util.Log |
| | | import androidx.fragment.app.Fragment |
| | | import androidx.fragment.app.FragmentPagerAdapter |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import cn.sinata.xldutils.visible |
| | | import com.flyco.tablayout.listener.CustomTabEntity |
| | | import com.flyco.tablayout.listener.OnTabSelectListener |
| | | import com.github.zackratos.ultimatebar.UltimateBar |
| | | import com.google.gson.Gson |
| | | import com.sinata.xqmuse.dialog.TipDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.UserInfo |
| | | import com.sinata.xqmuse.network.entity.VoiceDetail |
| | | import com.sinata.xqmuse.network.entity.req.ReqAnswer |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.course.CourseFragment |
| | | import com.sinata.xqmuse.ui.discovery.DiscoveryFragment |
| | | import com.sinata.xqmuse.ui.guide.GuideActivity |
| | | import com.sinata.xqmuse.ui.home.HomeFragment |
| | | import com.sinata.xqmuse.ui.login.LoginActivity |
| | | import com.sinata.xqmuse.ui.mine.MineFragment |
| | | import com.sinata.xqmuse.ui.mine.ShareActivity |
| | | import com.sinata.xqmuse.ui.tree.TreeFragment |
| | | import com.sinata.xqmuse.utils.AudioUtils |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.activity_main.* |
| | | import kotlinx.android.synthetic.main.fragment_home.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.greenrobot.eventbus.Subscribe |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | import xyz.doikki.videoplayer.player.VideoView |
| | | |
| | | class MainActivity : TransparentStatusBarActivity(), OnTabSelectListener{ |
| | | class MainActivity : TransparentStatusBarActivity(), OnTabSelectListener,AudioUtils.OnAudioStatusUpdateListener { |
| | | override fun setContentView() = R.layout.activity_main |
| | | |
| | | private val fragments = arrayListOf<Fragment>() |
| | | |
| | | var teacherVideoView:VideoView? = null |
| | | private var bgPlayer:AudioUtils? = null//背景音乐播放器 |
| | | private var thinkBgPlayer:AudioUtils? = null//冥想背景音播放器 |
| | | private var thinkPlayer:AudioUtils? = null//冥想背景音播放器 |
| | | |
| | | private var guideAudio:String? = null |
| | | private var guidePlayer:AudioUtils? = null//引导音频播放器 |
| | | |
| | | private var thinkHandler:Handler? = null //冥想时间相关 |
| | | private var inGuide = false //true 引导中... |
| | | |
| | | private val isFirst by lazy { intent.getBooleanExtra("isFirst",false) } //首次安装,需要到导师引导页 |
| | | |
| | | private val MSG_PROGRESS = 0//疗愈进度+1 |
| | | private val MSG_TODAY = 1//今日疗愈更新计时 |
| | | private val MSG_COUNTDOWN = 2//疗愈倒计时 |
| | | |
| | | private var lastTodayTime = 0L //上一次今日疗愈获取的时间 |
| | | |
| | | private var startTime = 0L //开始疗愈的时间戳 |
| | | |
| | | override fun initClick() { |
| | | player_close.setOnClickListener { |
| | | TipDialog.show(supportFragmentManager,"是否关闭当前音频?",object :TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_THINK)) |
| | | } |
| | | |
| | | override fun onCancel() { |
| | | } |
| | | },"确认","取消") |
| | | } |
| | | |
| | | cl_player.setOnClickListener { |
| | | voice?.goDetail(this) |
| | | } |
| | | |
| | | player_play.setOnClickListener { |
| | | playing = !playing |
| | | if (playing){ |
| | | player_play.setImageResource(R.mipmap.player_pause) |
| | | thinkBgPlayer?.resume() |
| | | thinkPlayer?.resume() |
| | | thinkHandler?.sendEmptyMessage(MSG_PROGRESS) |
| | | startTime = System.currentTimeMillis() |
| | | }else{ |
| | | player_play.setImageResource(R.mipmap.player_start) |
| | | thinkBgPlayer?.pause() |
| | | thinkPlayer?.pause() |
| | | thinkHandler?.removeMessages(MSG_PROGRESS) |
| | | saveThinkRecord() |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | EventBus.getDefault().register(this) |
| | | titleBar.gone() |
| | | useWhiteTitle() |
| | | startBgm() |
| | | initTab() |
| | | if (!intent.getStringExtra("code").isNullOrEmpty()){ |
| | | startActivity<ShareActivity>("code" to intent.getStringExtra("code")) |
| | | } |
| | | if (isFirst) //解决首次启动eventbus注册慢的问题 |
| | | startActivity<GuideActivity>() |
| | | |
| | | thinkHandler = object :Handler(Looper.myLooper()!!){ |
| | | override fun handleMessage(msg: Message) { |
| | | super.handleMessage(msg) |
| | | when(msg.what){ |
| | | MSG_PROGRESS->{ |
| | | currentPosition = thinkBgPlayer?.currentPosition ?:0 |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.GOT_THINK_POSITION)) |
| | | sendEmptyMessageDelayed(MSG_PROGRESS,1000) |
| | | } |
| | | MSG_COUNTDOWN->{ |
| | | if (System.currentTimeMillis()>= finishTime) |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_THINK)) |
| | | else |
| | | sendEmptyMessageDelayed(MSG_COUNTDOWN,1000) |
| | | } |
| | | MSG_TODAY->{ |
| | | if (System.currentTimeMillis() - lastTodayTime > 60000) { //距离上次刷新过去了1分钟 |
| | | Log.e(Const.Tag,"已经过1分钟,需要重新获取今日疗愈数据") |
| | | lastTodayTime = System.currentTimeMillis() |
| | | (fragments[0] as HomeFragment).getToday() |
| | | } |
| | | sendEmptyMessageDelayed(MSG_TODAY,5000) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | lastTodayTime = System.currentTimeMillis() |
| | | startTodayCheck() |
| | | } |
| | | |
| | | private fun startGuide() { |
| | | if (guidePlayer == null) |
| | | guidePlayer = AudioUtils() |
| | | if (guideAudio.isNullOrEmpty()) |
| | | HttpManager.getPlan().request(this){_,data-> |
| | | guideAudio = data |
| | | if (inGuide){ |
| | | guidePlayer?.setVolume(0.6f) |
| | | guidePlayer?.loopPlayMusic(this,data) |
| | | } |
| | | } |
| | | else{ |
| | | guidePlayer?.setVolume(0.6f) |
| | | guidePlayer?.loopPlayMusic(this,guideAudio) |
| | | } |
| | | } |
| | | |
| | | private fun startBgm() { |
| | | val bgm = SPUtils.instance().getString(Const.User.BGM) |
| | | if (!bgm.isNullOrEmpty()){ |
| | | if (bgPlayer == null) |
| | | bgPlayer = AudioUtils() |
| | | val volume = SPUtils.instance().getInt(Const.User.VOLUME,50) |
| | | bgPlayer?.setVolume(volume.toFloat()/100) |
| | | bgPlayer?.loopPlayMusic(this,bgm) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 开始冥想 |
| | | */ |
| | | private fun startThink() { |
| | | bgPlayer?.pause() |
| | | index = 0 |
| | | if (voice?.meditationMusicList?.isNullOrEmpty() == false){ |
| | | if (thinkBgPlayer == null){ |
| | | thinkBgPlayer = AudioUtils() |
| | | thinkPlayer = AudioUtils() |
| | | thinkBgPlayer!!.setOnAudioStatusUpdateListener(this) |
| | | thinkPlayer!!.setOnAudioStatusUpdateListener(object :AudioUtils.OnAudioStatusUpdateListener{ |
| | | override fun onUpdate(db: Double, time: Long) { |
| | | } |
| | | |
| | | override fun onStop(filePath: String?) { |
| | | } |
| | | |
| | | override fun onStartPlay() { |
| | | } |
| | | |
| | | override fun onFinishPlay() { |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_THINK)) |
| | | } |
| | | |
| | | override fun onGetDuration(duration: Int) { |
| | | } |
| | | }) |
| | | } |
| | | val volume = SPUtils.instance().getInt(Const.User.VOLUME_THINK,50) |
| | | thinkPlayer?.setVolume(volume.toFloat()/100) |
| | | thinkBgPlayer?.startPlayMusic(this, voice?.meditationMusicList?.get(index)) |
| | | thinkPlayer?.startPlayMusic(this, voice?.tutorAudioUrl) |
| | | currentDuration = voice?.meditationSecondList?.get(index)?:0 |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.GOT_THINK_DURATION)) |
| | | playing = true |
| | | cl_player.visible() |
| | | tv_player.text = voice?.meditationTitle |
| | | iv_player.setImageURI(voice?.coverUrl?.split(",")?.firstOrNull()) |
| | | player_play.setImageResource(R.mipmap.player_pause) |
| | | thinkHandler?.sendEmptyMessage(MSG_PROGRESS) |
| | | startTime = System.currentTimeMillis() //记录开始冥想的时间 |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 停止冥想 |
| | | */ |
| | | private fun finishThink(){ |
| | | saveThinkRecord() |
| | | voice = null |
| | | index = 0 |
| | | finishTime = 0L |
| | | thinkBgPlayer?.stopPlayMusic() |
| | | thinkPlayer?.stopPlayMusic() |
| | | playing = false |
| | | thinkHandler?.removeMessages(0) |
| | | cl_player.gone() |
| | | if (JkApplication.isForeground) |
| | | bgPlayer?.resume() |
| | | } |
| | | |
| | | /** |
| | | * 保存冥想记录 |
| | | */ |
| | | private fun saveThinkRecord() { |
| | | if (voice == null||startTime == 0L) |
| | | return |
| | | val time = ((System.currentTimeMillis() - startTime) / 1000).toInt() |
| | | startTime = 0L |
| | | HttpManager.saveViewingHistory(voice?.id?:"", time).request(this,false,{ _, _-> |
| | | Log.e(Const.Tag,"冥想记录成功:$time 秒") |
| | | }){_,_-> |
| | | Log.e(Const.Tag,"冥想记录失败:$time 秒") |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | private fun initTab() { |
| | | val titles = arrayListOf("首页","课程","","疗愈馆","我的") |
| | | val titles = arrayListOf("疗愈","课程","","疗愈馆","我的") |
| | | val iconChecked = arrayListOf( |
| | | R.mipmap.home_selected, |
| | | R.mipmap.play_selected, |
| | |
| | | } |
| | | |
| | | override fun onTabSelect(position: Int) { |
| | | if (position !=0 &&position !=3 && SPUtils.instance().getString(Const.User.TOKEN).isNullOrEmpty()){ |
| | | toast("请先登录") |
| | | startActivity<LoginActivity>() |
| | | tab_bar.currentTab = 0 |
| | | return |
| | | } |
| | | view_pager.currentItem = position |
| | | UltimateBar.with(this@MainActivity) |
| | | .statusDark(position != 0&&position!=1) |
| | | .create().immersionBar() //沉浸状态栏 |
| | | if (position == 2){ |
| | | (fragments[2] as TreeFragment).getTree() |
| | | } |
| | | if (position == 4){ |
| | | (fragments[4] as MineFragment).queryUnread() |
| | | } |
| | | if (position != 1) |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.PAUSE_TEACHER_VIDEO)) |
| | | if (position == 0) |
| | | startTodayCheck() |
| | | else |
| | | stopTodayCheck() |
| | | } |
| | | |
| | | override fun onTabReselect(position: Int) { |
| | | } |
| | | |
| | | @Subscribe |
| | | fun onSwitch(e:EmptyEvent){ |
| | | if (e.code == Const.EventCode.SWITCH_HOME){ |
| | | fun onEvent(e:EmptyEvent){ |
| | | if (e.code == Const.EventCode.CHANGE_USER){ |
| | | tab_bar.currentTab = 0 |
| | | onTabSelect(0) |
| | | }else if(e.code == Const.EventCode.CHANGE_STARTCLASS){ |
| | | (fragments[0] as HomeFragment).refreshData() |
| | | checkAnswer() |
| | | }else if (e.code == Const.EventCode.SWITCH_HOME){ |
| | | tab_bar.currentTab = 0 |
| | | onTabSelect(0) |
| | | }else if (e.code == Const.EventCode.SWITCH_COURSE){ |
| | | tab_bar.currentTab = 1 |
| | | onTabSelect(1) |
| | | }else if(e.code == Const.EventCode.SWITCH_DISCOVERY){ |
| | |
| | | }else if(e.code == Const.EventCode.CHANGE_EXPLORE){ |
| | | tab_bar.currentTab = 3 |
| | | onTabSelect(3) |
| | | }else if(e.code == Const.EventCode.APP_FOREGROUND){ |
| | | bgPlayer?.resume() |
| | | }else if(e.code == Const.EventCode.APP_BACKGROUND){ |
| | | bgPlayer?.pause() |
| | | }else if(e.code == Const.EventCode.CHANGE_BGM){ |
| | | startBgm() |
| | | (fragments[0] as HomeFragment).changeBg() |
| | | }else if(e.code == Const.EventCode.START_THINK){ |
| | | startThink() |
| | | }else if(e.code == Const.EventCode.FINISH_THINK){ |
| | | finishThink() |
| | | }else if(e.code == Const.EventCode.PAUSE_OR_RESUME_THINK){ |
| | | player_play.callOnClick() |
| | | }else if(e.code == Const.EventCode.CHANGE_THINK_VOLUME){ |
| | | val v = SPUtils.instance().getInt(Const.User.VOLUME_THINK,50) |
| | | thinkPlayer?.setVolume(v.toFloat()/100) |
| | | }else if(e.code == Const.EventCode.START_GUIDE_AUDIO){ |
| | | inGuide = true |
| | | startGuide() |
| | | bgPlayer?.pause() |
| | | thinkBgPlayer?.pause() |
| | | thinkPlayer?.pause() |
| | | }else if(e.code == Const.EventCode.FINISH_GUIDE_AUDIO){ |
| | | inGuide = false |
| | | guidePlayer?.stopPlayMusic() |
| | | bgPlayer?.resume() |
| | | if (voice!=null&& playing){ |
| | | thinkBgPlayer?.resume() |
| | | thinkPlayer?.resume() |
| | | } |
| | | }else if(e.code == Const.EventCode.REFRESH_PRIVATE){ //重新答题后,刷新私人定制 |
| | | (fragments[0] as HomeFragment).getPrivacy() |
| | | }else if(e.code == Const.EventCode.THINK_TIMER){ //开启倒计时 |
| | | thinkHandler?.sendEmptyMessage(1) |
| | | } |
| | | } |
| | | |
| | | private fun checkAnswer() { |
| | | val answer = SPUtils.instance().getString(Const.User.ANSWER) |
| | | if (!answer.isNullOrEmpty()){ //已登录并且有答案 |
| | | HttpManager.saveUserAnswers(Gson().fromJson(answer, ReqAnswer::class.java)).request(this,false,success = { _, _-> |
| | | SPUtils.instance().put(Const.User.ANSWER,"").apply() |
| | | Log.e(Const.Tag,"私人定制已保存") |
| | | (fragments[0] as HomeFragment).getPrivacy() |
| | | }){_,_-> |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private fun startTodayCheck(){ |
| | | thinkHandler?.sendEmptyMessage(MSG_TODAY) |
| | | } |
| | | |
| | | private fun stopTodayCheck(){ |
| | | thinkHandler?.removeMessages(MSG_TODAY) |
| | | } |
| | | |
| | | override fun onResume() { |
| | | super.onResume() |
| | | if (view_pager.currentItem == 4){ |
| | | (fragments[4] as MineFragment).queryUnread() |
| | | } else if (view_pager.currentItem == 0){ |
| | | startTodayCheck() |
| | | } else if (view_pager.currentItem == 2){ |
| | | (fragments[2] as TreeFragment).getTree() |
| | | } |
| | | } |
| | | |
| | | override fun onPause() { |
| | | super.onPause() |
| | | stopTodayCheck() |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | | super.onDestroy() |
| | | bgPlayer?.stopPlayMusic() |
| | | EventBus.getDefault().unregister(this) |
| | | } |
| | | |
| | | override fun onUpdate(db: Double, time: Long) { |
| | | } |
| | | |
| | | override fun onStop(filePath: String?) { |
| | | } |
| | | |
| | | override fun onStartPlay() { |
| | | } |
| | | |
| | | override fun onFinishPlay() { |
| | | if (voice == null) //说明是手动关闭的,不需要处理下一步播放逻辑 |
| | | return |
| | | if (isRecycle){ //单曲 |
| | | if (playing) |
| | | thinkBgPlayer?.startPlayMusic(this, voice?.meditationMusicList?.get(index)) |
| | | }else{//顺序 |
| | | index++ |
| | | if (index>=voice?.meditationMusicList?.size?:0)//列表已播完 |
| | | index = 0 |
| | | currentDuration = voice?.meditationSecondList?.get(index)?:0 |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.GOT_THINK_DURATION)) |
| | | if (playing) |
| | | thinkBgPlayer?.startPlayMusic(this, voice?.meditationMusicList?.get(index)) |
| | | } |
| | | } |
| | | |
| | | override fun onGetDuration(duration: Int) { |
| | | |
| | | } |
| | | |
| | | override fun onBackPressed() { |
| | | if (teacherVideoView?.onBackPressed() != true) |
| | | super.onBackPressed() |
| | | } |
| | | |
| | | companion object{ //冥想播放相关参数 |
| | | var playing = false //true播放中 |
| | | var isRecycle = false //true单曲循环播放 |
| | | var voice: VoiceDetail? = null //冥想详情 |
| | | var index = 0 //当前播放序号 |
| | | var currentDuration = 0 //当前音频长度(秒) |
| | | var currentPosition = 0 //当前音频进度(秒) |
| | | var finishTime = 0L //自动结束的时间戳 |
| | | } |
| | | } |
| | |
| | | abstract fun setContentView(): Int |
| | | abstract fun setGravity(): Int |
| | | abstract fun initView() |
| | | open fun heightMatch() = false |
| | | |
| | | var isFirstResume = true |
| | | var canceledOnTouchOutside = true |
| | |
| | | |
| | | override fun onActivityCreated(savedInstanceState: Bundle?) { |
| | | super.onActivityCreated(savedInstanceState) |
| | | dialog?.window?.setLayout(matchParent, wrapContent) |
| | | dialog?.window?.setLayout(matchParent, if (heightMatch()) matchParent else wrapContent) |
| | | dialog?.window?.setGravity(setGravity()) |
| | | dialog?.setCanceledOnTouchOutside(canceledOnTouchOutside) |
| | | isCancelable = mCancelable |
| | |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.BGMSettingActivity |
| | | import com.sinata.xqmuse.ui.guide.Guide2Activity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.dialog_tip_bg.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | import org.jetbrains.anko.wrapContent |
| | | |
| | |
| | | |
| | | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
| | | super.onViewCreated(view, savedInstanceState) |
| | | if (!title.isNullOrEmpty()){ |
| | | tv_title.text = title |
| | | } |
| | | val settings = sc_content.settings |
| | | settings.javaScriptEnabled = true |
| | | settings.javaScriptCanOpenWindowsAutomatically = true |
| | |
| | | private val years = arrayListOf<Int>() |
| | | private val months = arrayListOf<Int>() |
| | | |
| | | private val data by lazy { arguments?.getString("data") } |
| | | |
| | | override fun onCreateView( |
| | | inflater: LayoutInflater, |
| | | container: ViewGroup?, |
| | |
| | | wv_4.gone() |
| | | wv_5.gone() |
| | | |
| | | setYear() |
| | | setYear(true) |
| | | setMonth(true) |
| | | setDay(true) |
| | | |
| | |
| | | dismiss() |
| | | } |
| | | tv_action.setOnClickListener { |
| | | callback?.onOk("%s.%s.%s".format(wv_1.seletedItem,wv_2.seletedItem,wv_3.seletedItem)) |
| | | callback?.onOk("%s-%s-%s".format(wv_1.seletedItem,wv_2.seletedItem,wv_3.seletedItem)) |
| | | dismiss() |
| | | } |
| | | } |
| | | |
| | | private fun setYear() { |
| | | private fun setYear(isFirst:Boolean = false) { |
| | | val year = Calendar.getInstance().get(Calendar.YEAR) |
| | | years.addAll((1970..year)) |
| | | years.addAll((1960..year)) |
| | | wv_1.setItems(years.map { |
| | | it.toString() |
| | | }) |
| | | wv_1.setSeletion(years.lastIndex) |
| | | if (isFirst && !data.isNullOrEmpty()){ |
| | | wv_1.setSeletion(years.indexOf(data!!.split("-")[0].toInt())) |
| | | |
| | | }else |
| | | wv_1.setSeletion(years.lastIndex) |
| | | } |
| | | |
| | | private fun setMonth(isFirst:Boolean = false) { |
| | |
| | | String.format("%02d",it) |
| | | } |
| | | wv_2.setItems(list) |
| | | wv_2.setSeletion(if (isFirst) list.lastIndex else 0) |
| | | wv_2.setSeletion(if (isFirst){ |
| | | if (!data.isNullOrEmpty()) |
| | | months.indexOf(data!!.split("-")[1].toInt()) |
| | | else |
| | | list.lastIndex |
| | | } else 0) |
| | | } |
| | | |
| | | private fun setDay(isFirst:Boolean = false) { |
| | |
| | | String.format("%02d",it) |
| | | } |
| | | wv_3.setItems(list) |
| | | wv_3.setSeletion(if (isFirst) list.lastIndex else 0) |
| | | wv_3.setSeletion(if (isFirst){ |
| | | if (!data.isNullOrEmpty()) |
| | | list.indexOf(data!!.split("-")[2]) |
| | | else |
| | | list.lastIndex |
| | | } else 0) |
| | | } |
| | | |
| | | interface Callback { |
| | |
| | | import com.sinata.xqmuse.ui.discovery.adapter.CommentAdapter |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import kotlinx.android.synthetic.main.dialog_comment.* |
| | | import org.jetbrains.anko.support.v4.toast |
| | | |
| | | class CommentDialog:BaseDialogFragment() { |
| | | override fun setContentView() = R.layout.dialog_comment |
| | |
| | | private val voiceId by lazy { arguments?.getString("id")?:"" } |
| | | private var page = 1 |
| | | private val list = arrayListOf<Comment>() |
| | | private val adapter = CommentAdapter(list) |
| | | private val adapter by lazy { CommentAdapter(list,requireActivity() as BaseActivity) } |
| | | var callback:StringCallback? = null |
| | | |
| | | override fun initView() { |
| | |
| | | page++ |
| | | getData() |
| | | } |
| | | tv_action.setOnClickListener { |
| | | val content = et_content.text.toString() |
| | | if (content.isNullOrEmpty()) |
| | | toast("请输入内容") |
| | | else{ |
| | | tv_action.isEnabled = false |
| | | HttpManager.addQuestion(voiceId,content).request(requireActivity() as BaseActivity,success = {_,_-> |
| | | et_content.setText("") |
| | | tv_action.isEnabled = true |
| | | refreshLayout.autoRefresh() |
| | | }){_,_-> |
| | | tv_action.isEnabled = true |
| | | } |
| | | } |
| | | } |
| | | getData() |
| | | } |
| | | |
New file |
| | |
| | | package com.sinata.xqmuse.dialog |
| | | |
| | | import android.view.Gravity |
| | | 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_gift_success.* |
| | | |
| | | class GiftSuccessDialog:BaseDialogFragment() { |
| | | override fun setContentView() = R.layout.dialog_gift_success |
| | | |
| | | override fun setGravity() = Gravity.CENTER |
| | | |
| | | override fun initView() { |
| | | tv_code.text = "领取验证码:${arguments?.getString("code")}" |
| | | iv_code.setImageURI(arguments?.getString("qr")) |
| | | tv_action.setOnClickListener { dismissAllowingStateLoss() } |
| | | } |
| | | |
| | | companion object{ |
| | | fun show(fm:FragmentManager,code:String,qrcode:String) { |
| | | val fragment = GiftSuccessDialog() |
| | | fragment.arguments = bundleOf("code" to code,"qr" to qrcode) |
| | | fragment.showAllowingStateLoss(fm,"suc") |
| | | } |
| | | } |
| | | } |
| | |
| | | tv_title.text = when(type){ |
| | | TYPE_USER -> "用户协议" |
| | | TYPE_PRIVACY -> "隐私协议" |
| | | TYPE_COUPON_USAGE -> "可用门店" |
| | | TYPE_COUPON_CITY -> "可用城市" |
| | | else -> "运动安全告知书" |
| | | } |
| | |
| | | const val TYPE_USER = 1 |
| | | const val TYPE_PRIVACY = 2 |
| | | const val TYPE_ABOUT = 3 |
| | | const val TYPE_COUPON_USAGE = 4//优惠券可用门店 |
| | | const val TYPE_COUPON_CITY = 5//优惠券可用城市 |
| | | fun show(fm:FragmentManager,content:String,type:Int){ |
| | | val loginRuleDialog = LoginRuleDialog() |
New file |
| | |
| | | package com.sinata.xqmuse.dialog |
| | | |
| | | import android.view.Gravity |
| | | import android.view.View |
| | | import android.webkit.WebSettings |
| | | import androidx.core.os.bundleOf |
| | | import androidx.fragment.app.Fragment |
| | | import androidx.fragment.app.FragmentManager |
| | | import androidx.fragment.app.FragmentPagerAdapter |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import com.flyco.tablayout.listener.OnTabSelectListener |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.FakeFragment |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import kotlinx.android.synthetic.main.dialog_login_rule.* |
| | | |
| | | class LoginRulesDialog:BaseDialogFragment() { |
| | | override fun setContentView() = R.layout.dialog_login_rule |
| | | |
| | | private val index by lazy { arguments?.getInt("index") } |
| | | private val privacy by lazy { arguments?.getString("privacy")?:"" } |
| | | private val user by lazy { arguments?.getString("user")?:"" } |
| | | private var callback:StringCallback? = null |
| | | |
| | | override fun setGravity() = Gravity.CENTER |
| | | |
| | | |
| | | override fun initView() { |
| | | tv_cancel.setOnClickListener { |
| | | callback?.onResult("") |
| | | dismissAllowingStateLoss() |
| | | } |
| | | tv_ok.setOnClickListener { |
| | | callback?.onResult("1") |
| | | dismissAllowingStateLoss() |
| | | } |
| | | val frags = arrayListOf<Fragment>() |
| | | frags.add(FakeFragment()) |
| | | frags.add(FakeFragment()) |
| | | vp_fake.adapter = object :FragmentPagerAdapter(childFragmentManager,0){ |
| | | override fun getCount() = 2 |
| | | |
| | | override fun getItem(position: Int) = frags[position] |
| | | } |
| | | tab_top.setViewPager(vp_fake, arrayOf("用户协议","隐私协议")) |
| | | initWebView() |
| | | val value = object : OnTabSelectListener { |
| | | override fun onTabSelect(position: Int) { |
| | | load(position) |
| | | } |
| | | |
| | | override fun onTabReselect(position: Int) { |
| | | } |
| | | } |
| | | tab_top.setOnTabSelectListener(value) |
| | | tab_top.currentTab = index?:0 |
| | | load(index?:0) |
| | | } |
| | | |
| | | private fun initWebView() { |
| | | val settings = sc_content.settings |
| | | settings.defaultTextEncodingName = "utf-8" //设置编码格式 |
| | | settings.loadWithOverviewMode = true // 页面支持缩放: |
| | | settings.builtInZoomControls = true |
| | | settings.useWideViewPort = false //将图片调整到适合webview的大小 |
| | | settings.setSupportZoom(false) //支持缩放 |
| | | settings.supportMultipleWindows() //多窗口 |
| | | settings.cacheMode = WebSettings.LOAD_CACHE_ELSE_NETWORK //关闭webview中缓存 |
| | | settings.allowFileAccess = true //设置可以访问文件 |
| | | settings.setNeedInitialFocus(true) //当webview调用requestFocus时为webview设置节点 |
| | | settings.javaScriptCanOpenWindowsAutomatically = true //支持通过JS打开新窗口 |
| | | settings.loadsImagesAutomatically = true //支持自动加载图片 |
| | | settings.javaScriptEnabled = true |
| | | settings.domStorageEnabled = true |
| | | sc_content.isScrollContainer = false |
| | | sc_content.isScrollbarFadingEnabled = false |
| | | sc_content.scrollBarStyle = View.SCROLLBARS_OUTSIDE_OVERLAY |
| | | } |
| | | |
| | | private fun load(position:Int){ |
| | | val sHead = |
| | | "<html><head><meta name=\"viewport\" content=\"width=device-width, " + "initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes\" />" + "<style>img{max-width:100% !important;height:auto !important;}</style>" + "<style>body{max-width:100% !important;}</style>" + "</head><body>" |
| | | if (position == 0) { |
| | | sc_content.loadDataWithBaseURL(null, sHead + user, "text/html", "utf-8", null) |
| | | } else { |
| | | sc_content.loadDataWithBaseURL( |
| | | null, |
| | | sHead + privacy, |
| | | "text/html", |
| | | "utf-8", |
| | | null |
| | | ) |
| | | } |
| | | } |
| | | |
| | | companion object{ |
| | | fun show(fm:FragmentManager,privacy:String,user:String,index:Int,callback:StringCallback){ |
| | | val loginRuleDialog = LoginRulesDialog() |
| | | loginRuleDialog.arguments = bundleOf("privacy" to privacy,"index" to index,"user" to user) |
| | | loginRuleDialog.callback = callback |
| | | loginRuleDialog.showAllowingStateLoss(fm,"rule") |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.dialog |
| | | |
| | | import android.view.Gravity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import kotlinx.android.synthetic.main.dialog_map_type.* |
| | | |
| | | class MapTypeDialog:BaseDialogFragment() { |
| | | override fun setContentView() = R.layout.dialog_map_type |
| | | var callback: StringCallback? = null |
| | | |
| | | override fun setGravity() = Gravity.BOTTOM |
| | | |
| | | override fun initView() { |
| | | tv_gaode.setOnClickListener { |
| | | callback?.onResult("a") |
| | | dismissAllowingStateLoss() |
| | | } |
| | | tv_baidu.setOnClickListener { |
| | | callback?.onResult("b") |
| | | dismissAllowingStateLoss() |
| | | } |
| | | tv_tencent.setOnClickListener { |
| | | callback?.onResult("t") |
| | | dismissAllowingStateLoss() |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | super.onViewCreated(view, savedInstanceState) |
| | | tv_msg.text = msg |
| | | tv_title.text = title |
| | | if (title.contains("失败")){ |
| | | tv_title.setCompoundDrawablesWithIntrinsicBounds(0,R.mipmap.shibai,0,0) |
| | | } |
| | | countDownTimer.start() |
| | | } |
| | | |
| | |
| | | callback?.onResult(content) |
| | | dismissAllowingStateLoss() |
| | | } |
| | | iv_close.setOnClickListener { |
| | | tv_action.callOnClick() |
| | | } |
| | | } |
| | | |
| | | companion object{ |
| | |
| | | |
| | | override fun setGravity() = Gravity.BOTTOM |
| | | |
| | | override fun heightMatch() = true |
| | | |
| | | override fun initView() { |
| | | tv_action.setOnClickListener { |
| | | val content = find<RadioButton>(rg_time.checkedRadioButtonId).text.toString() |
| | | callback?.onResult(content) |
| | | dismissAllowingStateLoss() |
| | | } |
| | | |
| | | bg.setOnClickListener { dismissAllowingStateLoss() } |
| | | } |
| | | |
| | | |
| | | var callback:StringCallback? = null |
| | | |
| | | companion object{ |
| | | const val TYPE_REPORT = 1 |
| | | const val TYPE_COMMENT = 2 |
| | | const val TYPE_REPLY = 3 |
| | | fun show(fragmentManager: FragmentManager,callback: StringCallback){ |
| | | val riskDialog = ReportDialog() |
| | | riskDialog.callback = callback |
| | |
| | | override fun initView() { |
| | | tv_action.setOnClickListener { |
| | | callback?.onResult("ok") |
| | | dismissAllowingStateLoss() |
| | | } |
| | | tv_price.text = arguments?.getString("price") |
| | | } |
| | |
| | | package com.sinata.xqmuse.dialog |
| | | |
| | | import android.view.Gravity |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import kotlinx.android.synthetic.main.dialog_share.* |
| | |
| | | |
| | | override fun setGravity() = Gravity.BOTTOM |
| | | |
| | | private val isSave by lazy { arguments?.getBoolean("isSave",false)?:false } |
| | | |
| | | var callback:StringCallback? = null |
| | | |
| | | override fun initView() { |
| | | if (isSave) |
| | | tv_save.visible() |
| | | iv_close.setOnClickListener { dismissAllowingStateLoss() } |
| | | tv_cancel.setOnClickListener { dismissAllowingStateLoss() } |
| | | tv_wx.setOnClickListener { |
| | | callback?.onResult("wx") |
| | | dismissAllowingStateLoss() |
| | | } |
| | | tv_wx.setOnClickListener { |
| | | tv_circle.setOnClickListener { |
| | | callback?.onResult("circle") |
| | | dismissAllowingStateLoss() |
| | | } |
| | | tv_save.setOnClickListener { |
| | | callback?.onResult("save") |
| | | dismissAllowingStateLoss() |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | package com.sinata.xqmuse.dialog |
| | | |
| | | import android.text.Editable |
| | | import android.text.TextWatcher |
| | | import android.view.Gravity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | |
| | | override fun setContentView() = R.layout.dialog_time_setting |
| | | |
| | | override fun setGravity() = Gravity.BOTTOM |
| | | var time = 10 |
| | | var time = 5 |
| | | |
| | | var callback:StringCallback? = null |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | et_time.addTextChangedListener(object :TextWatcher{ |
| | | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { |
| | | |
| | | } |
| | | |
| | | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
| | | } |
| | | |
| | | override fun afterTextChanged(s: Editable?) { |
| | | rg_time.check(-1) |
| | | } |
| | | }) |
| | | |
| | | tv_jia.setOnClickListener { |
| | | rg_time.check(-1) |
| | | val s = et_time.text.toString() |
| | | time = (if (s.isNullOrEmpty()) 0 else s.toInt())+1 |
| | | et_time.setText(time.toString()) |
| | | } |
| | | |
| | | tv_jian.setOnClickListener { |
| | | rg_time.check(-1) |
| | | val s = et_time.text.toString() |
| | | time = (if (s.isNullOrEmpty()) 0 else s.toInt()) |
| | | time = max(0,time) |
New file |
| | |
| | | package com.sinata.xqmuse.dialog |
| | | |
| | | import android.view.Gravity |
| | | 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.* |
| | | |
| | | class TreeTipDialog:BaseDialogFragment() { |
| | | override fun setContentView() = R.layout.dialog_tip_tree |
| | | |
| | | override fun setGravity() = Gravity.CENTER |
| | | |
| | | private val title by lazy { arguments?.getString("title") } |
| | | private val msg by lazy { arguments?.getString("msg") } |
| | | |
| | | override fun initView() { |
| | | tv_ok.setOnClickListener { dismissAllowingStateLoss() } |
| | | if (!title.isNullOrEmpty()) |
| | | tv_title.text = title |
| | | if (!msg.isNullOrEmpty()) |
| | | tv_msg.text = msg |
| | | } |
| | | |
| | | companion object{ |
| | | fun show(fm:FragmentManager,title:String?=null,msg:String?=null){ |
| | | val treeTipDialog = TreeTipDialog() |
| | | treeTipDialog.arguments = bundleOf("title" to title,"msg" to msg) |
| | | treeTipDialog.showAllowingStateLoss(fm,"first") |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.sinata.xqmuse.dialog |
| | | |
| | | import android.util.Log |
| | | import android.view.Gravity |
| | | import android.widget.SeekBar |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.dialog_set_volume.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | |
| | | class VolumeDialog: BaseDialogFragment() { |
| | | override fun setContentView() = R.layout.dialog_set_volume |
| | |
| | | override fun setGravity() = Gravity.BOTTOM |
| | | |
| | | override fun initView() { |
| | | val int = SPUtils.instance().getInt(Const.User.VOLUME_THINK, 50) |
| | | sb_voice.progress = int |
| | | |
| | | sb_voice.setOnSeekBarChangeListener(object :SeekBar.OnSeekBarChangeListener{ |
| | | override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { |
| | | Log.e("MMP","音量调整:${progress}") |
| | | } |
| | | |
| | | override fun onStartTrackingTouch(seekBar: SeekBar?) { |
| | | } |
| | | |
| | | override fun onStopTrackingTouch(seekBar: SeekBar?) { |
| | | SPUtils.instance().put(Const.User.VOLUME_THINK, seekBar?.progress?:50).apply() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.CHANGE_THINK_VOLUME)) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import kotlinx.android.synthetic.main.dialog_input_height.* |
| | | import kotlinx.android.synthetic.main.dialog_withdraw.* |
| | | import java.lang.Exception |
| | | |
| | | class WithdrawDialog:BaseDialogFragment() { |
| | |
| | | fun queryPhysical(@Field("stuID") id: String): Flowable<ResultData<Report>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.startTrain) |
| | | fun startTrain(@Field("courseId") id: String): Flowable<ResultData<TrainInfo>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.exit) |
| | | fun exit(@Field("courseId") id: String,@Field("courseVideoId") courseVideoId: String,@Field("beforeTime") beforeTime: Long, |
| | | @Field("realTime") realTime: Int): Flowable<ResultData<Any>> |
| | |
| | | @Query("pageCurr") page: Int, |
| | | @Query("cateId") typeId: String?, |
| | | @Query("courseTitle") search: String?, |
| | | @Query("pageSize") pageSize: Int = 10, |
| | | @Query("apipost_id") apipost_id: String = "2d6f7f04f99813" |
| | | @Query("pageSize") pageSize: Int = 10 |
| | | ): Flowable<ResultData<CourseListBean>> |
| | | |
| | | @POST(Apis.getCoursePageList) |
| | | fun getCoursePageList( |
| | | @Query("apipost_id") apipost_id: String = "2d2eb9d23993c2" |
| | | ): Flowable<ResultData<TeacherBean>> |
| | | fun getCoursePageList(): Flowable<ResultData<TeacherBean>> |
| | | |
| | | @POST(Apis.getPayCourseInfoById) |
| | | fun getPayCourseInfoById( |
| | | @Query("id") id: String, |
| | | @Query("apipost_id") apipost_id: String = "2d2eb9d23993bd" |
| | | ): Flowable<ResultData<CourseDetail>> |
| | | |
| | | |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.queryCourseInfo) |
| | | fun queryCourseInfo( |
| | | @Field("courseId") id: String |
| | | ): Flowable<ResultData<CourseDetail>> |
| | | |
| | | @POST(Apis.collectCourse) |
| | |
| | | @Query("apipost_id") apipost_id: String = "365e099b799885" |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.buyCourse) |
| | | fun buyCourseInfo( |
| | | @Field("courseId") id: String |
| | | ): Flowable<ResultData<BuyInfo>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.order) |
| | | fun order( |
| | | @Field("id") id: String?, |
| | | @Field("buyType") buyType: Int, |
| | | @Field("payType") payType : Int, |
| | | @Field("couponId") couponId : String?, |
| | | @Field("orderMoney") orderMoney : Double? |
| | | ): Flowable<ResultData<Order>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.success) |
| | | fun success( |
| | | @Field("orderId") id: String |
| | | ): Flowable<ResultData<Coupon>> |
| | | |
| | | @POST(Apis.getProvince) |
| | | fun getProvince( |
| | | ): Flowable<ResultData<List<City>>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.getCity) |
| | | fun getCity( |
| | | @Field("id") id: String |
| | | ): Flowable<ResultData<List<City>>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.setAddress) |
| | | fun setAddress( |
| | | @Field("address") address: String, |
| | | @Field("city") city: String, |
| | | @Field("cityCode") cityCode: String, |
| | | @Field("province") province: String, |
| | | @Field("provinceCode") provinceCode: String, |
| | | @Field("recipient") recipient: String, |
| | | @Field("recipientPhone") recipientPhone: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.getAddress) |
| | | fun getAddress( |
| | | ): Flowable<ResultData<ReceiverBean>> |
| | | |
| | | @POST(Apis.riskInfo) |
| | | fun riskInfo(): Flowable<ResultData<RiskInfo>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.pay) |
| | |
| | | @Field("money") money: Double |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.updateBankCard) |
| | | fun updateBankCard( |
| | | @Field("accountName") accountName: String, |
| | | @Field("bankCard") bankCard: String, |
| | | @Field("bankCardImg") bankCardImg: String, |
| | | @Field("bankName") bankName: String, |
| | | @Field("bankPhone") bankPhone: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.binding) |
| | | fun binding( |
| | | @Field("code") code: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.getBindingUserName) |
| | | fun getBindingUserName( |
| | | @Field("code") code: String |
| | | ): Flowable<ResultData<String>> |
| | | |
| | | @POST(Apis.getBankInfo) |
| | | fun getBankInfo( |
| | | ): Flowable<ResultData<BankInfo>> |
| | | |
| | | @POST(Apis.getCommissionRule) |
| | | fun shareInfo( |
| | | ): Flowable<ResultData<ShareInfo>> |
| | |
| | | @Query("pageSize") pageSize: Int, |
| | | @Query("state") state: Int, |
| | | @Query("apipost_id") apipost_id: String |
| | | ): Flowable<ResultData<CourseListBean>> |
| | | ): Flowable<ResultData<List<CourseBean>>> |
| | | |
| | | @POST(Apis.getVipPrice) |
| | | fun getVipPrice( |
| | |
| | | @Query("apipost_id") apipost_id: String = "2fcbf1daf99704" |
| | | ): Flowable<ResultData<String>> |
| | | |
| | | @POST(Apis.commonQuestion) |
| | | @GET(Apis.commonQuestion) |
| | | fun commonQuestion( |
| | | @Query("pageCurr") pageNum: Int, |
| | | @Query("pageSize") size: Int, |
| | |
| | | @Query("pageSize") size: Int, |
| | | @Query("apipost_id") apipost_id: String = "361bdf11b992d0" |
| | | ): Flowable<ResultData<WalletDetailBean>> |
| | | |
| | | @POST(Apis.energyDetail) |
| | | fun energyDetail( |
| | | @Query("pageCurr") pageNum: Int, |
| | | @Query("state") state: Int, |
| | | @Query("pageSize") size: Int |
| | | ): Flowable<ResultData<List<PowerDetail>>> |
| | | |
| | | @POST(Apis.goodsList) |
| | | fun goodsList( |
| | | @Query("pageCurr") pageNum: Int, |
| | | @Query("pageSize") size: Int |
| | | ): Flowable<ResultData<List<Gift>>> |
| | | |
| | | @POST(Apis.exchangeRecordList) |
| | | fun exchangeRecordList( |
| | | @Query("pageCurr") pageNum: Int, |
| | | @Query("pageSize") size: Int |
| | | ): Flowable<ResultData<List<Gift>>> |
| | | |
| | | @POST(Apis.restart) |
| | | fun restart(): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.exchange) |
| | | fun exchange( |
| | | @Query("prizeId") prizeId: String |
| | | ): Flowable<ResultData<String>> |
| | | |
| | | @POST(Apis.getTotalEnergyValue) |
| | | fun getTotalEnergyValue( |
| | | ): Flowable<ResultData<Int>> |
| | | |
| | | @POST(Apis.balanceDetail) |
| | | fun balanceDetail( |
| | |
| | | @Query("apipost_id") apipost_id: String = "361bdf11f992e7" |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @GET(Apis.studyPage) |
| | | fun studyPage(): Flowable<ResultData<StudyBean>> |
| | | |
| | | @GET(Apis.detailVersion) |
| | | fun detailVersion(): Flowable<ResultData<Version>> |
| | | |
| | | @POST(Apis.bindVx) |
| | | fun bindVx( |
| | | @Query("openId") openId: String, |
| | | @Query("wxName") wxName: String): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.withdrawalRecord) |
| | | fun withdrawalRecord( |
| | |
| | | @Field("pageSize") pageSize : Int = Const.PAGE_SIZE |
| | | ): Flowable<ResultData<List<Detail>>> |
| | | |
| | | @GET |
| | | @POST |
| | | fun queryString( |
| | | @Url url: String, |
| | | @QueryMap map: HashMap<String, Any> |
| | |
| | | |
| | | @POST(Apis.saveUserAnswers) |
| | | fun saveUserAnswers( |
| | | @Body body: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.getPlan) |
| | | fun getPlan(): Flowable<ResultData<String>> |
| | | |
| | | @POST(Apis.verifyCellPhone) |
| | | fun verifyCellPhone( |
| | | @Header("Authorization") token: String, |
| | | @Body body: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | |
| | | @Body body: String |
| | | ): Flowable<ResultData<LoginBean>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.wxLogin) |
| | | fun wxLogin( |
| | | @Field("openId") openid: String?, |
| | | @Field("phone") phone: String?, |
| | | @Field("nickname") nickname: String?, |
| | | @Field("headimgurl") headimgurl: String?, |
| | | @Field("sex") sex: Int? |
| | | @Body body: String |
| | | ): Flowable<ResultData<WxLoginBean>> |
| | | |
| | | @GET(Apis.getBanner) |
| | | fun queryBanner(@Query("apipost_id")apipost_id:String = "2d2eb9d1f993ba"): Flowable<ResultData<ArrayList<Banner>>> |
| | | fun queryBanner(): Flowable<ResultData<ArrayList<Banner>>> |
| | | |
| | | @GET(Apis.getCourseCategoryList) |
| | | fun getCourseCategoryList(@Query("apipost_id")apipost_id:String = "2d2eb9d1f993bb"): Flowable<ResultData<ArrayList<CourseType>>> |
| | | |
| | | @POST(Apis.getList) |
| | | fun getList(): Flowable<ResultData<FilterBean>> |
| | | |
| | | @POST(Apis.getCategoryListByType) |
| | | fun getCategoryListByType( |
| | |
| | | ): Flowable<ResultData<ArrayList<Menu>>> |
| | | |
| | | @GET(Apis.getTodayMeditation) |
| | | fun getTodayMeditation( |
| | | @Query("apipost_id") apipost_id: String = "25c3e3d0b0e15d" |
| | | ): Flowable<ResultData<HomeItem>> |
| | | fun getTodayMeditation(): Flowable<ResultData<HomeItem>> |
| | | |
| | | @GET(Apis.getPersonalityPlan) |
| | | fun getPersonalityPlan( |
| | |
| | | |
| | | @GET(Apis.getMeditationDetails) |
| | | fun getMeditationDetails( |
| | | @Query("id") id: String, |
| | | @Query("apipost_id") apipost_id: String = "25c3e3d0b0e158" |
| | | @Query("id") id: String |
| | | ): Flowable<ResultData<VoiceDetail>> |
| | | |
| | | @POST(Apis.favorite) |
| | | fun favorite( |
| | | @Query("id") id: String, |
| | | @Query("apipost_id") apipost_id: String = "2aa4e14ab0e159" |
| | | @Query("id") id: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @GET(Apis.getMeditationQuestionPage) |
| | | fun getMeditationQuestionPage( |
| | | @Query("id") id: String, |
| | | @Query("pageCurr") pageCurr: Int, |
| | | @Query("pageSize") pageSize: Int, |
| | | @Query("apipost_id") apipost_id: String = "25c3e3d0b0e15b" |
| | | @Query("pageSize") pageSize: Int |
| | | ): Flowable<ResultData<VoiceCommentBean>> |
| | | |
| | | @GET(Apis.search) |
| | | @POST(Apis.search) |
| | | fun search( |
| | | @Query("condition") condition: String, |
| | | @Query("pageCurr") pageCurr: Int, |
| | | @Query("pageSize") pageSize: Int, |
| | | @Query("apipost_id") apipost_id: String = "25c3e3d0b0e160" |
| | | @Query("pageSize") pageSize: Int |
| | | ): Flowable<ResultData<SearchResult>> |
| | | |
| | | @GET(Apis.getHotWordList) |
| | | fun getHotWordList( |
| | | @Query("apipost_id") apipost_id: String = "25c3e3d0b0e156" |
| | | ): Flowable<ResultData<List<String>>> |
| | | |
| | | @FormUrlEncoded |
| | |
| | | |
| | | @POST(Apis.getUserByPhone) |
| | | fun getUserByPhone( |
| | | @Query("phone") phone: String, |
| | | @Query("apipost_id") apipost_id: String = "2e763463799135" |
| | | @Query("phone") phone: String |
| | | ): Flowable<ResultData<UserInfo>> |
| | | |
| | | @POST(Apis.confirmOrder) |
| | | fun confirmOrder( |
| | | @Query("courseId") courseId: String, |
| | | @Query("apipost_id") apipost_id: String = "2d2eb9d1f993b9" |
| | | @Query("courseId") courseId: String |
| | | ): Flowable<ResultData<ConfirmOrder>> |
| | | |
| | | @POST(Apis.confirmOrderVoice) |
| | | fun confirmOrderVoice( |
| | | @Query("meditationId") meditationId: String |
| | | ): Flowable<ResultData<ConfirmOrder>> |
| | | |
| | | @POST(Apis.saveViewingHistory) |
| | | fun saveViewingHistory( |
| | | @Query("timeLook") timeLook: Int, |
| | | @Query("id") id: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.gvieCourse) |
| | | fun gvieCourse( |
| | | @Query("targetId") courseId: String, |
| | | @Query("orderFrom") orderFrom: Int, |
| | | @Query("receiverId") receiverId: String?, |
| | | @Query("payType") payType: Int = 1 |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST |
| | | fun successOrder( |
| | | @Url url: String, |
| | | @Query("courseId") courseId: String, |
| | | @Query("meditationId") meditationId: String |
| | | ): Flowable<ResultData<List<CourseBean>>> |
| | | |
| | | @POST(Apis.studyPageByChapterId) |
| | | fun studyPageByChapterId( |
| | | @Query("chapterId") chapterId: String |
| | | ): Flowable<ResultData<List<Chapter>>> |
| | | |
| | | @POST(Apis.saveCourseStudyHistory) |
| | | fun saveCourseStudyHistory( |
| | | @Query("chapterId") chapterId: String, |
| | | @Query("isOver") isOver: Int, |
| | | @Query("secondLook") secondLook: Int, |
| | | @Query("minuteLook") minuteLook: Int = 0 //用不到分 |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.isFirst) |
| | | fun isFirst(): Flowable<ResultData<Boolean>> |
| | | |
| | | @POST(Apis.getUserTree) |
| | | fun getUserTree(): Flowable<ResultData<TreeInfo>> |
| | | |
| | | @POST(Apis.watering) |
| | | fun watering(): Flowable<ResultData<WaterResult>> |
| | | |
| | | @POST(Apis.sign) |
| | | fun sign(): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.cancellation) |
| | | fun cancellation(): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.updateInfo) |
| | | fun updateInfo( |
| | | @Query("avatar") headImg: String?, |
| | | @Query("birthday") birthday: String?, |
| | | @Query("company") company: String?, |
| | | @Query("education") education: String?, |
| | | @Query("email") email: String?, |
| | | @Query("gender") gender: Int?, |
| | | @Query("hometown") hometown: String?, |
| | | @Query("industry") industry: String?, |
| | | @Query("location") location: String?, |
| | | @Query("nickname") nickname: String?, |
| | | @Query("occupation") occupation: String?, |
| | | @Query("signature") signature: String?, |
| | | @Query("name") name: String?, |
| | | @Query("apipost_id") apipost_id: String = "2fc350e9b99599" |
| | | @Body body: String? |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.placeOrder) |
| | | fun placeOrder( |
| | | @Query("orderFrom") orderFrom: Int, |
| | | @Query("payType") payType: Int, |
| | | @Query("balanceFlag") balanceFlag: Int, |
| | | @Query("amount") amount: Double?, |
| | | @Query("receiverId") receiverId: String?, |
| | | @Query("targetId") targetId: String?, |
| | | @Query("vipType") vipType: Int? |
| | | ): Flowable<ResultData<PayInfo>> |
| | | |
| | | @POST(Apis.updateUserAvatar) |
| | | fun updateUserAvatar( |
| | | @Query("avatar") avatar: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.wallet) |
| | | fun wallet( |
| | | @Query("apipost_id") apipost_id: String = "3518e3f0b99420" |
| | | ): Flowable<ResultData<WalletBean>> |
| | | |
| | | |
| | |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.setUnit) |
| | | fun setUnit( |
| | | @Field("type") type: Int |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.updatePhone) |
| | | fun updatePhone( |
| | | @Field("code") code: String, |
| | | @Field("phone") phone: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.useGuide) |
| | | fun useGuide( |
| | | @Field("title") search: String? |
| | | ): Flowable<ResultData<List<Guide>>> |
| | | |
| | | @POST(Apis.getPhone) |
| | | fun getPhone( |
| | | ): Flowable<ResultData<String>> |
| | | |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.findList) |
| | | fun findList( |
| | | @Field("pageNum") page: Int, |
| | | @Field("userNameOrTitle") search: String?, |
| | | @Field("pageSize") pageSize: Int = Const.PAGE_SIZE |
| | | ): Flowable<ResultData<List<Dynamic>>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.findCommentList) |
| | |
| | | @POST(Apis.report) |
| | | fun report( |
| | | @Query("id") id: String, |
| | | @Query("reason") content: String, |
| | | @Query("apipost_id") apipost_id: String = "25c3e3d0b0e15e" |
| | | @Query("reason") content: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.addQuestion) |
| | | fun addQuestion( |
| | | @Query("meditationId") id: String, |
| | | @Query("content") content: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | |
| | | @Field("quesId") quesId: String |
| | | ): Flowable<ResultData<Notice>> |
| | | |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.constellation) |
| | | fun constellation(@Field("consName") consName: String,@Field("type") type:String): Flowable<ResultData<LuckInfo>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.setWeight) |
| | | fun setWeight(@Field("type") type: Int,@Field("weight") weight:String): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.changeConstellation) |
| | | fun changeConstellation(@Field("consName") consName:String): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.getUserInfo) |
| | | fun getUserInfo(@Query("apipost_id") apipost_id: String = "300079e039993f"): Flowable<ResultData<MineInfo>> |
| | | |
| | | @POST(Apis.getUserDetail) |
| | | fun getUserDetail(@Query("apipost_id") apipost_id: String = "2fc350e9799588"): Flowable<ResultData<UserInfo>> |
| | | |
| | | @POST(Apis.getNotice) |
| | | fun getNotice(): Flowable<ResultData<Notice>> |
| | | } |
| | |
| | | private var isTest = true |
| | | |
| | | // private const val TEST_URL = "http://192.168.110.64:9000/" //内网 |
| | | private const val TEST_URL = "https://mock.apipost.net/mock/31b303c60464000/" //fake |
| | | private const val TEST_URL = "https://xq.xqzhihui.com/api/" //外网 |
| | | private const val LINE_URL = "https://jkcyl.cn/app/" //正式服 |
| | | val BASE_URL = if (isTest) TEST_URL else LINE_URL |
| | | |
| | | /**公共接口*/ |
| | | const val H5_URL = "system/public/getContent" //获取协议 |
| | | const val getCode = "auth/app/sendCaptchaCode" |
| | | const val querySystemImg = "base/appUser/getPage" |
| | | const val querySystemImg = "system/system/page/getPage" |
| | | |
| | | const val PUSH_BASE_URL = "http://113.45.158.158/share/#/" |
| | | const val RANK = PUSH_BASE_URL + "pages/ranking/ranking?userId=%s" |
| | | const val PUSH_LIST = PUSH_BASE_URL + "pages/ranking/recommend?userId=%s" |
| | | const val SHARE_APP = PUSH_BASE_URL + "pages/poster/poster?userId=%s" |
| | | const val SHARE_VOICE = PUSH_BASE_URL + "pages/healDetail/healDetail?id=%s" |
| | | const val SHARE_COURSE = PUSH_BASE_URL + "pages/courseDetail/onLine?courseId=%s" |
| | | const val SHARE_OFFLINE = PUSH_BASE_URL + "pages/courseDetail/offLine?courseId=%s" |
| | | |
| | | /** |
| | | * 登录注册 |
| | |
| | | const val userLogin = "auth/app/login" |
| | | const val captchaLogin = "auth/app/captchaLogin" |
| | | const val forgetPassword = "auth/app/changePassword" |
| | | const val wxLogin = "base/appUser/loginWeChat" |
| | | const val wxLogin = "auth/app/wxLogin" |
| | | const val bindWx = "base/appUser/setPhone" |
| | | const val verifyPhone = "auth/app/verifyPhone" |
| | | const val getTagList = "user/client/app-user/getTagList" |
| | | const val verifyCellPhone = "auth/app/verifyCellPhone" |
| | | const val saveUserAnswers = "user/client/app-user/saveUserAnswers" |
| | | const val getPlan = "system/system/page/getPlan" |
| | | |
| | | /** |
| | | * 首页 |
| | |
| | | const val getMeditationAndCateList = "meditation/client/meditation/home/getMeditationAndCateList" |
| | | const val search = "meditation/client/meditation/home/search" |
| | | const val getHotWordList = "meditation/client/meditation/home/getHotWordList" |
| | | const val getNotice = "base/appUser/getNotice" |
| | | const val constellation = "base/appUser/constellation" |
| | | const val setWeight = "base/appUser/setWeight" |
| | | const val changeConstellation = "base/appUser/changeConstellation" |
| | | const val getHomeBackgroun = "meditation/client/meditation/home/getHomeBackgroun" |
| | | const val getHomeBackgroun = "meditation/client/meditation/home/getHomeBackgroundMusicList" |
| | | const val getMeditationPageByCateId = "meditation/client/meditation/home/getMeditationPageByCateId" |
| | | const val getMeditationDetails = "meditation/client/meditation/home/getMeditationDetails" |
| | | const val favorite = "meditation/client/meditation/home/favorite" |
| | | const val getMeditationQuestionPage = "meditation/client/meditation/home/getMeditationQuestionPage" |
| | | const val doLike = "meditation/client/meditation/home/likeQuestion" |
| | | const val report = "meditation/client/meditation/home/report" |
| | | const val addQuestion = "meditation/client/meditation/home/addQuestion" |
| | | 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 getUserInfo = "user/client/app-user/getUserInfo" |
| | | const val getUserDetail = "user/client/app-user/getUserDetail" |
| | | const val feedBack = "base/appUser/feedBack" |
| | | const val getPhone = "base/appUser/getPhone" |
| | | const val useGuide = "base/appUser/useGuide" |
| | | const val setUnit = "base/appUser/setUnit" |
| | | const val updatePhone = "base/appUser/updatePhone" |
| | | const val updateInfo = "user/client/app-user/updateUserDetail" |
| | | const val updateUserAvatar = "user/client/app-user/updateUserAvatar" |
| | | const val wallet = "user/client/app-user/wallet" |
| | | const val cancellation = "base/appUser/deleteAppUser" |
| | | const val myCourse = "base/sports/myCourse" |
| | | const val collectedCourse = "base/appUser/collectCourse" |
| | | const val placeOrder = "order/client/order/order/placeOrder" |
| | | const val myFind = "base/appUser/myFind" |
| | | const val withdrawal = "base/appUser/Withdrawal" |
| | | const val withdrawalRecord = "base/appUser/withdrawal" |
| | | const val updateBankCard = "base/appUser/updateBankCard" |
| | | const val getBankInfo = "base/appUser/getBankInfo" |
| | | const val getBindingUserName = "base/appUser/getBindingUserName" |
| | | const val binding = "base/appUser/binding" |
| | | const val getCommissionRule = "system/system/common-question/getCommissionRule" |
| | | const val lookHistory = "user/user/app-user-viewing-history/lookHistory" |
| | | const val myCollect = "course/client/course/course/myCollect" |
| | |
| | | const val noticeDetail = "user/client/user/notice-record/noticeDetail" |
| | | const val changePhone = "user/client/app-user/changePhone" |
| | | const val deleteUser = "user/client/app-user/deleteUser" |
| | | const val studyPage = "course/client/course/course/studyPage" |
| | | const val detailVersion = "system/system/version/detailVersion" |
| | | const val bindVx = "user/client/app-user/bindVx" |
| | | |
| | | |
| | | /** |
| | | * 课程 |
| | | */ |
| | | const val getBanner = "course/client/course/course/getBannerList" |
| | | const val getList = "base/sports/getList" |
| | | const val getCourseCategoryList = "course/client/course/course/getCourseCategoryList" |
| | | const val queryCourseList = "course/client/course/course/getCoursePageList" |
| | | const val getCoursePageList = "course/client/course/tutor-special-column/getCoursePageList" |
| | | const val getPayCourseInfoById = "course/client/course/course/getPayCourseInfoById" |
| | | const val collectCourse = "course/client/course/course/collectCourse" |
| | | const val queryCourseInfo = "base/sports/courseDetail" |
| | | const val buyCourse = "base/sports/buyCourse" |
| | | const val pay = "base/sports/pay" |
| | | const val order = "base/sports/order" |
| | | const val success = "base/sports/success" |
| | | const val getProvince = "base/sports/getProvince" |
| | | const val getCity = "base/sports/getCity" |
| | | const val setAddress = "base/sports/setAddress" |
| | | const val getAddress = "base/sports/getAddress" |
| | | const val riskInfo = "base/sports/riskInfo" |
| | | const val queryPhysical = "account/api/startCource/queryPhysical" |
| | | const val startTrain = "base/sports/startTrain" |
| | | const val exit = "base/sports/exit" |
| | | const val completeInfo = "base/sports/completeInfo" |
| | | const val clockIn = "base/sports/clockIn" |
| | | const val queryCouponPackage = "base/appUser/couponList" |
| | | const val getUserByPhone = "user/client/app-user/getUserByPhone" |
| | | const val confirmOrder = "course/client/course/course/confirmOrder" |
| | | const val gvieCourse = "order/client/order/order/gvieCourse" |
| | | const val successOrder = "course/client/course/course/successOrder" |
| | | const val studyPageByChapterId = "course/client/course/course/studyPageByChapterId" |
| | | const val saveCourseStudyHistory = "user/user/app-user-viewing-history/saveCourseStudyHistory" |
| | | |
| | | |
| | | /** |
| | | * 树苗 |
| | | */ |
| | | const val isFirst = "user/client/app-user-tree/isFirst" |
| | | const val getUserTree = "user/client/app-user-tree/getUserTree" |
| | | const val watering = "user/client/app-user-tree/watering" |
| | | const val sign = "user/client/app-user-tree/sign" |
| | | const val energyDetail = "user/client/app-user-tree/energyDetail" |
| | | const val goodsList = "user/client/app-user-tree/goodsList" |
| | | const val exchange = "user/client/app-user-tree/exchange" |
| | | const val getTotalEnergyValue = "user/client/app-user/getTotalEnergyValue" |
| | | const val exchangeRecordList = "user/client/app-user-tree/exchangeRecordList" |
| | | const val restart = "user/client/app-user-tree/restart" |
| | | |
| | | /** |
| | | * 发现 |
| | | */ |
| | | const val getMeditationPage = "meditation/client/meditation/meditation/getMeditationPage" |
| | | const val getMeditationInfo = "meditation/client/meditation/meditation/getMeditationInfo" |
| | | const val messageCount = "base/find/messageCount" |
| | | const val findList = "base/find/findList" |
| | | const val exceptionDetail = "account/base/exploreWP/exceptionDetail" |
| | | const val findDetail = "base/find/findDetail" |
| | | const val findCommentList = "base/find/findCommentList" |
| | |
| | | override fun isShowToast() = showToast |
| | | |
| | | override fun onError(code: Int, msg: String) { |
| | | if (code == 700||code == 401){//token无效 |
| | | if (code == 700||code == 401||code == 501){//token无效 |
| | | error(code,"登录已失效") |
| | | SPUtils.instance().remove(Const.User.TOKEN).remove(Const.User.USER_ID).apply() |
| | | // (activity.application as JkApplication).exit() |
| | |
| | | override fun isShowToast() = showToast |
| | | |
| | | override fun onError(code: Int, msg: String) { |
| | | if (code == 401){//token无效 |
| | | if (code == 401||code == 501){//token无效 |
| | | error(code,"登录已失效") |
| | | SPUtils.instance().remove(Const.User.TOKEN).remove(Const.User.USER_ID).apply() |
| | | // (fragment.activity!!.application as JkApplication).exit() |
| | |
| | | import com.google.gson.Gson |
| | | import com.google.gson.JsonObject |
| | | import com.sinata.xqmuse.network.entity.* |
| | | import com.sinata.xqmuse.network.entity.req.ReqAnswer |
| | | import com.sinata.xqmuse.network.entity.req.ReqRegister |
| | | import com.sinata.xqmuse.network.entity.req.* |
| | | import com.sinata.xqmuse.ui.mine.WatchHisActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.pay.PayInfo |
| | |
| | | } |
| | | |
| | | /** |
| | | * 课程报名,充值下单 |
| | | */ |
| | | fun payCourse( |
| | | id: String?, |
| | | payType: Int, |
| | | buyType: Int, |
| | | couponId:String?, |
| | | orderMoney:Double? = null |
| | | ): Flowable<ResultData<Order>> { |
| | | return request().order(id, buyType,payType, couponId,orderMoney) |
| | | } |
| | | |
| | | /** |
| | | * 支付 |
| | | */ |
| | | fun pay( |
| | |
| | | } |
| | | |
| | | /** |
| | | * 省市 |
| | | */ |
| | | fun getCity(id:String?): Flowable<ResultData<List<City>>> { |
| | | return if (id.isNullOrEmpty()) request().getProvince() else request().getCity(id) |
| | | } |
| | | |
| | | /** |
| | | * 收件地址 |
| | | */ |
| | | fun setAddress(address:String,provinceCode: String,province:String,cityCode: String,city:String,phone: String,name: String): Flowable<ResultData<Any>> { |
| | | return request().setAddress(address,city,cityCode,province,provinceCode,name,phone) |
| | | } |
| | | |
| | | /** |
| | | * 收件地址 |
| | | */ |
| | | fun getAddress(): Flowable<ResultData<ReceiverBean>> { |
| | | return request().getAddress() |
| | | } |
| | | |
| | | /** |
| | | * 风险提示 |
| | | */ |
| | | fun riskInfo(): Flowable<ResultData<RiskInfo>> { |
| | | return request().riskInfo() |
| | | } |
| | | |
| | | /** |
| | | * 体检报告 |
| | | */ |
| | | fun queryPhysical(id: String): Flowable<ResultData<Report>> { |
| | |
| | | |
| | | |
| | | /** |
| | | * 开始训练 |
| | | */ |
| | | fun startTrain(id: String): Flowable<ResultData<TrainInfo>> { |
| | | return request().startTrain(id) |
| | | } |
| | | |
| | | /** |
| | | * 暂停训练 |
| | | */ |
| | | fun exit(courseId: String,videoId:String,seekTo:Long,realTime:Int): Flowable<ResultData<Any>> { |
| | | return request().exit(courseId,videoId,seekTo,realTime) |
| | | } |
| | | |
| | | /** |
| | | * 打卡 |
| | | */ |
| | | fun clockIn(courseId: String): Flowable<ResultData<FinishBean>> { |
| | | return request().clockIn(courseId) |
| | | } |
| | | |
| | | /** |
| | | * 完成训练 |
| | | */ |
| | | fun completeInfo(courseId: String): Flowable<ResultData<FinishBean>> { |
| | | return request().completeInfo(courseId) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 课程详情 |
| | | */ |
| | | fun queryCourseInfo(id: String): Flowable<ResultData<CourseDetail>> { |
| | | return request().queryCourseInfo(id) |
| | | } |
| | | |
| | | /** |
| | | * 课程收藏 |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * 课程套餐详情 |
| | | */ |
| | | fun buyCourseInfo(id: String): Flowable<ResultData<BuyInfo>> { |
| | | return request().buyCourseInfo(id) |
| | | } |
| | | |
| | | /** |
| | | * 我的动态 |
| | | */ |
| | | fun myFind(page: Int): Flowable<ResultData<ArrayList<Dynamic>>> { |
| | | return request().myFind(page) |
| | | } |
| | | |
| | | /** |
| | | * 绑卡 |
| | | */ |
| | | fun updateBankCard(name: String,phone: String,num: String,bank:String,photo:String): Flowable<ResultData<Any>> { |
| | | return request().updateBankCard(name,num,photo,bank,phone) |
| | | } |
| | | |
| | | /** |
| | | * 绑邀请人 |
| | | */ |
| | | fun binding(code: String): Flowable<ResultData<Any>> { |
| | | return request().binding(code) |
| | | } |
| | | |
| | | /** |
| | | * 绑邀请人 |
| | | */ |
| | | fun getBindingUserName(code: String): Flowable<ResultData<String>> { |
| | | return request().getBindingUserName(code) |
| | | } |
| | | |
| | | /** |
| | | * 绑卡 |
| | | */ |
| | | fun getBankInfo(): Flowable<ResultData<BankInfo>> { |
| | | return request().getBankInfo() |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 我的课程列表 |
| | | */ |
| | | fun lookHistory(type: Int,page: Int,state:Int): Flowable<ResultData<CourseListBean>> { |
| | | fun lookHistory(type: Int,page: Int,state:Int): Flowable<ResultData<List<CourseBean>>> { |
| | | val url = if (type == WatchHisActivity.WATCH_HIS) Apis.lookHistory else if (type == WatchHisActivity.COLLECTED) Apis.myCollect else Apis.myOrderCourse |
| | | val id = if (type == WatchHisActivity.WATCH_HIS) "361bdf123992fb" else if (type == WatchHisActivity.COLLECTED) "365e099bb9988b" else "365f4fc1b99030" |
| | | return request().lookHistory(url,page,10,state,id) |
| | |
| | | return request().balanceList(page,state,Const.PAGE_SIZE) |
| | | } |
| | | |
| | | fun energyDetail(page: Int,state: Int): Flowable<ResultData<List<PowerDetail>>> { |
| | | return request().energyDetail(page,state,Const.PAGE_SIZE) |
| | | } |
| | | |
| | | fun goodsList(page: Int): Flowable<ResultData<List<Gift>>> { |
| | | return request().goodsList(page,Const.PAGE_SIZE) |
| | | } |
| | | |
| | | fun exchangeRecordList(page: Int): Flowable<ResultData<List<Gift>>> { |
| | | return request().exchangeRecordList(page,Const.PAGE_SIZE) |
| | | } |
| | | |
| | | fun restart(): Flowable<ResultData<Any>> { |
| | | return request().restart() |
| | | } |
| | | |
| | | fun getTotalEnergyValue(): Flowable<ResultData<Int>> { |
| | | return request().getTotalEnergyValue() |
| | | } |
| | | |
| | | fun exchange(id: String): Flowable<ResultData<String>> { |
| | | return request().exchange(id) |
| | | } |
| | | |
| | | fun balanceDetail(id: String): Flowable<ResultData<BalanceDetail>> { |
| | | return request().balanceDetail(id) |
| | | } |
| | |
| | | return request().deleteUser() |
| | | } |
| | | |
| | | fun studyPage(): Flowable<ResultData<StudyBean>> { |
| | | return request().studyPage() |
| | | } |
| | | |
| | | fun detailVersion(): Flowable<ResultData<Version>> { |
| | | return request().detailVersion() |
| | | } |
| | | |
| | | /** |
| | | * 提现 |
| | | */ |
| | | fun withdrawal(money: Double): Flowable<ResultData<Any>> { |
| | | return request().withdrawal(money) |
| | | } |
| | | |
| | | fun bindVx(openid: String,wxName:String): Flowable<ResultData<Any>> { |
| | | return request().bindVx(openid,wxName) |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | fun saveUserAnswers(answer: ReqAnswer): Flowable<ResultData<Any>> { |
| | | return request().saveUserAnswers(Gson().toJson(answer)) |
| | | } |
| | | |
| | | /** |
| | | * 引导音乐 |
| | | */ |
| | | fun getPlan(): Flowable<ResultData<String>> { |
| | | return request().getPlan() |
| | | } |
| | | |
| | | /** |
| | | * 微信登录-绑定手机号 |
| | | */ |
| | | fun verifyCellPhone(token:String,phone: String,code: String,openid: String): Flowable<ResultData<Any>> { |
| | | return request().verifyCellPhone(" $token",Gson().toJson(ReqBindWxPhone(code,phone,openid))) |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * wx登录 |
| | | */ |
| | | fun wxLogin(openid: String?, phone: String?,name: String?,sex: Int?,avatar: String?): Flowable<ResultData<WxLoginBean>> { |
| | | return request().wxLogin(openid, phone,name,avatar,sex) |
| | | fun wxLogin(openid: String?, name: String?,sex: Int?,avatar: String?): Flowable<ResultData<WxLoginBean>> { |
| | | return request().wxLogin(Gson().toJson(ReqWxLogin(avatar,name,sex,openid))) |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | fun getCourseCategoryList(): Flowable<ResultData<ArrayList<CourseType>>> { |
| | | return request().getCourseCategoryList() |
| | | } |
| | | |
| | | /** |
| | | * 筛选项 |
| | | */ |
| | | fun getList(): Flowable<ResultData<FilterBean>> { |
| | | return request().getList() |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 确认订单 |
| | | */ |
| | | fun confirmOrderVoice(id: String): Flowable<ResultData<ConfirmOrder>> { |
| | | return request().confirmOrderVoice(id) |
| | | } |
| | | |
| | | /** |
| | | * 余额支付订单 |
| | | */ |
| | | fun gvieCourse(id: String,type: Int,receiveId:String? = null): Flowable<ResultData<Any>> { |
| | | return request().gvieCourse(id,type,receiveId) |
| | | } |
| | | |
| | | fun saveViewingHistory(id: String,time: Int): Flowable<ResultData<Any>> { |
| | | return request().saveViewingHistory(time,id) |
| | | } |
| | | |
| | | /** |
| | | * 支付成功 |
| | | */ |
| | | fun successOrder(id: String,isVoice:Boolean): Flowable<ResultData<List<CourseBean>>> { |
| | | return request().successOrder(if (isVoice) Apis.successOrderVoice else Apis.successOrder, id,id) |
| | | } |
| | | |
| | | /** |
| | | * 课程学习 |
| | | */ |
| | | fun studyPageByChapterId(id: String): Flowable<ResultData<List<Chapter>>> { |
| | | return request().studyPageByChapterId(id) |
| | | } |
| | | |
| | | /** |
| | | * 记录视频观看 |
| | | */ |
| | | fun saveCourseStudyHistory(id: String,isOver:Int,secondLook:Int): Flowable<ResultData<Any>> { |
| | | return request().saveCourseStudyHistory(id,isOver,secondLook) |
| | | } |
| | | |
| | | fun isFirst(): Flowable<ResultData<Boolean>> { |
| | | return request().isFirst() |
| | | } |
| | | |
| | | fun getUserTree(): Flowable<ResultData<TreeInfo>> { |
| | | return request().getUserTree() |
| | | } |
| | | |
| | | fun watering(): Flowable<ResultData<WaterResult>> { |
| | | return request().watering() |
| | | } |
| | | |
| | | fun sign(): Flowable<ResultData<Any>> { |
| | | return request().sign() |
| | | } |
| | | |
| | | /** |
| | | * 注销 |
| | | */ |
| | | fun cancellation(): Flowable<ResultData<Any>> { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 设置单位 |
| | | */ |
| | | fun setUnit(type: Int): Flowable<ResultData<Any>> { |
| | | return request().setUnit(type) |
| | | } |
| | | |
| | | /** |
| | | * 设置手机 |
| | | */ |
| | | fun updatePhone(phone: String,code: String): Flowable<ResultData<Any>> { |
| | | return request().updatePhone(code, phone) |
| | | } |
| | | |
| | | /** |
| | | * 常见问题 |
| | | */ |
| | | fun useGuide(search: String?): Flowable<ResultData<List<Guide>>> { |
| | | return request().useGuide(search) |
| | | } |
| | | |
| | | /** |
| | | * 联系 |
| | | */ |
| | | fun getPhone(): Flowable<ResultData<String>> { |
| | | return request().getPhone() |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 更新用户信息 |
| | | */ |
| | | fun updateInfo(headImg: String?, birthday: String?, company: String?,education: String?,email: String?,gender: Int?,hometown: String?,industry: String?, |
| | | fun updateInfo(birthday: String?, company: String?,education: String?,email: String?,gender: Int?,hometown: String?,industry: String?, |
| | | location: String?,nickname: String?,occupation: String?, signature: String?,name: String?): Flowable<ResultData<Any>> { |
| | | return request().updateInfo(headImg, birthday, company, education, email, gender, hometown, industry, location, nickname, occupation, signature, name) |
| | | val req = ReqUpdateUser(birthday,company,education,email,gender,hometown,industry,location,nickname,occupation,name,signature) |
| | | return request().updateInfo(Gson().toJson(req)) |
| | | } |
| | | |
| | | /** |
| | | * 支付 |
| | | */ |
| | | fun placeOrder(orderFrom:Int,payType:Int,balanceFlag:Int,amount:Double?,receiverId:String?,targetId:String?,vipType:Int?): Flowable<ResultData<PayInfo>> { |
| | | return request().placeOrder(orderFrom, payType, balanceFlag, amount, receiverId, targetId, vipType) |
| | | } |
| | | |
| | | /** |
| | | * 更新用户头像 |
| | | */ |
| | | fun updateUserAvatar(avatar: String): Flowable<ResultData<Any>> { |
| | | return request().updateUserAvatar(avatar) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 运势 |
| | | */ |
| | | fun constellation(consName: String,type: String): Flowable<ResultData<LuckInfo>> { |
| | | return request().constellation(consName,type) |
| | | } |
| | | |
| | | /** |
| | | * 动态列表 |
| | | */ |
| | | fun findList(page: Int,search: String?): Flowable<ResultData<List<Dynamic>>> { |
| | | return request().findList(page, search) |
| | | } |
| | | |
| | | /** |
| | | * 动态评论列表 |
| | | */ |
| | | fun findCommentList(page: Int,id: String,size: Int): Flowable<ResultData<List<Comment>>> { |
| | | return request().findCommentList(id,page,size) |
| | | } |
| | | |
| | | /** |
| | | * 评论回复列表 |
| | | */ |
| | | fun findCommentListOne(page: Int,id: String,size: Int): Flowable<ResultData<List<ReplyComment>>> { |
| | | return request().findCommentListOne(id,page,size) |
| | | } |
| | | |
| | | /** |
| | | * 举报 |
| | | */ |
| | | fun report(id: String,content: String): Flowable<ResultData<Any>> { |
| | | return request().report(id, content) |
| | | } |
| | | |
| | | /** |
| | | * 提问 |
| | | */ |
| | | fun addQuestion(id: String,content: String): Flowable<ResultData<Any>> { |
| | | return request().addQuestion(id, content) |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | fun getUserDetail(): Flowable<ResultData<UserInfo>> { |
| | | return request().getUserDetail() |
| | | } |
| | | |
| | | /** |
| | | *公告消息 |
| | | */ |
| | | fun getNotice(): Flowable<ResultData<Notice>> { |
| | | return request().getNotice() |
| | | } |
| | | |
| | | /** |
| | | *设置体重 |
| | | * @param type 1=设置目标体重 2=记录体重 |
| | | */ |
| | | fun setWeight(type: Int,weight:String): Flowable<ResultData<Any>> { |
| | | return request().setWeight(type, weight) |
| | | } |
| | | |
| | | /** |
| | | *设置星座 |
| | | */ |
| | | fun changeConstellation(name:String): Flowable<ResultData<Any>> { |
| | | return request().changeConstellation(name) |
| | | } |
| | | } |
| | |
| | | |
| | | data class TeacherBean( |
| | | val coverUrl: String, |
| | | val createBy: String, |
| | | val createTime: String, |
| | | val delFlag: Int, |
| | | val id: Int, |
| | | val id: String, |
| | | val list: List<CourseBean>, |
| | | val tutorIntroduction: String, |
| | | val updateBy: String, |
| | | val updateTime: String, |
| | | val videoUrl: String |
| | | ) |
| | | |
| | |
| | | data class BGMBean( |
| | | val audioFile: String, |
| | | val audioFileName: String, |
| | | val id: Int, |
| | | val id: String, |
| | | val imageUrl: String |
| | | ) |
| | |
| | | |
| | | import android.content.Context |
| | | import com.google.gson.annotations.SerializedName |
| | | import com.sinata.xqmuse.ui.course.CourseDetailActivity |
| | | import com.sinata.xqmuse.ui.discovery.DynamicActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | |
| | | data class Banner( |
| | |
| | | |
| | | @Parcelize |
| | | data class ConfirmOrder( |
| | | val address: String, |
| | | val addressDetail: String, |
| | | val balance: String, |
| | | val briefIntroduction: String, |
| | | val cateId: Int, |
| | | val address: String?, |
| | | val addressDetail: String?, |
| | | val balance: String?, |
| | | val briefIntroduction: String?, |
| | | val chargeType: Int, |
| | | val courseTitle: String, |
| | | val courseType: Int, |
| | | val courseTitle: String?, |
| | | val meditationTitle: String?, |
| | | val courseType: Int?, |
| | | val coverUrl: String, |
| | | val createBy: String, |
| | | val createTime: String, |
| | | val description: String, |
| | | val detailUrl: String, |
| | | val description: String?, |
| | | val detailUrl: String?, |
| | | val generalPrice: String, |
| | | val id: String, |
| | | val latitude: Double, |
| | | val listingStatus: Int, |
| | | val longitude: Double, |
| | | val recommend: Int, |
| | | val sortNum: Int, |
| | | val tutor: String, |
| | | val wxQrCode: String |
| | | val tutor: String?, |
| | | val tutorName: String?, |
| | | val wxQrCode: String? |
| | | ):Parcelable |
| | |
| | | |
| | | @Parcelize |
| | | data class CourseBean( |
| | | val address: String, |
| | | val addressDetail: String, |
| | | val briefIntroduction: String, |
| | | val cateId: Int, |
| | | val address: String?, |
| | | val addressDetail: String?, |
| | | val briefIntroduction: String?, |
| | | val coverDescription: String?, |
| | | val cateId: String, |
| | | val chargeType: Int, |
| | | val count: Int, |
| | | val courseTitle: String, |
| | | val count: Int?, |
| | | val realLearnedNum: Int?, |
| | | val paymentStatus: Int?, |
| | | val courseTitle: String?, |
| | | val meditationTitle: String?, |
| | | val courseType: Int, |
| | | val coverUrl: String, |
| | | val description: String, |
| | | val detailUrl: String, |
| | | val generalPrice: Int, |
| | | val generalPrice: Double, |
| | | val headers: ArrayList<String>?, |
| | | val id: String, |
| | | val iosPrice: Int, |
| | | val businessId: String?, |
| | | val isBuy: Int, |
| | | val isVip: Int, |
| | | val latitude: Int, |
| | | val latitude: Double, |
| | | val listingStatus: Int, |
| | | val longitude: Int, |
| | | val longitude: Double, |
| | | val recommend: Int, |
| | | val sortNum: Int, |
| | | val tutor: String, |
| | | val wxQrCode: String |
| | | val wxQrCode: String? |
| | | ): Parcelable |
| | |
| | | import android.os.Parcelable |
| | | import com.sinata.xqmuse.ui.course.CourseDetailActivity |
| | | import com.sinata.xqmuse.ui.course.OfflineCourseActivity |
| | | import com.sinata.xqmuse.ui.mine.VipActivity |
| | | import kotlinx.android.parcel.Parcelize |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | |
| | | @Parcelize |
| | | data class CourseDetail( |
| | | val address: String, |
| | | val addressDetail: String, |
| | | val briefIntroduction: String, |
| | | val cateId: Int, |
| | | val address: String?, |
| | | val addressDetail: String?, |
| | | val briefIntroduction: String?, |
| | | val chargeType: Int, |
| | | val count: Int, |
| | | val courseTitle: String, |
| | | val courseType: Int, |
| | | val coverUrl: String, |
| | | val description: String, |
| | | val description: String?, |
| | | val detailUrl: String, |
| | | val generalPrice: String, |
| | | val generalPrice: String?, |
| | | val headers: List<String>, |
| | | val id: String, |
| | | val isBuy: Int, |
| | | var isBuy: Int, |
| | | val isVip: Int, |
| | | val latitude: Int, |
| | | val latitude: Double, |
| | | val list: List<Chapter>, |
| | | val list2: List<CourseBean>, |
| | | val listingStatus: Int, |
| | | val longitude: Int, |
| | | val longitude: Double, |
| | | var recommend: Int, |
| | | val sortNum: Int, |
| | | val tutor: String, |
| | | val wxQrCode: String |
| | | val wxQrCode: String? |
| | | ):Parcelable{ |
| | | fun goDetail(context: Context){ |
| | | if (courseType == 2){//线下课 |
| | | context.startActivity<OfflineCourseActivity>("data" to this) |
| | | }else if (chargeType == 2&&isVip != 1){ |
| | | context.toast("去开会员") |
| | | // context.startActivity<CourseDetailActivity>("data" to this) |
| | | context.startActivity<VipActivity>() |
| | | }else{ |
| | | context.startActivity<CourseDetailActivity>("data" to this) |
| | | } |
| | |
| | | @Parcelize |
| | | data class Chapter( |
| | | val chapterTitle: String, |
| | | val courseId: Int, |
| | | val createBy: String, |
| | | val courseId: String, |
| | | val createTime: String, |
| | | val delFlag: Int, |
| | | val duration: Int, |
| | | val id: Int, |
| | | val isOver: Int, |
| | | val id: String, |
| | | var isOver: Int, |
| | | val minuteLook: Int, |
| | | val realLearnedNum: Int, |
| | | val secondLook: Int, |
| | | var secondLook: Int, |
| | | val sortNum: Int, |
| | | val updateBy: String, |
| | | val updateTime: String, |
| | | val videoUrl: String, |
| | | val virtualLearnedNum: Int |
| | | ):Parcelable |
| | |
| | | val video: String, |
| | | var isExpand:Boolean = false, |
| | | var isMine:Boolean = false |
| | | ){ |
| | | fun getLevelRes():Int{ |
| | | val i = if (clockIn.isNullOrEmpty()) 0 else clockIn.toInt() |
| | | return when(i){ |
| | | in 0..9-> R.mipmap.xinren |
| | | in 10..29-> R.mipmap.qingtong |
| | | in 30..59-> R.mipmap.baiyin |
| | | in 60..89-> R.mipmap.huangjin |
| | | in 90..119-> R.mipmap.zuanshi |
| | | in 120..239-> R.mipmap.dashi |
| | | else -> R.mipmap.wangzhe |
| | | } |
| | | } |
| | | } |
| | | ) |
New file |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | data class Gift( |
| | | val coverUrl: String, |
| | | val createTime: String, |
| | | val energyValue: Int, |
| | | val id: String, |
| | | val code: String, |
| | | val name: String, |
| | | val receiveCount: Int, |
| | | var receiveStatus: Int, |
| | | val sortNum: Int, |
| | | val status: Int, |
| | | val uid: String, |
| | | val worth: Double |
| | | ) |
| | |
| | | val clientMeditationVO: CommonItemBean, |
| | | val endPlayTime: String, |
| | | val id: String, |
| | | val time: Int?, |
| | | val imageUrl: String, |
| | | val meditationId: String, |
| | | val startPlayTime: String |
| | |
| | | data class CommonItemBean( |
| | | val backgroundUrl: String, |
| | | val cateId: String, |
| | | val generalPrice: String, |
| | | val chargeType: Int, |
| | | val coverDescription: String, |
| | | val coverUrl: String, |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | data class LuckItem( |
| | | val name: String, |
| | | val value:String |
| | | ){ |
| | | fun getIndicator() = when(name){ |
| | | "爱情指数"-> R.drawable.orange_dot |
| | | "健康指数"-> R.drawable.blue_dot |
| | | "财运指数"-> R.drawable.purple_dot |
| | | "综合指数","幸运色"-> R.drawable.red_dot |
| | | else->R.drawable.green_dot |
| | | } |
| | | } |
| | |
| | | data class MineInfo( |
| | | val avatar: String, |
| | | val cellPhone: String, |
| | | val continuity: String, |
| | | val continuity: String?, |
| | | val cumulative: String, |
| | | val id: String, |
| | | val isVip: Int, |
| | |
| | | val levelIcon: String, |
| | | val levelName: String, |
| | | val nickname: String, |
| | | val realname: String?, |
| | | val today: Int, |
| | | val vipExpireTime: String |
| | | val vipExpireTime: String? |
| | | ):Parcelable |
| | |
| | | ) |
| | | |
| | | data class Msg( |
| | | val appUserId: Int, |
| | | val appUserId: String, |
| | | val content: String, |
| | | val id: String, |
| | | val meditationQuestionId: Int, |
| | | val meditationQuestionId: String, |
| | | val noticeType: Int, |
| | | var readStatus: Int, |
| | | val time: String, |
| | |
| | | val content: String?, |
| | | val coverDescription: String?, |
| | | val iconUrl: String?, |
| | | val meditationQuestionId: Int?, |
| | | val meditationQuestionId: String?, |
| | | val meditationTitle: String?, |
| | | val nickname: String?, |
| | | val noticeType: Int, |
| | |
| | | val createBy: String, |
| | | val createTime: String, |
| | | val detailBannerUrl: String, |
| | | val distance: String, |
| | | val distance: Double, |
| | | val hallName: String, |
| | | val id: String, |
| | | val latitude: Double, |
New file |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | data class PowerDetail( |
| | | val changeType: Int, |
| | | val createTime: String, |
| | | val energyValue: Int, |
| | | val id: String, |
| | | val name: String, |
| | | val phone: String, |
| | | val reason: String |
| | | ) |
| | |
| | | data class QA( |
| | | val content: String, |
| | | val customerServiceQrCode: String, |
| | | val id: Int, |
| | | val questionDescription: String, |
| | | val questionName: String, |
| | | val type: Int |
New file |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | data class StudyBean( |
| | | val courseList:List<CourseBean>, |
| | | val freeCourseList:List<CourseBean> |
| | | ) |
New file |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.utils.Const |
| | | |
| | | data class TreeInfo( |
| | | var energyValue: Int, |
| | | var total: Int, |
| | | var totalEnergyValue: Int, |
| | | val growthValue: Int, |
| | | val isSign: Int, |
| | | val nextLevel: Int, |
| | | val sowAgain: Int, |
| | | val status: Int, |
| | | val taskOne: Int, |
| | | val taskTwo: Int, |
| | | var treeLevelType: Int |
| | | ){ |
| | | fun getTreeApng() = when(treeLevelType){ //1=种子 2=发芽 3=幼苗 4=小树苗 5=中等树苗 6=小树 7=中树 8=大树 9=成熟的大树 10=参天大树 |
| | | 1-> "apngb_level_1.png" |
| | | 2-> "apngb_level_2.png" |
| | | 3-> "apngb_level_3.png" |
| | | 4-> "apngb_level_4.png" |
| | | 5-> "apngb_level_5.png" |
| | | 6-> "apngb_level_6.png" |
| | | 7-> "apngb_level_7.png" |
| | | 8-> "apngb_level_8.png" |
| | | 9-> "apngb_level_9.png" |
| | | 10-> "apngb_level_10.png" |
| | | else->"apngb_level_1.png" |
| | | } |
| | | |
| | | fun getTreeDead() = when(treeLevelType){ //1=种子 2=发芽 3=幼苗 4=小树苗 5=中等树苗 6=小树 7=中树 8=大树 9=成熟的大树 10=参天大树 |
| | | 2-> R.mipmap.dead_2 |
| | | 3-> R.mipmap.dead_3 |
| | | 4-> R.mipmap.dead_4 |
| | | 5-> R.mipmap.dead_5 |
| | | 6-> R.mipmap.dead_6 |
| | | 7-> R.mipmap.dead_7 |
| | | 8-> R.mipmap.dead_8 |
| | | 9-> R.mipmap.dead_9 |
| | | 10-> R.mipmap.dead_10 |
| | | else->R.mipmap.dead_1 |
| | | } |
| | | |
| | | fun getLevelUpAudio() = when(treeLevelType){ //1=种子 2=发芽 3=幼苗 4=小树苗 5=中等树苗 6=小树 7=中树 8=大树 9=成熟的大树 10=参天大树 |
| | | 2-> Const.TREE.LEVEL_2 |
| | | 3-> Const.TREE.LEVEL_3 |
| | | 4-> Const.TREE.LEVEL_4 |
| | | 5-> Const.TREE.LEVEL_5 |
| | | 6-> Const.TREE.LEVEL_6 |
| | | 7-> Const.TREE.LEVEL_7 |
| | | 8-> Const.TREE.LEVEL_8 |
| | | 9-> Const.TREE.LEVEL_9 |
| | | 10-> Const.TREE.LEVEL_10 |
| | | else->"" |
| | | } |
| | | |
| | | fun getLevelName() = when(treeLevelType){ //1=种子 2=发芽 3=幼苗 4=小树苗 5=中等树苗 6=小树 7=中树 8=大树 9=成熟的大树 10=参天大树 |
| | | 2-> "发芽" |
| | | 3-> "幼苗" |
| | | 4-> "小树苗" |
| | | 5-> "中等树苗" |
| | | 6-> "小树" |
| | | 7-> "中树" |
| | | 8-> "大树" |
| | | 9-> "成熟的大树" |
| | | 10->"参天大树" |
| | | else->"种子" |
| | | } |
| | | } |
| | |
| | | data class UserInfo( |
| | | var appleId: String?, |
| | | var avatar: String?, |
| | | var balance: Int, |
| | | var balance: Double, |
| | | var birthday: String?, |
| | | var cellPhone: String?, |
| | | var company: String?, |
| | |
| | | var id: String, |
| | | var income: Int, |
| | | var industry: String?, |
| | | var inviteUserId: Int, |
| | | var inviteUserId: String, |
| | | var isFirst: Int, |
| | | var levelSettingId: Int, |
| | | var location: String?, |
| | | var logoutTime: String?, |
| | | var nickname: String?, |
| | | var realname: String?, |
| | | var occupation: String?, |
| | | var registerTime: String?, |
| | | var sanskritFlag: Int, |
| | |
| | | var userId: Int, |
| | | var userStatus: Int, |
| | | var vipExpireTime: String?, |
| | | var wxOpenId: String? |
| | | var wxOpenId: String?, |
| | | var wxName: String? |
| | | ):Parcelable |
New file |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | data class Version( |
| | | val androidFile: String, |
| | | val remark: String, |
| | | val versionNo: String |
| | | ) |
| | |
| | | ) |
| | | |
| | | data class Comment( |
| | | val appUserId: Int, |
| | | val appUserId: String, |
| | | val avatar: String, |
| | | val content: String, |
| | | val id: String, |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | import android.content.Context |
| | | import android.os.Parcelable |
| | | import com.sinata.xqmuse.ui.home.BuyVoiceActivity |
| | | import com.sinata.xqmuse.ui.home.VoiceDetailActivity |
| | | import com.sinata.xqmuse.ui.mine.VipActivity |
| | | import kotlinx.android.parcel.Parcelize |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | @Parcelize |
| | | data class VoiceDetail( |
| | | val backgroundUrl: String, |
| | | val cateId: String, |
| | |
| | | val detailDescription: String, |
| | | var favorite: Int, |
| | | val favoriteCount: Int, |
| | | val iconUrl: String, |
| | | val id: String, |
| | | val listingStatus: Int, |
| | | val meditationMusicList: List<String>, |
| | | val isBuy: Int?, |
| | | val meditationMusicList: List<String>?, |
| | | val meditationSecondList: List<Int>?, |
| | | val meditationTitle: String, |
| | | val questionCount: String, |
| | | val realLearnedNum: Int, |
| | | val sanskrit: Int, |
| | | val isVip: Int, |
| | | val sortNum: Int, |
| | | val tutorAudioUrl: String, |
| | | val virtualLearnedNum: Int |
| | | ) |
| | | ):Parcelable{ |
| | | fun goDetail(context: Context){ |
| | | if (chargeType == 2&&isVip != 1){ //会员免费 |
| | | context.startActivity<VipActivity>() |
| | | }else if (chargeType == 3&&isBuy != 1){ //单独收费且未购买 |
| | | context.startActivity<BuyVoiceActivity>("id" to id) |
| | | }else{ |
| | | context.startActivity<VoiceDetailActivity>("data" to this) |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | data class WaterResult( |
| | | val growthValue: Int, |
| | | val isNext: Boolean, |
| | | val nextLevel: Int, |
| | | val status: Int |
| | | ) |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | data class WxLoginBean( |
| | | val id: String, |
| | | val isBind: String, |
| | | val token: String |
| | | val bindStatus: Int, |
| | | val accessToken: String |
| | | ) |
New file |
| | |
| | | package com.sinata.xqmuse.network.entity.req |
| | | |
| | | data class ReqBindWxPhone( |
| | | val captcha: String, |
| | | val cellPhone: String, |
| | | val wxOrAppleId: String, |
| | | val loginType: Int = 1 |
| | | ) |
New file |
| | |
| | | package com.sinata.xqmuse.network.entity.req |
| | | |
| | | data class ReqUpdateUser( |
| | | val birthday: String?, |
| | | val company: String?, |
| | | val education: String?, |
| | | val email: String?, |
| | | val gender: Int?, |
| | | val hometown: String?, |
| | | val industry: String?, |
| | | val location: String?, |
| | | val nickname: String?, |
| | | val occupation: String?, |
| | | val realname: String?, |
| | | val signature: String? |
| | | ) |
New file |
| | |
| | | package com.sinata.xqmuse.network.entity.req |
| | | |
| | | data class ReqWxLogin( |
| | | val headImgUrl: String?, |
| | | val nickname: String?, |
| | | val sex: Int?, |
| | | val wxOpenId: String? |
| | | ) |
| | |
| | | import android.widget.SeekBar |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.BGMBean |
| | |
| | | import com.sinata.xqmuse.ui.home.adapter.BgmBannerAdapter |
| | | import com.sinata.xqmuse.utils.AudioUtils |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.activity_bgm.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | |
| | | class BGMSettingActivity :TransparentStatusBarActivity(), AudioUtils.OnAudioStatusUpdateListener { |
| | |
| | | }) |
| | | |
| | | tv_action.setOnClickListener { |
| | | SPUtils.instance().put(Const.User.VOLUME,sb_voice.progress).put(Const.User.BGM,list[banner_landscape.currentItem].audioFile).apply() |
| | | //存音量 |
| | | 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("保存成功") |
| | | player.startPlayMusic(this,list[banner_landscape.currentItem].audioFile) |
| | | startActivity<MainActivity>() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_GUIDE_AUDIO)) |
| | | } |
| | | } |
| | | |
| | |
| | | banner_landscape.setBannerGalleryEffect(110,12,0.85f) |
| | | player.setOnAudioStatusUpdateListener(this) |
| | | sb_voice.progress = SPUtils.instance().getInt(Const.User.VOLUME,50) |
| | | player.setVolume(sb_voice.progress.toFloat()/100) |
| | | getData() |
| | | } |
| | | |
| | |
| | | cardBannerAdapter.playPosition = -1 |
| | | cardBannerAdapter.notifyItemChanged(p) |
| | | } |
| | | |
| | | override fun onGetDuration(duration: Int) { |
| | | } |
| | | |
| | | override fun onPause() { |
| | | super.onPause() |
| | | player.stopPlayMusic() |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui |
| | | |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import com.sinata.xqmuse.R |
| | | |
| | | class FakeFragment:BaseFragment() { |
| | | override fun contentViewId() = R.layout.fake_fragment |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | |
| | | } |
| | | } |
| | |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.JkApplication |
| | | import com.sinata.xqmuse.dialog.TipDialog |
| | | import com.sinata.xqmuse.network.Apis |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.login.LoginActivity |
| | |
| | | tvCancel.text = "确认" |
| | | } |
| | | }.start() |
| | | }else if (title == "爱心助力榜单"){ |
| | | titleBar.addRightButton("我的助力",onClickListener = View.OnClickListener { |
| | | startActivity<H5Activity>("title" to "推荐名单","url" to intent.getStringExtra("pushList"),"type" to 0) |
| | | }) |
| | | }else if (mustRead){ |
| | | clBottom1.visible() |
| | | titleBar.leftView.gone() |
| | |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.activity.BaseActivity |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import com.amap.api.location.AMapLocationClient |
| | | import com.amap.apis.utils.core.api.AMapUtilCoreApi |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.JkApplication |
| | |
| | | ) |
| | | super.onCreate(savedInstanceState) |
| | | setContentView(R.layout.activity_splash) |
| | | // getImg() |
| | | val data = intent.data |
| | | if (data!=null){ |
| | | val url = data.toString() |
| | | Log.e("mmp","路径:${url}") |
| | | if (url.startsWith("jkfitness://jkcyl.cn?code=")){ |
| | | code = url.substring(url.indexOf("=")+1) |
| | | Log.e("mmp","解析参数:code=${code}") |
| | | } |
| | | } |
| | | getImg() |
| | | // val data = intent.data |
| | | // if (data!=null){ |
| | | // val url = data.toString() |
| | | // Log.e("mmp","路径:${url}") |
| | | // if (url.startsWith("jkfitness://jkcyl.cn?code=")){ |
| | | // code = url.substring(url.indexOf("=")+1) |
| | | // Log.e("mmp","解析参数:code=${code}") |
| | | // } |
| | | // } |
| | | AMapLocationClient.updatePrivacyShow(this,true,true) |
| | | AMapLocationClient.updatePrivacyAgree(this,true) |
| | | AMapUtilCoreApi.setCollectInfoEnable(false) |
| | | if (SPUtils.instance().getBoolean(Const.User.IS_AGREE)){ |
| | | startNext() |
| | | }else{ |
| | |
| | | |
| | | private fun getImg() { |
| | | val map = hashMapOf<String, Any>() |
| | | map["type"] = 1 |
| | | HttpManager.queryString(Apis.querySystemImg,map).request(this){ _, data-> |
| | | iv_img.setImageURI(data?:"") |
| | | } |
| | |
| | | return mm.replaceAll("") |
| | | } |
| | | |
| | | |
| | | /*** |
| | | * 判断是否第一次启动 |
| | | */ |
| | |
| | | (application as JkApplication).initSdk() |
| | | if (SPUtils.instance().getBoolean(Const.FIRST_LAUNCH,true)){ //第一次启动显示引导页 |
| | | SPUtils.instance().put(Const.FIRST_LAUNCH,false).apply() |
| | | startActivity<GuideActivity>() |
| | | startActivity<MainActivity>("code" to code,"isFirst" to true) |
| | | finish() |
| | | }else{ |
| | | gotoMainOrLogin() |
| | | } |
| | |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.extention.clickDelay |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import com.sinata.xqmuse.utils.pay.PayListener |
| | | import kotlinx.android.synthetic.main.activity_buy_course.* |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | |
| | | class BuyCourseActivity:TransparentStatusBarActivity() { |
| | | class BuyCourseActivity:TransparentStatusBarActivity(),PayListener { |
| | | override fun setContentView() = R.layout.activity_buy_course |
| | | |
| | | private val isSend by lazy { intent.getBooleanExtra("isSend",false) } |
| | | private val fromDetail by lazy { intent.getBooleanExtra("fromDetail",true) } |
| | | private val data by lazy { intent.getParcelableExtra<ConfirmOrder>("data") } |
| | | private var receiveId:String? = null |
| | | |
| | | override fun initClick() { |
| | | tv_search.setOnClickListener { |
| | |
| | | toast("手机号输入有误") |
| | | }else{ |
| | | HttpManager.getUserByPhone(phone).request(this){_,data-> |
| | | receiveId = data?.id |
| | | iv_avatar.setImageURI(data?.avatar) |
| | | tv_name.text = data?.nickname |
| | | tv_phone.text = data?.cellPhone |
| | |
| | | buyRuleDialog.showAllowingStateLoss(supportFragmentManager,"rule") |
| | | } |
| | | } |
| | | |
| | | tv_action.setOnClickListener { |
| | | if (cb_rule.isChecked){ |
| | | if (rb_ali.isChecked){ |
| | | pay(2) |
| | | }else if (rb_wx.isChecked){ |
| | | pay(1) |
| | | } else if (rb_balance.isChecked&&((data?.balance?:"0.0").toDouble()>(data?.generalPrice?:"0.0").toDouble())){ |
| | | payBalance() |
| | | }else{ |
| | | |
| | | } |
| | | }else |
| | | toast("请阅读并同意《购买协议》") |
| | | } |
| | | } |
| | | |
| | | private fun pay(way:Int) { |
| | | tv_action.isEnabled = false |
| | | showDialog() |
| | | HttpManager.placeOrder(2,way,2,null,receiveId,data?.id?:"",null).request(this,success = {_,data-> |
| | | onPaySuccess() |
| | | |
| | | }){_,_-> |
| | | tv_action.isEnabled = true |
| | | } |
| | | } |
| | | |
| | | private fun payBalance() { |
| | | tv_action.isEnabled = false |
| | | showDialog() |
| | | HttpManager.gvieCourse(data?.id?:"",2,receiveId).request(this,success = {_,_-> |
| | | onPaySuccess() |
| | | }){_,_-> |
| | | tv_action.isEnabled = true |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | |
| | | } |
| | | } |
| | | |
| | | override fun onPaySuccess() { |
| | | setResult(RESULT_OK) |
| | | startActivity<PaySuccessActivity>("data" to data,"fromDetail" to fromDetail) |
| | | finish() |
| | | } |
| | | |
| | | override fun onPayCancel() { |
| | | } |
| | | |
| | | override fun onPayError(msg: String) { |
| | | } |
| | | } |
| | |
| | | package com.sinata.xqmuse.ui.course |
| | | |
| | | import android.content.Intent |
| | | import android.os.CountDownTimer |
| | | import android.util.TypedValue |
| | | import android.webkit.WebChromeClient |
| | |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import cn.sinata.xldutils.visible |
| | | import com.google.android.material.appbar.AppBarLayout |
| | | import com.share.utils.ShareUtils |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.SendConfirmDialog |
| | | import com.sinata.xqmuse.dialog.ShareDialog |
| | | import com.sinata.xqmuse.network.Apis |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.Chapter |
| | | import com.sinata.xqmuse.network.entity.CourseBean |
| | |
| | | import com.sinata.xqmuse.ui.course.adapter.CourseGridAdapter |
| | | import com.sinata.xqmuse.utils.AppBarStateChangeListener |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import kotlinx.android.synthetic.main.activity_buy_course.* |
| | | import com.umeng.socialize.bean.SHARE_MEDIA |
| | | import kotlinx.android.synthetic.main.activity_course_deatil.* |
| | | import kotlinx.android.synthetic.main.activity_course_deatil.iv_cover |
| | | import kotlinx.android.synthetic.main.activity_course_deatil.tv_1 |
| | | import kotlinx.android.synthetic.main.activity_course_deatil.tv_action |
| | | import kotlinx.android.synthetic.main.activity_course_deatil.tv_count |
| | | import kotlinx.android.synthetic.main.activity_course_deatil.tv_name |
| | | import kotlinx.android.synthetic.main.activity_course_deatil.tv_teacher |
| | | import org.jetbrains.anko.imageResource |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.textColorResource |
| | | import org.jetbrains.anko.* |
| | | |
| | | class CourseDetailActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_course_deatil |
| | |
| | | } |
| | | |
| | | tv_action.setOnClickListener { |
| | | getData(false) |
| | | if (tv_action.text == "立即学习"){ |
| | | if (data?.list?.isNullOrEmpty() == true) |
| | | toast("章节有误") |
| | | else |
| | | startActivity<StudyActivity>("id" to data?.list?.firstOrNull()?.id) |
| | | } else |
| | | getData(false) |
| | | } |
| | | iv_collect.setOnClickListener { |
| | | HttpManager.collectCourse(data?.id?:"").request(this){_,_-> |
| | | data?.recommend = if (data?.recommend == 1) 2 else 1 |
| | | iv_collect.setImageResource(if (data?.recommend == 1) R.mipmap.collected else R.mipmap.uncollect) |
| | | toast(if (data?.recommend == 1) "收藏成功" else "已取消收藏") |
| | | } |
| | | } |
| | | iv_share.setOnClickListener { |
| | | val shareDialog = ShareDialog() |
| | | shareDialog.callback = object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | |
| | | if (rst == "wx"){ |
| | | ShareUtils.share(this@CourseDetailActivity, |
| | | SHARE_MEDIA.WEIXIN,data?.courseTitle,"分享你一个课程", |
| | | Apis.SHARE_COURSE.format(data?.id),null,"") |
| | | }else{ |
| | | ShareUtils.share(this@CourseDetailActivity, |
| | | SHARE_MEDIA.WEIXIN_CIRCLE,data?.courseTitle,"分享你一个课程", |
| | | Apis.SHARE_COURSE.format(data?.id),null,"") |
| | | } |
| | | } |
| | | } |
| | | shareDialog.showAllowingStateLoss(supportFragmentManager,"share") |
| | |
| | | } |
| | | } |
| | | chapterAdapter.setOnItemClickListener { view, position -> |
| | | getData(false) |
| | | if (tv_action.text == "立即学习") |
| | | startActivity<StudyActivity>("id" to data?.list?.get(position)?.id,"index" to position) |
| | | else |
| | | getData(false) |
| | | } |
| | | courseAdapter.setOnItemClickListener { view, position -> |
| | | showDialog() |
| | | HttpManager.getPayCourseInfoById(courseList[position].id?:"").request(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(this) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | data?.apply { |
| | | iv_collect.setImageResource(if (data?.recommend == 1) R.mipmap.collected else R.mipmap.uncollect) |
| | | iv_cover.setImageURI(detailUrl) |
| | | iv_cover.setImageURI(coverUrl) |
| | | tv_name.text = courseTitle |
| | | tv_teacher.text = "导师 ${tutor}" |
| | | tv_count.text = "${count}人已加入学习" |
| | |
| | | chapterAdapter.notifyDataSetChanged() |
| | | courseList.addAll(list2) |
| | | courseAdapter.notifyDataSetChanged() |
| | | |
| | | if (chargeType == 1||(courseType == 2&&isVip == 1)){ |
| | | if (chargeType == 3) |
| | | tv_send.visible() |
| | | if (chargeType == 1||isBuy == 1||(chargeType == 2&&isVip == 1)){ |
| | | tv_action.text = "立即学习" |
| | | }else{ |
| | | val s = "¥ %s 立即购买".format(generalPrice) |
| | | val s = "¥ %s 立即购买".format(generalPrice!!) |
| | | tv_action.text = SpanBuilder(s).size(0,1,12).size(2,generalPrice.length+2,21).build() |
| | | } |
| | | } |
| | |
| | | } |
| | | }) |
| | | }else |
| | | startActivity<BuyCourseActivity>("isSend" to isSend,"data" to data) |
| | | startActivityForResult<BuyCourseActivity>(1,"isSend" to isSend,"data" to data) |
| | | } |
| | | } |
| | | |
| | | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
| | | super.onActivityResult(requestCode, resultCode, data) |
| | | if (resultCode == RESULT_OK){ |
| | | this.data?.isBuy = 1 |
| | | tv_action.text = "立即学习" |
| | | } |
| | | } |
| | | } |
| | |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.BGMSettingActivity |
| | | import com.sinata.xqmuse.ui.home.SearchActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.fragment_course.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | import org.jetbrains.anko.textColorResource |
| | | |
| | | class CourseFragment : BaseFragment() { |
| | |
| | | override fun onPageScrollStateChanged(state: Int) { |
| | | } |
| | | }) |
| | | |
| | | iv_voice.setOnClickListener { |
| | | startActivity<BGMSettingActivity>() |
| | | } |
| | | iv_search.setOnClickListener { |
| | | startActivity<SearchActivity>("isCourse" to true) |
| | | } |
| | | } |
| | | |
| | | private fun checkTab(i: Int){ |
| | |
| | | cb_teacher.textColorResource = R.color.textColor99 |
| | | cb_teacher.setTextSize(TypedValue.COMPLEX_UNIT_SP,16f) |
| | | iv_tab_2.gone() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.PAUSE_TEACHER_VIDEO)) |
| | | }else{ |
| | | cb_teacher.textColorResource = R.color.textColor |
| | | cb_teacher.setTextSize(TypedValue.COMPLEX_UNIT_SP,21f) |
New file |
| | |
| | | package com.sinata.xqmuse.ui.course |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.CourseBean |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.course.adapter.CourseGridAdapter |
| | | import kotlinx.android.synthetic.main.activity_search_result.* |
| | | import org.jetbrains.anko.toast |
| | | |
| | | class CourseSearchResultActivity:TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_search_result |
| | | |
| | | private var key = "" |
| | | private var page = 1 |
| | | private val list = arrayListOf<CourseBean>() |
| | | private val adapter = CourseGridAdapter(list) |
| | | |
| | | override fun initClick() { |
| | | tv_search.setOnClickListener { |
| | | val s = et_search.text.toString() |
| | | if (s.isNullOrEmpty()){ |
| | | toast("请输入搜索内容") |
| | | }else{ |
| | | key = s |
| | | refreshLayout.autoRefresh() |
| | | } |
| | | } |
| | | |
| | | adapter.setOnItemClickListener { view, position -> |
| | | showDialog() |
| | | HttpManager.getPayCourseInfoById(list[position].id).request(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(this) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | key = intent.getStringExtra("key")?:"" |
| | | et_search.setText(key) |
| | | rv_result.layoutManager = GridLayoutManager(this,2) |
| | | rv_result.adapter = adapter |
| | | refreshLayout.setOnRefreshListener { |
| | | page = 1 |
| | | getData() |
| | | } |
| | | refreshLayout.setOnLoadMoreListener { |
| | | page++ |
| | | getData() |
| | | } |
| | | getData() |
| | | } |
| | | |
| | | private fun getData(){ |
| | | HttpManager.queryCourseList(page,null,key).request(this,success = {_,data-> |
| | | if (page == 1) |
| | | list.clear() |
| | | list.addAll(data?.list?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | tv_empty.gone() |
| | | if (list.isEmpty()){ |
| | | refreshLayout.finishRefreshWithNoMoreData() |
| | | tv_empty.visible() |
| | | } else if (data?.list.isNullOrEmpty()) |
| | | refreshLayout.finishLoadMoreWithNoMoreData() |
| | | else if (page == 1) |
| | | refreshLayout.finishRefresh() |
| | | else |
| | | refreshLayout.finishLoadMore() |
| | | }){_,_-> |
| | | if (page == 1) |
| | | refreshLayout.finishRefresh(false) |
| | | else |
| | | refreshLayout.finishLoadMore(false) |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.course |
| | | |
| | | import androidx.fragment.app.Fragment |
| | | import cn.sinata.xldutils.gone |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_help_center.* |
| | | |
| | | class HelpCenterActivity:TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_help_center |
| | | |
| | | override fun initClick() { |
| | | iv_back.setOnClickListener { finish() } |
| | | } |
| | | |
| | | override fun initView() { |
| | | titleBar.gone() |
| | | val frags = arrayListOf<Fragment>() |
| | | frags.add(HelpFragment.newInstance(HelpFragment.TYPE_ACCOUNT)) |
| | | frags.add(HelpFragment.newInstance(HelpFragment.TYPE_PHONE)) |
| | | frags.add(HelpFragment.newInstance(HelpFragment.TYPE_WX)) |
| | | tab_bar.setViewPager(view_pager, arrayOf("切换账号","改绑手机号","改绑微信"),this,frags) |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.course |
| | | |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.login.LoginActivity |
| | | import com.sinata.xqmuse.ui.mine.BindActivity |
| | | import kotlinx.android.synthetic.main.fragment_help.* |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | |
| | | class HelpFragment : BaseFragment() { |
| | | override fun contentViewId() = R.layout.fragment_help |
| | | |
| | | private val type by lazy { arguments?.getInt("type") } |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | when(type){ |
| | | TYPE_ACCOUNT->{ |
| | | tv_msg.text = "如你当前登录心泉·疗愈的手机号码不是购买课程时填写的手机号码,请点击下方按钮,使用购买课程的手机号码登录即可。" |
| | | tv_action.text = "换个手机号登录" |
| | | } |
| | | TYPE_PHONE->{ |
| | | tv_msg.text = "如你希望变更心泉·疗愈的手机号码,请点击下方按钮,根据页面提示录入新的手机号码" |
| | | tv_action.text = "前往改绑手机号" |
| | | } |
| | | TYPE_WX->{ |
| | | tv_msg.text = "如你希望变更心泉·疗愈的微信号,请点击下方按钮,根据页面提示授权登录其他微信号" |
| | | tv_action.text = "前往改绑微信号" |
| | | } |
| | | } |
| | | |
| | | tv_action.setOnClickListener { |
| | | when(type){ |
| | | TYPE_ACCOUNT->{ |
| | | startActivity<LoginActivity>() |
| | | } |
| | | TYPE_PHONE->{ |
| | | startActivity<BindActivity>() |
| | | } |
| | | TYPE_WX->{ |
| | | startActivity<BindActivity>() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | companion object{ |
| | | const val TYPE_ACCOUNT = 1 |
| | | const val TYPE_PHONE = 2 |
| | | const val TYPE_WX = 3 |
| | | fun newInstance(type: Int): HelpFragment { |
| | | val fragment = HelpFragment() |
| | | fragment.arguments = bundleOf("type" to type) |
| | | return fragment |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.sinata.xqmuse.ui.course |
| | | |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.* |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.course.adapter.FilterAdapter |
| | | import com.sinata.xqmuse.ui.course.adapter.CourseGridAdapter |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.extention.clickDelay |
| | | import kotlinx.android.synthetic.main.activity_my_course.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.greenrobot.eventbus.Subscribe |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class MyCourseActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_my_course |
| | | |
| | | private var page = 1 |
| | | var search:String? = null //搜索 |
| | | private val filterList = arrayListOf<Filter>() |
| | | private val filterAdapter = FilterAdapter(filterList,true) |
| | | private val myList = arrayListOf<CourseBean>() |
| | | private val myAdapter = CourseGridAdapter(myList) |
| | | private val freeList = arrayListOf<CourseBean>() |
| | | private val freeAdapter = CourseGridAdapter(freeList) |
| | | |
| | | |
| | | override fun initClick() { |
| | | tv_search.clickDelay { |
| | | val s = et_search.text.toString() |
| | | search = if (s.isNullOrEmpty()) null else s |
| | | hideInputMethod() |
| | | refreshLayout.resetNoMoreData() |
| | | page = 1 |
| | | getData() |
| | | myAdapter.setOnItemClickListener { view, position -> |
| | | showDialog() |
| | | HttpManager.getPayCourseInfoById(myList[position].businessId?:"").request(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(this) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | |
| | | |
| | | freeAdapter.setOnItemClickListener { view, position -> |
| | | showDialog() |
| | | HttpManager.getPayCourseInfoById(freeList[position].businessId?:"").request(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(this) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | tv_ask.setOnClickListener { |
| | | startActivity<HelpCenterActivity>() |
| | | } |
| | | tv_action.setOnClickListener { |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.SWITCH_COURSE)) |
| | | finish() |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | EventBus.getDefault().register(this) |
| | | rv_filter.layoutManager = LinearLayoutManager(this) |
| | | rv_filter.adapter = filterAdapter |
| | | rv_course.layoutManager = LinearLayoutManager(this) |
| | | rv_free.layoutManager = GridLayoutManager(this,2) |
| | | rv_free.adapter = freeAdapter |
| | | rv_my.layoutManager = GridLayoutManager(this,2) |
| | | rv_my.adapter = myAdapter |
| | | |
| | | refreshLayout.setOnRefreshListener { |
| | | val s = et_search.text.toString() |
| | | search = if (s.isNullOrEmpty()) null else s |
| | | page = 1 |
| | | getData() |
| | | } |
| | | refreshLayout.setOnLoadMoreListener { |
| | | page++ |
| | | getData() |
| | | } |
| | | getFilter() |
| | | page = 1 |
| | | refreshLayout.setEnableLoadMore(false) |
| | | getData() |
| | | |
| | | } |
| | | |
| | | private fun getFilter() { |
| | | HttpManager.getList().request(this){_, data-> |
| | | filterList.clear() |
| | | filterList.add(Filter("类型:",data?.fitnessType?: arrayListOf())) |
| | | filterList.add(Filter("部位:",data?.fitnessPosition?: arrayListOf())) |
| | | filterList.add(Filter("难度:",data?.difficulty?: arrayListOf())) |
| | | filterList.add(Filter("时长:",data?.time?: arrayListOf())) |
| | | filterAdapter.notifyDataSetChanged() |
| | | } |
| | | } |
| | | |
| | | private fun getData(){ |
| | | val diff = filterList.filter { it.name == "难度:" }.firstOrNull()?.list?.filter { it.checked }?.joinToString (","){ it.id.toString() } |
| | | val position = filterList.filter { it.name == "部位:" }.firstOrNull()?.list?.filter { it.checked }?.joinToString (","){ it.name } |
| | | val times = filterList.filter { it.name == "时长:" }.firstOrNull()?.list?.filter { it.checked }?.joinToString (","){ it.id.toString() } |
| | | val types = filterList.filter { it.name == "类型:" }.firstOrNull()?.list?.filter { it.checked }?.joinToString (","){ it.id.toString() } |
| | | |
| | | } |
| | | |
| | | @Subscribe |
| | | fun refresh(e: EmptyEvent){ |
| | | if (e.code == Const.EventCode.REFRESH_MY_COURSE){ |
| | | refreshLayout.resetNoMoreData() |
| | | page = 1 |
| | | getData() |
| | | HttpManager.studyPage().request(this,success = {_,data-> |
| | | refreshLayout.finishRefresh(true) |
| | | myList.clear() |
| | | myList.addAll(data?.courseList?: arrayListOf()) |
| | | freeList.clear() |
| | | freeList.addAll(data?.freeCourseList?: arrayListOf()) |
| | | myAdapter.notifyDataSetChanged() |
| | | freeAdapter.notifyDataSetChanged() |
| | | if (myList.isNullOrEmpty()){ |
| | | tv_empty.visible() |
| | | tv_action.visible() |
| | | }else{ |
| | | tv_empty.gone() |
| | | tv_action.gone() |
| | | } |
| | | }){_,_-> |
| | | refreshLayout.finishRefresh(false) |
| | | } |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | | super.onDestroy() |
| | | EventBus.getDefault().unregister(this) |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.sinata.xldutils.utils.isVideo |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import cn.sinata.xldutils.visible |
| | | import com.share.utils.ShareUtils |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.QrcodeDialog |
| | | import com.sinata.xqmuse.dialog.ShareDialog |
| | | import com.sinata.xqmuse.network.Apis |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.CourseDetail |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.glide.GlideUtil |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import com.umeng.socialize.bean.SHARE_MEDIA |
| | | import kotlinx.android.synthetic.main.activity_offline_course.* |
| | | import xyz.doikki.videocontroller.StandardVideoController |
| | | import xyz.doikki.videoplayer.player.BaseVideoView.* |
| | |
| | | val shareDialog = ShareDialog() |
| | | shareDialog.callback = object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | |
| | | if (rst == "wx"){ |
| | | ShareUtils.share(this@OfflineCourseActivity, |
| | | SHARE_MEDIA.WEIXIN,data?.courseTitle,"分享你一个课程", |
| | | Apis.SHARE_OFFLINE.format(data?.id),null,"") |
| | | }else{ |
| | | ShareUtils.share(this@OfflineCourseActivity, |
| | | SHARE_MEDIA.WEIXIN_CIRCLE,data?.courseTitle,"分享你一个课程", |
| | | Apis.SHARE_OFFLINE.format(data?.id),null,"") |
| | | } |
| | | } |
| | | } |
| | | shareDialog.showAllowingStateLoss(supportFragmentManager,"share") |
| | |
| | | } |
| | | tv_name.text = courseTitle |
| | | tv_teacher.text = "导师 ${tutor}" |
| | | tv_address.text = address |
| | | tv_address.text = address?:"" |
| | | val sHead = |
| | | "<html><head><meta name=\"viewport\" content=\"width=device-width, " + "initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes\" />" + "<style>img{max-width:100% !important;height:auto !important;}</style>" + "<style>body{max-width:100% !important;}</style>" + "</head><body>" |
| | | webView!!.loadDataWithBaseURL( |
| | |
| | | when(playState){ |
| | | STATE_PLAYING->{ |
| | | iv_cover.gone() |
| | | ivPlay.gone() |
| | | } |
| | | STATE_PLAYBACK_COMPLETED->{ |
| | | iv_cover.visible() |
New file |
| | |
| | | package com.sinata.xqmuse.ui.course |
| | | |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.ConfirmOrder |
| | | import com.sinata.xqmuse.network.entity.CourseBean |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.network.requestByF |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.course.adapter.CourseGridAdapter |
| | | import kotlinx.android.synthetic.main.activity_pay_success.* |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class PaySuccessActivity:TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_pay_success |
| | | |
| | | private val data by lazy { intent.getParcelableExtra<ConfirmOrder>("data") } |
| | | private val fromDetail by lazy { intent.getBooleanExtra("fromDetail",true) } //从详情支付过来,返回的时候直接回到详情刷新状态,防止创建多个课程详情页 |
| | | private val isAudio by lazy { intent.getBooleanExtra("isAudio",false) } //true 冥想音频支付 |
| | | private val list = arrayListOf<CourseBean>() |
| | | private val courseAdapter by lazy { CourseGridAdapter(list,isAudio) } |
| | | |
| | | override fun initClick() { |
| | | tv_cancel.setOnClickListener { |
| | | startActivity<MainActivity>() |
| | | } |
| | | tv_ok.setOnClickListener { |
| | | if (isAudio){ |
| | | showDialog() |
| | | HttpManager.getMeditationDetails(data?.id?:"").request(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(this) |
| | | finish() |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | }else if (fromDetail) |
| | | finish() |
| | | else{ |
| | | showDialog() |
| | | HttpManager.getPayCourseInfoById(data?.id?:"").request(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(this) |
| | | finish() |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | } |
| | | courseAdapter.setOnItemClickListener { view, position -> |
| | | if (isAudio){ |
| | | showDialog() |
| | | HttpManager.getMeditationDetails(list[position].id).request(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(this) |
| | | finish() |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | }else{ |
| | | showDialog() |
| | | HttpManager.getPayCourseInfoById(list[position].id).request(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(this) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | rv_push.layoutManager = GridLayoutManager(this,2) |
| | | rv_push.adapter = courseAdapter |
| | | val content = "¥%s".format(data?.generalPrice) |
| | | tv_money.text = SpanBuilder(content).size(0,1,16).build() |
| | | getSuccessData() |
| | | if (isAudio){ |
| | | tv_ok.text = "查看疗愈" |
| | | } |
| | | } |
| | | |
| | | private fun getSuccessData(){ |
| | | HttpManager.successOrder(data?.id?:"",isAudio).request(this){_,data-> |
| | | list.clear() |
| | | list.addAll(data?: arrayListOf()) |
| | | courseAdapter.notifyDataSetChanged() |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | topMenuAdapter.setOnItemClickListener { view, position -> |
| | | startActivity<TypeCourserActivity>("types" to topMenu,"index" to position) |
| | | } |
| | | banner.setOnBannerListener { data, position -> |
| | | val banner = bannerImg[position] |
| | | jumpCourse(banner.courseId) |
| | | } |
| | | adapter.setOnItemClickListener { view, position -> |
| | | jumpCourse(list[position].id) |
| | | } |
| | | } |
| | | |
| | | private fun jumpCourse(id:String){ |
| | | if (id.isNullOrEmpty()) |
| | | return |
| | | showDialog() |
| | | HttpManager.getPayCourseInfoById(id).requestByF(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(requireContext()) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | |
| | | private fun getBanner(){ |
New file |
| | |
| | | package com.sinata.xqmuse.ui.course |
| | | |
| | | import android.util.Log |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.Chapter |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.course.adapter.ChapterAdapter |
| | | import com.sinata.xqmuse.utils.glide.GlideUtil |
| | | import kotlinx.android.synthetic.main.activity_study.* |
| | | import org.jetbrains.anko.toast |
| | | import xyz.doikki.videocontroller.StandardVideoController |
| | | import xyz.doikki.videoplayer.player.BaseVideoView |
| | | |
| | | class StudyActivity : TransparentStatusBarActivity(), BaseVideoView.OnStateChangeListener { |
| | | override fun setContentView() = R.layout.activity_study |
| | | |
| | | private val id by lazy { intent.getStringExtra("id") } //章节id |
| | | private val chapters = arrayListOf<Chapter>() |
| | | private val adapter = ChapterAdapter(chapters) |
| | | private var seekTo = 0 //续播进度 |
| | | |
| | | override fun initClick() { |
| | | iv_back.setOnClickListener { finish() } |
| | | |
| | | ivPlay.setOnClickListener { |
| | | ivPlay.gone() |
| | | mVideoView.start() |
| | | } |
| | | |
| | | adapter.setOnItemClickListener { view, position -> |
| | | saveProgress(2,(mVideoView.currentPosition/1000).toInt()) |
| | | adapter.current = position |
| | | startPlay() |
| | | adapter.notifyDataSetChanged() |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | titleBar.gone() |
| | | adapter.current = intent.getIntExtra("index",-1) |
| | | mVideoView.setOnStateChangeListener(this) |
| | | val controller = StandardVideoController(this) |
| | | controller.addDefaultControlComponent("课程详情", false) |
| | | mVideoView.setVideoController(controller) //设置控制器 |
| | | rv_chapter.layoutManager = LinearLayoutManager(this) |
| | | rv_chapter.adapter = adapter |
| | | getData() |
| | | } |
| | | |
| | | private fun getData(){ |
| | | HttpManager.studyPageByChapterId(id?:"").request(this){_,data-> |
| | | chapters.clear() |
| | | chapters.addAll(data?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | if (adapter.current == -1){ |
| | | val indexOf = chapters.indexOf(chapters.firstOrNull { it.isOver == 1 }) |
| | | adapter.current = if (indexOf == chapters.lastIndex) 0 else indexOf+1 |
| | | } |
| | | Log.e("MMP","续接章节:{${adapter.current}}") |
| | | startPlay() |
| | | } |
| | | } |
| | | |
| | | private fun startPlay() { |
| | | mVideoView.release() |
| | | mVideoView.setUrl(chapters[adapter.current].videoUrl) //设置视频地址 |
| | | GlideUtil.load(this, chapters[adapter.current].videoUrl, iv_cover, 0) |
| | | mVideoView.start() |
| | | seekTo = chapters[adapter.current].secondLook |
| | | } |
| | | |
| | | override fun onPlayerStateChanged(playerState: Int) { |
| | | |
| | | } |
| | | |
| | | override fun onPlayStateChanged(playState: Int) { |
| | | when(playState){ |
| | | BaseVideoView.STATE_PLAYING ->{ |
| | | iv_cover.gone() |
| | | ivPlay.gone() |
| | | if (seekTo!=0){ |
| | | mVideoView.seekTo(1000L*seekTo) |
| | | seekTo = 0 |
| | | } |
| | | } |
| | | BaseVideoView.STATE_PAUSED ->{ |
| | | saveProgress(2,(mVideoView.currentPosition/1000).toInt()) |
| | | } |
| | | BaseVideoView.STATE_PLAYBACK_COMPLETED ->{ |
| | | chapters[adapter.current].isOver = 1 |
| | | saveProgress(1,0) |
| | | if (adapter.current == chapters.lastIndex){ |
| | | iv_cover.visible() |
| | | ivPlay.visible() |
| | | }else{ |
| | | adapter.current++ |
| | | adapter.notifyDataSetChanged() |
| | | startPlay() |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | private fun saveProgress(isOver:Int,second:Int){ |
| | | chapters[adapter.current].secondLook = second |
| | | HttpManager.saveCourseStudyHistory(chapters[adapter.current].id,isOver,second).request(this,false,success = {_,_-> |
| | | |
| | | }){_,_-> |
| | | toast("记录失败") |
| | | } |
| | | } |
| | | |
| | | 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.webkit.WebSettings |
| | | import android.webkit.WebViewClient |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.CourseBean |
| | | import com.sinata.xqmuse.network.requestByF |
| | | import com.sinata.xqmuse.ui.course.adapter.CourseGridAdapter |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.fragment_teacher.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.greenrobot.eventbus.Subscribe |
| | | import xyz.doikki.videocontroller.StandardVideoController |
| | | |
| | | class TeacherFragment : BaseFragment() { |
| | | override fun contentViewId() = R.layout.fragment_teacher |
| | |
| | | private val adapter = CourseGridAdapter(list) |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | val controller = StandardVideoController(requireContext()) |
| | | controller.addDefaultControlComponent("", false) |
| | | mVideoView.setVideoController(controller) //设置控制器 |
| | | |
| | | val settings = webView.settings |
| | | settings.javaScriptEnabled = true |
| | | settings.javaScriptCanOpenWindowsAutomatically = true |
| | |
| | | rv_course.layoutManager = GridLayoutManager(requireContext(),2) |
| | | rv_course.adapter = adapter |
| | | getData() |
| | | adapter.setOnItemClickListener { view, position -> |
| | | showDialog() |
| | | HttpManager.getPayCourseInfoById(list[position].id).requestByF(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(requireContext()) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | iv_play_teacher.setOnClickListener { |
| | | iv_cover.gone() |
| | | iv_play_teacher.gone() |
| | | mVideoView.start() |
| | | } |
| | | EventBus.getDefault().register(this) |
| | | } |
| | | |
| | | private fun getData(){ |
| | | HttpManager.getCoursePageList().requestByF(this){_,data-> |
| | | (requireActivity() as MainActivity).teacherVideoView = mVideoView |
| | | mVideoView.setUrl(data?.videoUrl) |
| | | mVideoView.start() |
| | | iv_cover.setImageURI(data?.coverUrl) |
| | | iv_play_teacher.visible() |
| | | val sHead = |
| | | "<html><head><meta name=\"viewport\" content=\"width=device-width, " + "initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes\" />" + "<style>img{max-width:100% !important;height:auto !important;}</style>" + "<style>body{max-width:100% !important;}</style>" + "</head><body>" |
| | | webView!!.loadDataWithBaseURL(null, sHead + data?.tutorIntroduction, "text/html", "utf-8", null) |
| | |
| | | adapter.notifyDataSetChanged() |
| | | } |
| | | } |
| | | |
| | | @Subscribe |
| | | fun pause(e:EmptyEvent){ |
| | | if (e.code == Const.EventCode.PAUSE_TEACHER_VIDEO) |
| | | mVideoView.pause() |
| | | } |
| | | |
| | | override fun onPause() { |
| | | super.onPause() |
| | | mVideoView.pause() |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | | super.onDestroy() |
| | | EventBus.getDefault().unregister(this) |
| | | } |
| | | } |
| | |
| | | package com.sinata.xqmuse.ui.course.adapter |
| | | |
| | | import android.widget.TextView |
| | | import cn.sinata.xldutils.adapter.HFRecyclerAdapter |
| | | import cn.sinata.xldutils.adapter.util.ViewHolder |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.entity.Chapter |
| | | import org.jetbrains.anko.backgroundResource |
| | | import java.util.ArrayList |
| | | |
| | | class ChapterAdapter(chapterList: ArrayList<Chapter>):HFRecyclerAdapter<Chapter>(chapterList, R.layout.item_chapter) { |
| | | var current = -1 |
| | | override fun onBind(holder: ViewHolder, position: Int, data: Chapter) { |
| | | holder.setText(R.id.tv_name,data.chapterTitle) |
| | | holder.setText(R.id.tv_time,"%02d:%02d".format(data.duration/60,data.duration%60)) |
| | | holder.setText(R.id.tv_count,data.realLearnedNum.toString()) |
| | | holder.setText(R.id.tv_sort,(position+1).toString()) |
| | | if (current != -1){ //播放状态 |
| | | val tvAction = holder.bind<TextView>(R.id.tv_action) |
| | | if (position == current){ |
| | | tvAction.text = "正在学习" |
| | | tvAction.backgroundResource = R.drawable.bg_brown_14 |
| | | }else if (data.isOver == 1){ |
| | | tvAction.text = "已学习" |
| | | tvAction.backgroundResource = R.drawable.bg_grey_14 |
| | | }else{ |
| | | tvAction.text = "去学习" |
| | | tvAction.backgroundResource = R.drawable.bg_green_14 |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.sinata.xqmuse.network.entity.CourseBean |
| | | import java.util.ArrayList |
| | | |
| | | class CourseGridAdapter(list: ArrayList<CourseBean>):HFRecyclerAdapter<CourseBean>(list, R.layout.item_course_grid) { |
| | | class CourseGridAdapter(list: ArrayList<CourseBean>,val isVoice:Boolean = false):HFRecyclerAdapter<CourseBean>(list, R.layout.item_course_grid) { |
| | | var isOrder:Boolean = false |
| | | override fun onBind(holder: ViewHolder, position: Int, data: CourseBean) { |
| | | holder.bind<SimpleDraweeView>(R.id.iv_bg).setImageURI(data.coverUrl) |
| | | holder.setText(R.id.tv_title,data.courseTitle) |
| | | holder.setText(R.id.tv_subtitle,data.briefIntroduction) |
| | | holder.setText(R.id.tv_count,(data.count).toString()) |
| | | holder.bind<SimpleDraweeView>(R.id.iv_bg).setImageURI(if (data.coverUrl.contains(",")) data.coverUrl.split(",").getOrNull(1) else data.coverUrl) |
| | | holder.setText(R.id.tv_title,if (isVoice) data.meditationTitle else data.courseTitle) |
| | | holder.setText(R.id.tv_subtitle,if (isVoice) data.coverDescription else data.description) |
| | | holder.setText(R.id.tv_count,(if (isVoice) data.realLearnedNum else data.count).toString()) |
| | | |
| | | val iv_vip = holder.bind<View>(R.id.iv_vip) |
| | | val tv_price = holder.bind<TextView>(R.id.tv_price) |
| | | when(data?.chargeType){ //1=免费 2=会员免费 3=单独收费 |
| | | val tv_free = holder.bind<View>(R.id.tv_free) |
| | | if (isOrder){ |
| | | val tvPay = holder.bind<TextView>(R.id.tv_not_pay) |
| | | iv_vip.gone() |
| | | tv_price.gone() |
| | | if (data.paymentStatus == 1){ |
| | | tvPay.visible() |
| | | val s = "待支付 | ¥${data.generalPrice}" |
| | | tvPay.text = SpanBuilder(s).size(6,7,7).build() |
| | | }else |
| | | tvPay.gone() |
| | | }else when(data?.chargeType){ //1=免费 2=会员免费 3=单独收费 |
| | | 2->{ |
| | | iv_vip.visible() |
| | | tv_price.gone() |
| | | tv_free.gone() |
| | | } |
| | | 3->{ |
| | | iv_vip.gone() |
| | | tv_price.visible() |
| | | tv_price.text = SpanBuilder("¥${"9.0"}").size(0,1,7).build() |
| | | }else->{ |
| | | iv_vip.gone() |
| | | tv_price.gone() |
| | | } |
| | | tv_free.gone() |
| | | tv_price.text = SpanBuilder("¥${data.generalPrice}").size(0,1,6).build() |
| | | } |
| | | else->{ |
| | | iv_vip.gone() |
| | | tv_price.gone() |
| | | tv_free.visible() |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | override fun onBind(holder: ViewHolder, position: Int, data: CourseBean) { |
| | | holder.bind<SimpleDraweeView>(R.id.iv_bg).setImageURI(data.coverUrl) |
| | | holder.setText(R.id.tv_title,data.courseTitle) |
| | | holder.setText(R.id.tv_subtitle,data.briefIntroduction) |
| | | holder.setText(R.id.tv_subtitle,data.description) |
| | | holder.setText(R.id.tv_count,(data.count).toString()) |
| | | |
| | | val iv_vip = holder.bind<View>(R.id.iv_vip) |
| | |
| | | iv_vip.gone() |
| | | tv_price.visible() |
| | | tv_free.gone() |
| | | tv_price.text = SpanBuilder("¥${"9.0"}").size(0,1,7).build() |
| | | tv_price.text = SpanBuilder("¥${data.generalPrice}").size(0,1,6).build() |
| | | }else->{ |
| | | tv_free.visible() |
| | | tv_offline.gone() |
| | |
| | | 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 |
| | |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.greenrobot.eventbus.Subscribe |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | import org.jetbrains.anko.support.v4.toast |
| | | |
| | | |
| | | class DiscoveryFragment : BaseFragment() { |
| | |
| | | private var page = 1 |
| | | var search: String? = null //搜索 |
| | | |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | EventBus.getDefault().register(this) |
| | | rv_list.layoutManager = GridLayoutManager(requireContext(),2) |
| | | rv_list.layoutManager = GridLayoutManager(requireContext(), 2) |
| | | rv_list.adapter = adapter |
| | | |
| | | adapter.setOnItemClickListener { view, position -> |
| | |
| | | |
| | | private fun checkLocation() { |
| | | val rxPermissions = RxPermissions(requireActivity()) |
| | | if (rxPermissions.isGranted(Manifest.permission.ACCESS_FINE_LOCATION)||SPUtils.instance().getBoolean(Const.User.LOCATION_REFUSED)){ |
| | | if (rxPermissions.isGranted(Manifest.permission.ACCESS_FINE_LOCATION)){ |
| | | requestLocation() |
| | | }else if (SPUtils.instance().getBoolean(Const.User.LOCATION_REFUSED)){ |
| | | refreshLayout.autoRefresh() |
| | | }else{ |
| | | TipDialog.show(childFragmentManager,"为了展示您附近的疗愈馆,我们需要获取该设备的位置权限",object :TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | val subscribe = |
| | | rxPermissions.request(Manifest.permission.ACCESS_FINE_LOCATION).subscribe { |
| | | if (it){ |
| | | //todo 高德定位 |
| | | refreshLayout.autoRefresh() |
| | | }else{ |
| | | SPUtils.instance().put(Const.User.LOCATION_REFUSED,true).apply() |
| | | refreshLayout.autoRefresh() |
| | | } |
| | | } |
| | | compositeDisposable.add(subscribe) |
| | | } |
| | | TipDialog.show( |
| | | childFragmentManager, |
| | | "为了展示您附近的疗愈馆,我们需要获取该设备的位置权限", |
| | | object : TipDialog.OnClickCallback { |
| | | override fun onOk() { |
| | | val subscribe = |
| | | rxPermissions.request(Manifest.permission.ACCESS_FINE_LOCATION) |
| | | .subscribe { |
| | | if (it) { |
| | | requestLocation() |
| | | } else { |
| | | SPUtils.instance().put(Const.User.LOCATION_REFUSED, true) |
| | | .apply() |
| | | refreshLayout.autoRefresh() |
| | | } |
| | | } |
| | | compositeDisposable.add(subscribe) |
| | | } |
| | | |
| | | override fun onCancel() { |
| | | SPUtils.instance().put(Const.User.LOCATION_REFUSED,true).apply() |
| | | refreshLayout.autoRefresh() |
| | | } |
| | | },"去授权","取消") |
| | | override fun onCancel() { |
| | | SPUtils.instance().put(Const.User.LOCATION_REFUSED, true).apply() |
| | | refreshLayout.autoRefresh() |
| | | } |
| | | }, |
| | | "去授权", |
| | | "取消" |
| | | ) |
| | | } |
| | | } |
| | | |
| | | private fun requestLocation(){ |
| | | toast("定位中...") |
| | | var locationClient:AMapLocationClient? |
| | | try { |
| | | locationClient = AMapLocationClient(requireActivity()) |
| | | } catch (e: Exception) { |
| | | locationClient = null |
| | | } |
| | | locationClient?.setLocationListener { |
| | | JkApplication.lat = it.latitude |
| | | JkApplication.lon = it.longitude |
| | | refreshLayout.autoRefresh() |
| | | } |
| | | val option = AMapLocationClientOption() |
| | | option.locationPurpose = AMapLocationClientOption.AMapLocationPurpose.SignIn |
| | | option.isOnceLocation = true |
| | | locationClient?.setLocationOption(option) |
| | | //设置场景模式后最好调用一次stop,再调用start以保证场景模式生效 |
| | | locationClient?.stopLocation() |
| | | locationClient?.startLocation() |
| | | } |
| | | |
| | | |
| | | |
| | | private fun getData(){ |
| | | HttpManager.getMeditationPage(page,search,JkApplication.lat, JkApplication.lon).requestByF(this,success = { _, data-> |
| | | if (page == 1) |
| | | list.clear() |
| | | list.addAll(data?.list?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | if (list.isEmpty()) |
| | | refreshLayout.finishRefreshWithNoMoreData() |
| | | else if (data?.list?.isNullOrEmpty() == true) |
| | | refreshLayout.finishLoadMoreWithNoMoreData() |
| | | else if (page == 1) |
| | | refreshLayout.finishRefresh() |
| | | else |
| | | refreshLayout.finishLoadMore() |
| | | }){_,_-> |
| | | HttpManager.getMeditationPage(page, search, JkApplication.lat, JkApplication.lon).requestByF( |
| | | this, |
| | | success = { _, data -> |
| | | if (page == 1) |
| | | list.clear() |
| | | list.addAll(data?.list ?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | if (list.isEmpty()) |
| | | refreshLayout.finishRefreshWithNoMoreData() |
| | | else if (data?.list?.isNullOrEmpty() == true) |
| | | refreshLayout.finishLoadMoreWithNoMoreData() |
| | | else if (page == 1) |
| | | refreshLayout.finishRefresh() |
| | | else |
| | | refreshLayout.finishLoadMore() |
| | | }){ _, _-> |
| | | if (page == 1) |
| | | refreshLayout.finishRefresh(false) |
| | | else |
| | |
| | | } |
| | | |
| | | @Subscribe |
| | | fun refresh(e:EmptyEvent){ |
| | | fun refresh(e: EmptyEvent){ |
| | | if (e.code == Const.EventCode.REFRESH_DISCOVERY) |
| | | refreshLayout.autoRefresh() |
| | | } |
| | |
| | | import android.webkit.WebSettings |
| | | import android.webkit.WebViewClient |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import com.google.android.material.appbar.AppBarLayout |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.MapTypeDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.Place |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.discovery.adapter.BannerAdapter |
| | | import com.sinata.xqmuse.utils.AppBarStateChangeListener |
| | | import com.sinata.xqmuse.utils.ThirdPartyMapsGuide |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import com.youth.banner.indicator.CircleIndicator |
| | | import com.youth.banner.indicator.RectangleIndicator |
| | | import com.youth.banner.indicator.RoundLinesIndicator |
| | |
| | | private val bannerAdapter by lazy { |
| | | BannerAdapter(bannerImg, this) |
| | | } |
| | | private var place:Place? = null |
| | | |
| | | override fun initClick() { |
| | | iv_back.setOnClickListener { finish() } |
| | | tv_address.setOnClickListener { |
| | | val mapTypeDialog = MapTypeDialog() |
| | | mapTypeDialog.callback = object : StringCallback { |
| | | override fun onResult(rst: String) { |
| | | if(rst == "b"){ |
| | | ThirdPartyMapsGuide.goToBaiduActivity(this@PlaceDetailActivity,place?.hallName,place!!.longitude,place!!.latitude) |
| | | }else if (rst == "a"){ |
| | | ThirdPartyMapsGuide.goToGaoDeMap(this@PlaceDetailActivity,place?.hallName,place!!.longitude.toString(),place!!.latitude.toString()) |
| | | }else{ |
| | | ThirdPartyMapsGuide.goToTencentMap(this@PlaceDetailActivity,place?.hallName,place!!.longitude,place!!.latitude) |
| | | } |
| | | } |
| | | } |
| | | mapTypeDialog.showAllowingStateLoss(supportFragmentManager,"map") |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | |
| | | |
| | | private fun getData() { |
| | | HttpManager.getMeditationInfo(id?:"").request(this){_,data-> |
| | | place = data |
| | | data?.apply { |
| | | bannerImg.clear() |
| | | bannerImg.addAll(detailBannerUrl.split(",").filter { !it.isNullOrEmpty() }) |
| | | bannerAdapter.notifyDataSetChanged() |
| | | banner.postDelayed({ |
| | | banner.isAutoLoop(true) |
| | | banner.start() |
| | | },2000) |
| | | banner.currentItem = 1 |
| | | tv_name.text = hallName |
| | | tv_phone.text = contactNumber |
| | | tv_address.text = address |
| | |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import java.util.ArrayList |
| | | |
| | | class CommentAdapter(comment: ArrayList<Comment>):HFRecyclerAdapter<Comment>(comment, R.layout.item_comment) { |
| | | class CommentAdapter(comment: ArrayList<Comment>,val act:BaseActivity):HFRecyclerAdapter<Comment>(comment, R.layout.item_comment) { |
| | | var callback:StringCallback? = null |
| | | override fun onBind(holder: ViewHolder, position: Int, data: Comment) { |
| | | holder.bind<SimpleDraweeView>(R.id.iv_avatar).setImageURI(data.avatar) |
| | |
| | | val tv_like = holder.bind<TextView>(R.id.tv_like) |
| | | tv_like.setCompoundDrawablesRelativeWithIntrinsicBounds(0,0,if (data.like == 1) R.mipmap.dianzaned else R.mipmap.dianzan,0) //todo是否点赞 |
| | | tv_like.clickDelay { |
| | | HttpManager.doLike(data.id).request(context as BaseActivity){_,_-> |
| | | HttpManager.doLike(data.id).request(act){_,_-> |
| | | data.like = if (data.like == 1) 2 else 1 |
| | | notifyItemChanged(position) |
| | | } |
| | |
| | | override fun onBind(holder: ViewHolder, position: Int, data: Msg) { |
| | | val iv = holder.bind<ImageView>(R.id.iv) |
| | | iv.setImageResource(if (data.noticeType == 2) R.mipmap.ic_msg1 else R.mipmap.ic_notice) |
| | | holder.setText(R.id.tv_type,if (data.noticeType == 2) "回复消息" else "系统消息") |
| | | // holder.setText(R.id.tv_type,if (data.noticeType == 2) "回复消息" else "系统消息") |
| | | holder.setText(R.id.tv_type,data.title) |
| | | holder.bind<View>(R.id.iv_unread).visibility = if (data.readStatus == 1) View.VISIBLE else View.GONE |
| | | holder.setText(R.id.tv_time,data.time) |
| | | holder.setText(R.id.tv_content,data.content) |
| | |
| | | import com.facebook.drawee.view.SimpleDraweeView |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.entity.Place |
| | | import com.sinata.xqmuse.utils.extention.formatDistance |
| | | import java.util.ArrayList |
| | | |
| | | class PlaceAdapter(list: ArrayList<Place>):HFRecyclerAdapter<Place>(list, R.layout.item_place) { |
| | |
| | | holder.bind<SimpleDraweeView>(R.id.iv_cover).setImageURI(data.coverUrl) |
| | | holder.setText(R.id.tv_name,data.hallName) |
| | | holder.setText(R.id.tv_address,data.address) |
| | | holder.setText(R.id.tv_address,data.contactNumber) |
| | | holder.setText(R.id.tv_distance,"距你${data.distance}km") |
| | | holder.setText(R.id.tv_phone,data.contactNumber) |
| | | holder.setText(R.id.tv_distance,"距你${data.distance.formatDistance()}") |
| | | } |
| | | } |
| | |
| | | import cn.sinata.xldutils.gone |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.activity_guide2.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class Guide2Activity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_guide2 |
| | | |
| | | override fun initClick() { |
| | | tv_skip.setOnClickListener { finish() } |
| | | tv_skip.setOnClickListener { |
| | | onBackPressed() |
| | | } |
| | | tv_action.setOnClickListener { |
| | | startActivity<QAActivity>() |
| | | finish() |
| | |
| | | titleBar.gone() |
| | | } |
| | | |
| | | override fun onBackPressed() { |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_GUIDE_AUDIO)) |
| | | super.onBackPressed() |
| | | } |
| | | |
| | | } |
| | |
| | | package com.sinata.xqmuse.ui.guide |
| | | |
| | | import cn.sinata.xldutils.gone |
| | | import com.google.android.exoplayer2.upstream.DataSpec |
| | | import com.google.android.exoplayer2.upstream.RawResourceDataSource |
| | | import com.google.android.exoplayer2.upstream.RawResourceDataSource.RawResourceDataSourceException |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.BgTipDialog |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.activity_guide.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | |
| | | |
| | | class GuideActivity : TransparentStatusBarActivity(){ |
| | |
| | | |
| | | override fun initClick() { |
| | | tv_skip.setOnClickListener { |
| | | finish() |
| | | onBackPressed() |
| | | } |
| | | tv_action.setOnClickListener { |
| | | val bgTipDialog = BgTipDialog() |
| | | bgTipDialog.show(supportFragmentManager,"bg") |
| | | bgTipDialog.show(supportFragmentManager, "bg") |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | titleBar.gone() |
| | | val url = "android.resource://" + packageName.toString() + "/" + R.raw.bg_movie |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.START_GUIDE_AUDIO)) |
| | | playWithExo() |
| | | } |
| | | |
| | | private fun playWithExo(){ |
| | | //ExoPlayer |
| | | val dataSpec = DataSpec(RawResourceDataSource.buildRawResourceUri(R.raw.bg_movie)) |
| | | val rawResourceDataSource = RawResourceDataSource(this) |
| | | try { |
| | | rawResourceDataSource.open(dataSpec) |
| | | } catch (e: RawResourceDataSourceException) { |
| | | e.printStackTrace() |
| | | } |
| | | val url = rawResourceDataSource.uri.toString() |
| | | player.setUrl(url) |
| | | player.setLooping(true) |
| | | player.start() |
| | | } |
| | | |
| | | private fun playWithIjkOrMedia(){ |
| | | val url = "android.resource://" + packageName.toString() + "/" + R.raw.bg_movie |
| | | player.setUrl(url) |
| | | } |
| | | |
| | | override fun onPause() { |
| | |
| | | super.onDestroy() |
| | | player.release() |
| | | } |
| | | |
| | | override fun onBackPressed() { |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_GUIDE_AUDIO)) |
| | | super.onBackPressed() |
| | | } |
| | | } |
| | |
| | | import com.sinata.xqmuse.network.entity.req.UserAnswerOneDTO |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import kotlinx.android.synthetic.main.activity_qa.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class QAActivity:TransparentStatusBarActivity() { |
| | |
| | | private var index = 0 |
| | | |
| | | override fun initClick() { |
| | | tv_skip.setOnClickListener { finish() } |
| | | tv_skip.setOnClickListener { |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_GUIDE_AUDIO)) |
| | | finish() |
| | | } |
| | | mask.setOnClickListener { } |
| | | rg_qa.setOnCheckedChangeListener { group, checkedId -> |
| | | if (rb_no.isChecked||rb_yes.isChecked||rb_maybe.isChecked){ |
| | |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.activity_tag.* |
| | | import kotlinx.android.synthetic.main.layout_tag_item.view.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | |
| | |
| | | private val tags by lazy { intent.getParcelableArrayListExtra<TagBean>("tags") } |
| | | |
| | | override fun initClick() { |
| | | tv_skip.setOnClickListener { finish() } |
| | | tv_skip.setOnClickListener { |
| | | onBackPressed() |
| | | } |
| | | tv_last.setOnClickListener { |
| | | startActivity<QAActivity>() |
| | | finish() |
| | |
| | | if (SPUtils.instance().getString(Const.User.TOKEN).isNullOrEmpty()){ |
| | | SPUtils.instance().put(Const.User.ANSWER,Gson().toJson(answer)).apply() |
| | | Log.e(Const.Tag,"当前未登录,保存到Sp中") |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_GUIDE_AUDIO)) |
| | | startActivity<MainActivity>() |
| | | }else{ |
| | | tv_action.isEnabled = false |
| | | HttpManager.saveUserAnswers(answer!!).request(this,success = {_,_-> |
| | | toast("保存成功") |
| | | startActivity<MainActivity>() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_GUIDE_AUDIO)) |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.REFRESH_PRIVATE)) |
| | | }){_,_-> |
| | | tv_action.isEnabled = true |
| | | } |
| | |
| | | lines++ |
| | | } |
| | | } |
| | | |
| | | override fun onBackPressed() { |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_GUIDE_AUDIO)) |
| | | super.onBackPressed() |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.home |
| | | |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.BuyRuleDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.ConfirmOrder |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.course.PaySuccessActivity |
| | | import com.sinata.xqmuse.utils.extention.clickDelay |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import com.sinata.xqmuse.utils.pay.PayListener |
| | | import kotlinx.android.synthetic.main.activity_buy_course.* |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | |
| | | class BuyVoiceActivity:TransparentStatusBarActivity(),PayListener { |
| | | override fun setContentView() = R.layout.activity_buy_course |
| | | |
| | | private val fromDetail by lazy { intent.getBooleanExtra("fromDetail",true) } |
| | | private val id by lazy { intent.getStringExtra("id") } |
| | | private var data:ConfirmOrder? = null |
| | | |
| | | override fun initClick() { |
| | | tv_buy_rule.clickDelay { |
| | | HttpManager.getH5(5).request(this){ _, data-> |
| | | val buyRuleDialog = BuyRuleDialog() |
| | | buyRuleDialog.arguments = bundleOf("rule" to data?.content) |
| | | buyRuleDialog.callback = object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | cb_rule.isChecked = rst == "ok" |
| | | } |
| | | } |
| | | buyRuleDialog.showAllowingStateLoss(supportFragmentManager,"rule") |
| | | } |
| | | } |
| | | |
| | | tv_action.setOnClickListener { |
| | | if (cb_rule.isChecked){ |
| | | if (rb_ali.isChecked){ |
| | | pay(2) |
| | | }else if (rb_wx.isChecked){ |
| | | pay(1) |
| | | } else if (rb_balance.isChecked&&((data?.balance?:"0.0").toDouble()>(data?.generalPrice?:"0.0").toDouble())){ |
| | | payBalance() |
| | | }else{ |
| | | |
| | | } |
| | | }else |
| | | toast("请阅读并同意《购买协议》") |
| | | } |
| | | } |
| | | |
| | | private fun pay(way:Int) { |
| | | tv_action.isEnabled = false |
| | | showDialog() |
| | | HttpManager.placeOrder(1,way,2,null,null,data?.id?:"",null).request(this,success = {_,data-> |
| | | onPaySuccess() |
| | | |
| | | }){_,_-> |
| | | tv_action.isEnabled = true |
| | | } |
| | | } |
| | | |
| | | private fun payBalance() { |
| | | tv_action.isEnabled = false |
| | | showDialog() |
| | | HttpManager.gvieCourse(data?.id?:"",1).request(this,success = {_,_-> |
| | | onPaySuccess() |
| | | }){_,_-> |
| | | tv_action.isEnabled = true |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | getData() |
| | | } |
| | | |
| | | private fun getData() { |
| | | HttpManager.confirmOrderVoice(id?:"").request(this){_,data-> |
| | | this.data = data |
| | | data?.apply { |
| | | iv_cover.setImageURI(coverUrl.split(",").firstOrNull()) |
| | | tv_title.text = meditationTitle |
| | | // tv_teacher.text = "导师 $tutorName" |
| | | tv_price.text = SpanBuilder("¥$generalPrice").size(0,1,11).build() |
| | | tv_money.text = SpanBuilder("¥$generalPrice").size(0,1,11).build() |
| | | tv_total.text = generalPrice |
| | | val s = "余额抵扣 当前可用 ¥$balance" |
| | | rb_balance.text = SpanBuilder(s).size(4,s.length,11).color(this@BuyVoiceActivity,4,s.length,R.color.textColor99).build() |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun onPaySuccess() { |
| | | setResult(RESULT_OK) |
| | | startActivity<PaySuccessActivity>("data" to data,"fromDetail" to fromDetail,"isAudio" to true) |
| | | finish() |
| | | } |
| | | |
| | | override fun onPayCancel() { |
| | | } |
| | | |
| | | override fun onPayError(msg: String) { |
| | | } |
| | | } |
| | |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | 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.utils.ellipsize |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.LoginRuleDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.* |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.network.requestByF |
| | | import com.sinata.xqmuse.ui.BGMSettingActivity |
| | | import com.sinata.xqmuse.ui.H5Activity |
| | |
| | | import com.sinata.xqmuse.ui.home.adapter.HomeAdapter |
| | | import com.sinata.xqmuse.ui.home.adapter.HomeBannerAdapter |
| | | import com.sinata.xqmuse.ui.home.adapter.TopMenuAdapter |
| | | import com.sinata.xqmuse.ui.login.LoginActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import kotlinx.android.synthetic.main.fragment_home.* |
| | | import org.jetbrains.anko.startActivityForResult |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | import org.jetbrains.anko.support.v4.toast |
| | | |
| | | class HomeFragment : BaseFragment() { |
| | | override fun contentViewId() = R.layout.fragment_home |
| | |
| | | banner_privacy.adapter = privacyAdapter |
| | | rv_list.layoutManager = LinearLayoutManager(requireContext()) |
| | | rv_list.adapter = adapter |
| | | adapter.callback = object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | showDialog() |
| | | HttpManager.getMeditationDetails(rst).requestByF(this@HomeFragment,success = {_,data-> |
| | | dismissDialog() |
| | | data?.goDetail(requireContext()) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | } |
| | | getTopMenu() |
| | | getToday() |
| | | getPrivacy() |
| | | getList() |
| | | getBottomMenu() |
| | | initClick() |
| | | changeBg() |
| | | } |
| | | |
| | | fun refreshData(){ |
| | | getToday() |
| | | getPrivacy() |
| | | getList() |
| | | } |
| | | |
| | | private fun initClick() { |
| | |
| | | startActivity<GuideActivity>() |
| | | } |
| | | iv_guide.setOnClickListener { |
| | | HttpManager.getH5(LoginRuleDialog.TYPE_PRIVACY).requestByF(this){ _, data-> |
| | | HttpManager.getH5(4).requestByF(this){ _, data-> |
| | | data?.let { |
| | | startActivity<H5Activity>("title" to "新手冥想指南","url" to it.content) |
| | | } |
| | | } |
| | | } |
| | | iv_daily_empty.setOnClickListener { |
| | | toast("平台暂未设置今日疗愈") |
| | | } |
| | | iv_voice.setOnClickListener { |
| | | startActivity<BGMSettingActivity>() |
| | |
| | | } |
| | | iv_today.setOnClickListener { |
| | | if (today!=null){ |
| | | startActivity<VoiceDetailActivity>("id" to today!!.id) |
| | | showDialog() |
| | | HttpManager.getMeditationDetails(today!!.meditationId).requestByF(this,success = {_,data-> |
| | | dismissDialog() |
| | | MainActivity.voice = data |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.START_THINK)) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | } |
| | | banner_privacy.setOnBannerListener { data, position -> |
| | | showDialog() |
| | | HttpManager.getMeditationDetails(privacy[position].id).requestByF(this,success = {_,data-> |
| | | dismissDialog() |
| | | data?.goDetail(requireContext()) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | iv_pri_empty.setOnClickListener { startActivity<LoginActivity>() } |
| | | } |
| | | |
| | | fun changeBg(){ |
| | | val bg = SPUtils.instance().getString(Const.User.BG) |
| | | if (!bg.isNullOrEmpty()) |
| | | iv_home.setImageURI(bg) |
| | | } |
| | | |
| | | private fun getTopMenu(){ |
| | |
| | | } |
| | | } |
| | | |
| | | private fun getToday() { |
| | | fun getToday() { |
| | | HttpManager.getTodayMeditation().requestByF(this){_,data-> |
| | | today = data |
| | | iv_today.setImageURI(today?.clientMeditationVO?.backgroundUrl) |
| | | tv_length_today.text = "${today?.clientMeditationVO?.meditationTitle} | ${"00:00"}" |
| | | tv_today_count.text = "${today?.clientMeditationVO?.realLearnedNum}人已参加学习" |
| | | if (today?.clientMeditationVO?.backgroundUrl.isNullOrEmpty()){ |
| | | iv_daily_empty.visible() |
| | | }else{ |
| | | iv_daily_empty.gone() |
| | | iv_today.setImageURI(today?.clientMeditationVO?.backgroundUrl) |
| | | 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}人已参加学习" |
| | | } |
| | | } |
| | | } |
| | | |
| | | private fun getPrivacy() { |
| | | HttpManager.getPersonalityPlan().requestByF(this){_,data-> |
| | | privacy.clear() |
| | | privacy.addAll(data?: arrayListOf()) |
| | | privacyAdapter.notifyDataSetChanged() |
| | | } |
| | | fun getPrivacy() { |
| | | if (!SPUtils.instance().getString(Const.User.TOKEN).isNullOrEmpty()) { |
| | | gp_pri_empty.gone() |
| | | HttpManager.getPersonalityPlan().requestByF(this){_,data-> |
| | | privacy.clear() |
| | | privacy.addAll(data?: arrayListOf()) |
| | | privacyAdapter.notifyDataSetChanged() |
| | | } |
| | | }else |
| | | gp_pri_empty.visible() |
| | | } |
| | | |
| | | private fun getList() { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.sinata.xqmuse.ui.home |
| | | |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.course.CourseSearchResultActivity |
| | | import com.sinata.xqmuse.ui.home.adapter.HotAdapter |
| | | import com.sinata.xqmuse.utils.Const |
| | | import kotlinx.android.synthetic.main.activity_search.* |
| | |
| | | private val hisList = arrayListOf<String>() |
| | | private val hotList = arrayListOf<String>() |
| | | private val hotAdapter = HotAdapter(hotList) |
| | | |
| | | private val isCourse by lazy { intent.getBooleanExtra("isCourse",false) } //true:搜索课程 |
| | | private val hisKey by lazy { if (isCourse) Const.User.SEARCH_HIS_COURSE else Const.User.SEARCH_HIS_HOME } |
| | | |
| | | override fun initClick() { |
| | | hotAdapter.setOnItemClickListener { view, position -> |
| | | et_search.setText(hotList[position]) |
| | | et_search.setSelection(hotList[position].length) |
| | | tv_search.callOnClick() |
| | | } |
| | | |
| | |
| | | hisList.remove(key) |
| | | hisList.add(0,key) |
| | | saveHis() |
| | | startActivity<SearchResultActivity>("key" to key) |
| | | if (isCourse) |
| | | startActivity<CourseSearchResultActivity>("key" to key) |
| | | else |
| | | startActivity<SearchResultActivity>("key" to key) |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | rv_hot.layoutManager = LinearLayoutManager(this) |
| | | rv_hot.adapter = hotAdapter |
| | | if (isCourse){ |
| | | rv_hot.gone() |
| | | tv_2.gone() |
| | | et_search.hint = "搜索你喜欢的课程~" |
| | | }else{ |
| | | rv_hot.layoutManager = LinearLayoutManager(this) |
| | | rv_hot.adapter = hotAdapter |
| | | getHotWordList() |
| | | } |
| | | getHis() |
| | | getHotWordList() |
| | | } |
| | | |
| | | private fun getHotWordList(){ |
| | |
| | | private fun getHis(){ |
| | | hisList.clear() |
| | | fl_his.removeAllViews() |
| | | val his = SPUtils.instance().getString(Const.User.SEARCH_HIS) |
| | | val his = SPUtils.instance().getString(hisKey) |
| | | hisList.addAll(his.split(SPLIT).filter { it.isNotEmpty() }.take(10)) |
| | | hisList.forEach { |
| | | val inflate = layoutInflater.inflate(R.layout.item_search_his, fl_his, false) |
| | |
| | | inflate.tv_name.text = it |
| | | inflate.tv_name.setOnClickListener { _-> |
| | | et_search.setText(it) |
| | | et_search.setSelection(it.length) |
| | | tv_search.callOnClick() |
| | | } |
| | | inflate.iv_del.setOnClickListener { _-> |
| | |
| | | } |
| | | |
| | | private fun saveHis() { |
| | | SPUtils.instance().put(Const.User.SEARCH_HIS,hisList.joinToString(SPLIT) { it }).apply() |
| | | SPUtils.instance().put(hisKey,hisList.joinToString(SPLIT) { it }).apply() |
| | | getHis() |
| | | } |
| | | } |
| | |
| | | refreshLayout.autoRefresh() |
| | | } |
| | | } |
| | | adapter.setOnItemClickListener { view, position -> |
| | | showDialog() |
| | | HttpManager.getMeditationDetails(list[position].id).request(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(this) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | |
| | | private val adapter = VoiceGridAdapter(list) |
| | | override fun initClick() { |
| | | adapter.setOnItemClickListener { view, position -> |
| | | |
| | | showDialog() |
| | | HttpManager.getMeditationDetails(list[position].id).request(this,success = {_,data-> |
| | | dismissDialog() |
| | | data?.goDetail(this) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | package com.sinata.xqmuse.ui.home |
| | | |
| | | import android.os.CountDownTimer |
| | | import android.util.Log |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import cn.sinata.xldutils.utils.whiteToast |
| | | import cn.sinata.xldutils.visible |
| | | import com.share.utils.ShareUtils |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.CommentDialog |
| | | import com.sinata.xqmuse.dialog.ShareDialog |
| | | import com.sinata.xqmuse.dialog.TimeSettingDialog |
| | | import com.sinata.xqmuse.dialog.VolumeDialog |
| | | import com.sinata.xqmuse.network.Apis |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.VoiceDetail |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.AudioUtils |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import com.umeng.socialize.bean.SHARE_MEDIA |
| | | import kotlinx.android.synthetic.main.activity_voice_detail.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.greenrobot.eventbus.Subscribe |
| | | import org.jetbrains.anko.toast |
| | | |
| | | class VoiceDetailActivity:TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_voice_detail |
| | | |
| | | private val id by lazy { intent.getStringExtra("id")?:"" } |
| | | private var voiceDetail:VoiceDetail? = null |
| | | private val player by lazy { |
| | | AudioUtils() |
| | | } |
| | | private var index = 0 |
| | | private var isRecycle = true //true列表循环播放 |
| | | private val voiceDetail by lazy { intent.getParcelableExtra<VoiceDetail>("data") } |
| | | |
| | | private var countDownTimer:CountDownTimer? = null |
| | | |
| | | override fun initClick() { |
| | | iv_back.setOnClickListener { finish() } |
| | |
| | | } |
| | | |
| | | iv_play.setOnClickListener { |
| | | if (voiceDetail!=null) |
| | | player.startPlayMusic(this,voiceDetail?.meditationMusicList!![index]) |
| | | if (MainActivity.voice?.id == voiceDetail?.id){ |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.PAUSE_OR_RESUME_THINK)) |
| | | if (MainActivity.playing) //播放中 |
| | | iv_play.setImageResource(R.mipmap.player_pause) |
| | | else |
| | | iv_play.setImageResource(R.mipmap.play_detail) |
| | | }else{ |
| | | if (MainActivity.playing) |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_THINK)) |
| | | MainActivity.voice = voiceDetail |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.START_THINK)) |
| | | iv_play.setImageResource(R.mipmap.player_pause) |
| | | } |
| | | } |
| | | |
| | | iv_share.setOnClickListener { |
| | |
| | | shareDialog.callback = object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | if (rst == "wx"){ |
| | | toast("微信分享") |
| | | ShareUtils.share(this@VoiceDetailActivity, |
| | | SHARE_MEDIA.WEIXIN,voiceDetail?.detailDescription,voiceDetail?.meditationTitle, |
| | | Apis.SHARE_VOICE.format(voiceDetail?.id),null,"") |
| | | }else{ |
| | | toast("朋友圈分享") |
| | | ShareUtils.share(this@VoiceDetailActivity, |
| | | SHARE_MEDIA.WEIXIN_CIRCLE,voiceDetail?.detailDescription,voiceDetail?.meditationTitle, |
| | | Apis.SHARE_VOICE.format(voiceDetail?.id),null,"") |
| | | } |
| | | } |
| | | } |
| | |
| | | val timeSettingDialog = TimeSettingDialog() |
| | | timeSettingDialog.callback = object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | toast("设置倒计时$rst") |
| | | Log.e(Const.Tag,"设置倒计时$rst") |
| | | MainActivity.finishTime = System.currentTimeMillis()+rst.toLong()*60*1000 |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.THINK_TIMER)) |
| | | startTimer() |
| | | } |
| | | } |
| | | timeSettingDialog.showAllowingStateLoss(supportFragmentManager,"time") |
| | | } |
| | | |
| | | iv_recycle.setOnClickListener { |
| | | isRecycle = !isRecycle |
| | | iv_recycle.setImageResource(if (isRecycle) R.mipmap.ic_recycle else R.mipmap.danquxunhuan) |
| | | toast(if (isRecycle) "当前播放模式已设置为顺序播放" else "当前播放模式已设置为单曲循环") |
| | | MainActivity.isRecycle = !MainActivity.isRecycle |
| | | iv_recycle.setImageResource(if (MainActivity.isRecycle) R.mipmap.danquxunhuan else R.mipmap.ic_recycle) |
| | | whiteToast(if (MainActivity.isRecycle) "当前播放模式已设置为单曲循环" else "当前播放模式已设置为顺序播放") |
| | | SPUtils.instance().put(Const.User.IS_RECYCLE,MainActivity.isRecycle).apply() |
| | | } |
| | | tv_comment.setOnClickListener { |
| | | val commentDialog = CommentDialog() |
| | | commentDialog.arguments = bundleOf("id" to id) |
| | | commentDialog.arguments = bundleOf("id" to voiceDetail?.id) |
| | | commentDialog.showAllowingStateLoss(supportFragmentManager,"comment") |
| | | } |
| | | iv_volume.setOnClickListener { |
| | |
| | | |
| | | override fun initView() { |
| | | titleBar.gone() |
| | | isRecycle = SPUtils.instance().getBoolean(Const.User.IS_RECYCLE,true) |
| | | getDetail() |
| | | MainActivity.isRecycle = SPUtils.instance().getBoolean(Const.User.IS_RECYCLE,false) |
| | | iv_recycle.setImageResource(if (MainActivity.isRecycle) R.mipmap.danquxunhuan else R.mipmap.ic_recycle) |
| | | voiceDetail?.apply { |
| | | iv_collect.setImageResource(if (favorite == 1) R.mipmap.collected else R.mipmap.uncollect) |
| | | iv_bg.setImageURI(backgroundUrl) |
| | | tv_name.text = meditationTitle |
| | | tv_subtitle.text = detailDescription |
| | | tv_comment.text = questionCount |
| | | if (MainActivity.voice?.id == id&&MainActivity.playing) //是本音频并且播放中 |
| | | iv_play.setImageResource(R.mipmap.player_pause) |
| | | else |
| | | iv_play.setImageResource(R.mipmap.play_detail) |
| | | val seconds = (if (MainActivity.voice?.id == id) meditationSecondList?.getOrNull(MainActivity.index) else meditationSecondList?.firstOrNull() )?: 0 |
| | | tv_total.text = "%02d:%02d".format(seconds/60,seconds%60) |
| | | if (MainActivity.voice?.id == id&&MainActivity.finishTime!=0L)//有倒计时存在 |
| | | startTimer() |
| | | } |
| | | EventBus.getDefault().register(this) |
| | | } |
| | | |
| | | private fun getDetail() { |
| | | HttpManager.getMeditationDetails(id).request(this){_,data-> |
| | | this.voiceDetail = data |
| | | data?.apply { |
| | | iv_collect.setImageResource(if (favorite == 1) R.mipmap.collected else R.mipmap.uncollect) |
| | | iv_bg.setImageURI(backgroundUrl) |
| | | tv_name.text = meditationTitle |
| | | tv_subtitle.text = detailDescription |
| | | tv_comment.text = questionCount |
| | | private fun startTimer(){ |
| | | if (countDownTimer!=null) |
| | | countDownTimer!!.cancel() |
| | | tv_timer.visible() |
| | | val offset = MainActivity.finishTime - System.currentTimeMillis() |
| | | countDownTimer = object :CountDownTimer(offset,1000){ |
| | | override fun onTick(millisUntilFinished: Long) { |
| | | tv_timer.text = "%02d:%02d".format(millisUntilFinished/1000/60,millisUntilFinished/1000%60) |
| | | } |
| | | |
| | | override fun onFinish() { |
| | | tv_timer.gone() |
| | | } |
| | | } |
| | | countDownTimer?.start() |
| | | } |
| | | |
| | | private fun collect(){ |
| | | HttpManager.favorite(id).request(this){_,data-> |
| | | HttpManager.favorite(voiceDetail?.id?:"").request(this){_,data-> |
| | | voiceDetail?.favorite = if (voiceDetail?.favorite == 1) 2 else 1 |
| | | iv_collect.setImageResource(if (voiceDetail?.favorite == 1) R.mipmap.collected else R.mipmap.uncollect) |
| | | } |
| | | } |
| | | |
| | | @Subscribe |
| | | fun onEvent(e:EmptyEvent){ |
| | | if (e.code == Const.EventCode.FINISH_THINK){ |
| | | iv_play.setImageResource(R.mipmap.play_detail) |
| | | sb_voice.progress = 0 |
| | | tv_progress.text = "00:00" |
| | | tv_timer.gone() |
| | | countDownTimer?.cancel() |
| | | }else if (e.code == Const.EventCode.GOT_THINK_DURATION&&MainActivity.voice?.id == voiceDetail?.id){ |
| | | tv_total.text = "%02d:%02d".format(MainActivity.currentDuration/60,MainActivity.currentDuration%60) |
| | | sb_voice.max = MainActivity.currentDuration |
| | | }else if (e.code == Const.EventCode.GOT_THINK_POSITION&&MainActivity.voice?.id == voiceDetail?.id){ |
| | | tv_progress.text = "%02d:%02d".format(MainActivity.currentPosition/1000/60,MainActivity.currentPosition/1000%60) |
| | | sb_voice.progress = MainActivity.currentPosition/1000 |
| | | } |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | | super.onDestroy() |
| | | EventBus.getDefault().unregister(this) |
| | | countDownTimer?.cancel() |
| | | } |
| | | } |
| | |
| | | import androidx.recyclerview.widget.RecyclerView |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | | import cn.sinata.xldutils.utils.ellipsize |
| | | import cn.sinata.xldutils.utils.formatPhone |
| | | import cn.sinata.xldutils.visible |
| | | import com.facebook.drawee.view.SimpleDraweeView |
| | | import com.sinata.xqmuse.R |
| | |
| | | size: Int |
| | | ) { |
| | | val bannerViewHolder = holder as BannerViewHolder |
| | | bannerViewHolder.iv_bg.setImageURI(data?.backgroundUrl) |
| | | bannerViewHolder.iv_bg.setImageURI(data?.coverUrl?.split(",")?.get(1)) |
| | | bannerViewHolder.tv_title.text = data?.meditationTitle |
| | | bannerViewHolder.tv_subtitle.text = data?.coverDescription |
| | | bannerViewHolder.tv_subtitle.text = data?.coverDescription?.ellipsize(6) |
| | | bannerViewHolder.tv_count.text = (data?.realLearnedNum?:0).toString() |
| | | when(data?.chargeType){ //1=免费 2=会员免费 3=单独收费 |
| | | 2->{ |
| | |
| | | import cn.sinata.xldutils.adapter.HFRecyclerAdapter |
| | | import cn.sinata.xldutils.adapter.util.ViewHolder |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import cn.sinata.xldutils.visible |
| | | import com.facebook.drawee.view.SimpleDraweeView |
| | | import com.sinata.xqmuse.R |
| | |
| | | import com.sinata.xqmuse.network.entity.HomeListBean |
| | | import com.sinata.xqmuse.network.entity.Menu |
| | | import com.sinata.xqmuse.ui.home.TypeVoiceActivity |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import com.youth.banner.Banner |
| | | import com.youth.banner.listener.OnBannerListener |
| | | import org.jetbrains.anko.startActivity |
| | | import java.util.ArrayList |
| | | |
| | | class HomeAdapter(list: ArrayList<HomeListBean>) :HFRecyclerAdapter<HomeListBean>(list, R.layout.item_home_list){ |
| | | val menus = arrayListOf<Menu>() |
| | | var callback:StringCallback? = null |
| | | override fun onBind(holder: ViewHolder, position: Int, data: HomeListBean) { |
| | | val cl_banner = holder.bind<View>(R.id.cl_banner) |
| | | val cl_menu = holder.bind<View>(R.id.cl_menu) |
| | |
| | | iv_2.setImageURI(menus[1].secondIconUrl) |
| | | iv_3.setImageURI(menus[2].secondIconUrl) |
| | | iv_1.setOnClickListener { |
| | | context.myToast("点击菜单1") |
| | | context.startActivity<TypeVoiceActivity>("id" to menus[0].id,"title" to menus[0].categoryName) |
| | | } |
| | | iv_2.setOnClickListener { |
| | | context.myToast("点击菜单2") |
| | | |
| | | context.startActivity<TypeVoiceActivity>("id" to menus[1].id,"title" to menus[1].categoryName) |
| | | } |
| | | iv_3.setOnClickListener { |
| | | context.myToast("点击菜单3") |
| | | context.startActivity<TypeVoiceActivity>("id" to menus[2].id,"title" to menus[2].categoryName) |
| | | } |
| | | }else{ |
| | | cl_menu.gone() |
| | |
| | | banner_card.gone() |
| | | val landscapeBannerAdapter = LandscapeBannerAdapter(data.clientMeditationVOList,context) |
| | | banner_landscape.adapter = landscapeBannerAdapter |
| | | banner_landscape.setOnBannerListener { _, position -> |
| | | callback?.onResult(data.clientMeditationVOList[position].id) |
| | | } |
| | | }else{ //竖版布局 |
| | | banner_landscape.gone() |
| | | banner_card.visible() |
| | | val cardBannerAdapter = CardBannerAdapter(data.clientMeditationVOList,context) |
| | | banner_card.adapter = cardBannerAdapter |
| | | banner_card.setBannerGalleryEffect(100,20,0.9f) |
| | | banner_card.setBannerGalleryEffect(100,15,0.9f) |
| | | banner_card.setOnBannerListener { _, position -> |
| | | callback?.onResult(data.clientMeditationVOList[position].id) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | size: Int |
| | | ) { |
| | | val bannerViewHolder = holder as BannerViewHolder |
| | | bannerViewHolder.iv_bg.setImageURI(data?.backgroundUrl) |
| | | val coverUrl = data?.coverUrl?:"" |
| | | if (coverUrl.contains(",")){ |
| | | bannerViewHolder.iv_bg.setImageURI(coverUrl.split(",").firstOrNull()) |
| | | }else |
| | | bannerViewHolder.iv_bg.setImageURI(coverUrl) |
| | | bannerViewHolder.tv_name.text = data?.meditationTitle |
| | | bannerViewHolder.tv_subtitle.text = data?.coverDescription |
| | | bannerViewHolder.iv_play.setOnClickListener { |
| | |
| | | tvName.textColorResource = R.color.textColor66 |
| | | tvSort.backgroundResource = R.drawable.bg_grey_circle |
| | | }else{ |
| | | tvName.textColorResource = R.color.textGreen |
| | | tvName.textColorResource = R.color.darkGreen |
| | | tvSort.backgroundResource = R.drawable.bg_green_circle |
| | | } |
| | | } |
| | |
| | | import androidx.recyclerview.widget.RecyclerView |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | | import cn.sinata.xldutils.utils.ellipsize |
| | | import cn.sinata.xldutils.visible |
| | | import com.facebook.drawee.view.SimpleDraweeView |
| | | import com.sinata.xqmuse.R |
| | |
| | | size: Int |
| | | ) { |
| | | val bannerViewHolder = holder as BannerViewHolder |
| | | bannerViewHolder.iv_bg.setImageURI(data?.backgroundUrl) |
| | | bannerViewHolder.iv_bg.setImageURI(data?.coverUrl?.split(",")?.get(0)) |
| | | bannerViewHolder.tv_title.text = data?.meditationTitle |
| | | bannerViewHolder.tv_subtitle.text = data?.coverDescription |
| | | bannerViewHolder.tv_subtitle.text = data?.coverDescription?.ellipsize(18) |
| | | bannerViewHolder.tv_count.text = (data?.realLearnedNum?:0).toString() |
| | | when(data?.chargeType){ //1=免费 2=会员免费 3=单独收费 |
| | | 2->{ |
| | |
| | | 3->{ |
| | | bannerViewHolder.iv_vip.gone() |
| | | bannerViewHolder.tv_price.visible() |
| | | bannerViewHolder.tv_price.text = SpanBuilder("¥${"9.0"}").size(0,1,7).build() |
| | | bannerViewHolder.tv_price.text = SpanBuilder("¥${data.generalPrice}").size(0,1,7).build() |
| | | }else->{ |
| | | bannerViewHolder.iv_vip.gone() |
| | | bannerViewHolder.tv_price.gone() |
| | |
| | | |
| | | class VoiceGridAdapter(list: ArrayList<CommonItemBean>):HFRecyclerAdapter<CommonItemBean>(list,R.layout.item_voice_grid) { |
| | | override fun onBind(holder: ViewHolder, position: Int, data: CommonItemBean) { |
| | | holder.bind<SimpleDraweeView>(R.id.iv_bg).setImageURI(data.backgroundUrl) |
| | | holder.bind<SimpleDraweeView>(R.id.iv_bg).setImageURI(data.coverUrl?.split(",")?.elementAtOrNull(1)) |
| | | holder.setText(R.id.tv_title,data?.meditationTitle) |
| | | holder.setText(R.id.tv_subtitle,data?.coverDescription) |
| | | holder.setText(R.id.tv_count,(data?.realLearnedNum?:0).toString()) |
| | |
| | | 3->{ |
| | | iv_vip.gone() |
| | | tv_price.visible() |
| | | tv_price.text = SpanBuilder("¥${"9.0"}").size(0,1,7).build() |
| | | tv_price.text = SpanBuilder("¥${data.generalPrice}").size(0,1,7).build() |
| | | }else->{ |
| | | iv_vip.gone() |
| | | tv_price.gone() |
| | |
| | | package com.sinata.xqmuse.ui.login |
| | | |
| | | import android.content.Intent |
| | | import android.os.CountDownTimer |
| | | import cn.sinata.xldutils.utils.isValidPhone |
| | | import cn.sinata.xldutils.utils.myToast |
| | |
| | | override fun setContentView() = R.layout.activity_bind_phone |
| | | private lateinit var timer: CountDownTimer |
| | | |
| | | private val openid by lazy { intent.getStringExtra("openid") } |
| | | private val token by lazy { intent.getStringExtra("token") } |
| | | |
| | | override fun initClick() { |
| | | tv_action.onClick { |
| | | if (!cb_rule.isChecked) { |
| | |
| | | myToast("请输入6位验证码") |
| | | return@onClick |
| | | } |
| | | //TODO API |
| | | HttpManager.verifyCellPhone(token?:"",phone,code,openid?:"").request(this@BindPhoneActivity){_,data-> |
| | | val result = Intent() |
| | | result.putExtra("token",token) |
| | | setResult(RESULT_OK,result) |
| | | finish() |
| | | } |
| | | } |
| | | |
| | | tv_code.onClick { |
| | |
| | | package com.sinata.xqmuse.ui.login |
| | | |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import cn.sinata.xldutils.utils.isValidPhone |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import kotlinx.android.synthetic.main.activity_forget.* |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | |
| | | } |
| | | |
| | | override fun initView() { |
| | | if (!SPUtils.instance().getString(Const.User.TOKEN).isNullOrEmpty()){ |
| | | tv_1.text = "修改密码" |
| | | title = "修改密码" |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import android.text.Editable |
| | | import android.text.TextWatcher |
| | | import android.view.KeyEvent |
| | | import android.view.MotionEvent |
| | | import android.view.inputmethod.InputMethodManager |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import cn.sinata.xldutils.utils.* |
| | | import cn.sinata.xldutils.utils.hideBankCard |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.MsgDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import kotlinx.android.synthetic.main.activity_input_code.* |
| | | import org.jetbrains.anko.startActivity |
| | | import java.util.* |
| | |
| | | private val timer by lazy { |
| | | object : CountDownTimer(60000, 1000) { |
| | | override fun onFinish() { |
| | | tv_3.text = "可重新获取短信验证码" |
| | | tv_3.text = "" |
| | | tv_get_code.isEnabled = true |
| | | tv_get_code.alpha = 1f |
| | | } |
| | |
| | | }) |
| | | msgDialog.showAllowingStateLoss(supportFragmentManager,"check") |
| | | }else{ |
| | | et_6.setText("") |
| | | tv_action.isEnabled = true |
| | | myToast("验证失败") |
| | | |
| | | val msgDialog = MsgDialog() |
| | | msgDialog.arguments = bundleOf("msg" to "手机号验证失败","title" to "验证失败") |
| | | msgDialog.showAllowingStateLoss(supportFragmentManager,"check") |
| | | } |
| | | }){_,_-> |
| | | tv_action.isEnabled = true |
| | |
| | | codeEts[cursorIndex].requestFocus() |
| | | } |
| | | } else { |
| | | code.deleteCharAt(code.lastIndex) |
| | | if (cursorIndex != 0) { //还没删到第一个 |
| | | cursorIndex-- |
| | | codeEts[cursorIndex].requestFocus() //焦点交给上一个 |
| | | // code.deleteCharAt(code.lastIndex) |
| | | // if (cursorIndex != 0) { //还没删到第一个 |
| | | // cursorIndex-- |
| | | // codeEts[cursorIndex].requestFocus() //焦点交给上一个 |
| | | // } |
| | | if (code.isNotEmpty()){ |
| | | cursorIndex = 0 |
| | | code.delete(0,code.length) |
| | | codeEts.forEach { |
| | | it.setText("") |
| | | } |
| | | et_1.requestFocus() |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
| | | } |
| | | }) |
| | | // it.setOnKeyListener { _, keyCode, event -> |
| | | // if (keyCode == KeyEvent.KEYCODE_DEL && event.action == KeyEvent.ACTION_UP) { |
| | | // if (cursorIndex != 0) { |
| | | // codeEts[cursorIndex - 1].setText("") |
| | | // } |
| | | // } |
| | | // false |
| | | // } |
| | | it.setOnFocusChangeListener { v, hasFocus -> |
| | | if (hasFocus){ |
| | | codeEts[cursorIndex].requestFocus() |
| | | val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager |
| | | imm.showSoftInput(codeEts[cursorIndex], InputMethodManager.SHOW_FORCED) |
| | | |
| | | it.setOnKeyListener { v, keyCode, event -> |
| | | if (keyCode == KeyEvent.KEYCODE_DEL&&it.text.isEmpty()&&cursorIndex!=0){ |
| | | code.delete(0,code.length) |
| | | cursorIndex = 0 |
| | | codeEts.forEach { |
| | | it.setText("") |
| | | } |
| | | et_1.requestFocus() |
| | | } |
| | | return@setOnKeyListener false |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | tv_2.text = "验证码已发送至:${phone}" |
| | | if (!SPUtils.instance().getString(Const.User.TOKEN).isNullOrEmpty()) |
| | | title = "修改密码" |
| | | tv_2.text = "验证码已发送至:${phone.formatPhone()}" |
| | | tv_get_code.isEnabled = false |
| | | tv_get_code.alpha = 0.5f |
| | | timer.start() |
| | | } |
| | | et_1.postDelayed({ |
| | | try { |
| | | et_1.requestFocus() |
| | | (getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager) |
| | | .showSoftInput(et_1, InputMethodManager.SHOW_FORCED) |
| | | }catch (e:Exception){ |
| | | |
| | | } |
| | | } |
| | | },500) |
| | | } |
| | | } |
| | |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.LoginRuleDialog |
| | | import com.sinata.xqmuse.dialog.LoginRulesDialog |
| | | import com.sinata.xqmuse.dialog.TipDialog |
| | | import com.sinata.xqmuse.dialog.UserRuleDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | |
| | | import com.sinata.xqmuse.ui.H5Activity |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.extention.clickDelay |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import com.umeng.socialize.UMAuthListener |
| | | import com.umeng.socialize.UMShareAPI |
| | | import com.umeng.socialize.UMShareConfig |
| | | import com.umeng.socialize.bean.SHARE_MEDIA |
| | | import kotlinx.android.synthetic.main.activity_login.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.sdk27.coroutines.onClick |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.startActivityForResult |
| | |
| | | private var openid: String? = null |
| | | private var phone: String? = null |
| | | |
| | | private var user = "" |
| | | private var privacy = "" |
| | | |
| | | @SuppressLint("CheckResult") |
| | | override fun initClick() { |
| | |
| | | } |
| | | |
| | | tv_privacy_rule.clickDelay { |
| | | HttpManager.getH5(LoginRuleDialog.TYPE_PRIVACY).request(this){ _, data-> |
| | | data?.let { |
| | | startActivityForResult<H5Activity>(1,"title" to "隐私协议","url" to it.content,"showClose" to true) |
| | | } |
| | | } |
| | | if (user.isNotEmpty()&&privacy.isNotEmpty()) |
| | | LoginRulesDialog.show(supportFragmentManager,privacy,user,1,object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | cb_rule.isChecked = rst.isNotEmpty() |
| | | } |
| | | }) |
| | | } |
| | | |
| | | tv_user_rule.clickDelay { |
| | | HttpManager.getH5(LoginRuleDialog.TYPE_USER).request(this){ _, data-> |
| | | data?.let { |
| | | startActivityForResult<H5Activity>(2,"title" to "用户协议","url" to it.content,"showClose" to true) |
| | | } |
| | | } |
| | | if (user.isNotEmpty()&&privacy.isNotEmpty()) |
| | | LoginRulesDialog.show(supportFragmentManager,privacy,user,0,object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | cb_rule.isChecked = rst.isNotEmpty() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | if (BuildConfig.DEBUG){ |
| | | et_phone.setText("18583738369") |
| | | et_pwd.setText("123456") |
| | | et_pwd.setText("123456ABC") |
| | | et_code.setText("123456") |
| | | } |
| | | getRules() |
| | | } |
| | | |
| | | private fun getRules() { |
| | | HttpManager.getH5(LoginRuleDialog.TYPE_PRIVACY).request(this){ _, data-> |
| | | privacy = data?.content?:"" |
| | | } |
| | | HttpManager.getH5(LoginRuleDialog.TYPE_USER).request(this){ _, data-> |
| | | user = data?.content?:"" |
| | | } |
| | | } |
| | | |
| | | private fun thirdAuth() { |
| | | startActivityForResult<BindPhoneActivity>(200,"type" to RegisterActivity.TYPE_BIND) |
| | | |
| | | // val umShareConfig = UMShareConfig() |
| | | // umShareConfig.isNeedAuthOnGetUserInfo(true) |
| | | // UMShareAPI.get(this).setShareConfig(umShareConfig) |
| | | // UMShareAPI.get(this).getPlatformInfo(this, SHARE_MEDIA.WEIXIN, this) |
| | | val umShareConfig = UMShareConfig() |
| | | umShareConfig.isNeedAuthOnGetUserInfo(true) |
| | | UMShareAPI.get(this).setShareConfig(umShareConfig) |
| | | UMShareAPI.get(this).getPlatformInfo(this, SHARE_MEDIA.WEIXIN, this) |
| | | } |
| | | |
| | | private fun loginByPwd() { |
| | |
| | | private fun loginSuccess(token: String) { |
| | | SPUtils.instance().put(Const.User.TOKEN, token).apply() |
| | | startActivity<MainActivity>() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.CHANGE_USER)) |
| | | finish() |
| | | } |
| | | |
| | |
| | | val avatar = p2?.get("profile_image_url") |
| | | val gender = p2?.get("gender") |
| | | val nickname = p2?.get("name") |
| | | HttpManager.wxLogin(openid, phone,nickname,if (gender == "0") 1 else 2,avatar).request(this,false,{ _, data -> |
| | | HttpManager.wxLogin(openid, nickname,if (gender == "0") 1 else 2,avatar).request(this,false,{ _, data -> |
| | | data?.let { |
| | | if (it.isBind == "0"){ |
| | | startActivityForResult<BindPhoneActivity>(200,"type" to RegisterActivity.TYPE_BIND,"token" to it.token,"id" to it.id) |
| | | if (it.bindStatus ==1){ |
| | | startActivityForResult<BindPhoneActivity>(200,"token" to it.accessToken,"openid" to openid) |
| | | }else |
| | | loginSuccess(it.token) |
| | | loginSuccess(it.accessToken) |
| | | } |
| | | }) {_,msg-> |
| | | loginFailed(msg) |
| | |
| | | } |
| | | |
| | | override fun onError(p0: SHARE_MEDIA?, p1: Int, p2: Throwable?) { |
| | | myToast("授权失败 原因:" + p2?.message) |
| | | myToast("授权失败:" + p2?.message) |
| | | } |
| | | |
| | | override fun onStart(p0: SHARE_MEDIA?) { |
| | |
| | | private lateinit var timer:CountDownTimer |
| | | private val type by lazy { intent.getIntExtra("type", TYPE_REGISTER) } |
| | | |
| | | private val openid by lazy { intent.getStringExtra("openid")?:"" } //微信绑手机号的参数 |
| | | |
| | | private val token by lazy { intent.getStringExtra("token")?:"" } //绑手机号的参数 |
| | | |
| | | private val phone by lazy { intent.getStringExtra("phone") } //初次登录 强制修改密码 |
| | |
| | | } |
| | | |
| | | override fun onTick(millisUntilFinished: Long) { |
| | | tv_code.text = "${millisUntilFinished/1000}s" |
| | | tv_code.text = "${millisUntilFinished/1000}s后可重新获取" |
| | | } |
| | | } |
| | | } |
| | |
| | | import android.text.method.HideReturnsTransformationMethod |
| | | import android.text.method.PasswordTransformationMethod |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import cn.sinata.xldutils.utils.isValidPwd |
| | | import cn.sinata.xldutils.utils.md5 |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.MsgDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.activity_set_pwd.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | |
| | |
| | | msgDialog.arguments = bundleOf("msg" to "您的密码已修改成功,快去登录账户吧","title" to "修改成功") |
| | | msgDialog.setDismissCallback(object :MsgDialog.OnDismiss{ |
| | | override fun onDismiss() { |
| | | startActivity<LoginActivity>() |
| | | finish() |
| | | if (!SPUtils.instance().getString(Const.User.TOKEN).isNullOrEmpty()){ |
| | | SPUtils.instance().put(Const.User.TOKEN, "").apply() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.CHANGE_USER)) |
| | | startActivity<MainActivity>() |
| | | startActivity<LoginActivity>() |
| | | }else{ |
| | | startActivity<LoginActivity>() |
| | | finish() |
| | | } |
| | | } |
| | | }) |
| | | msgDialog.showAllowingStateLoss(supportFragmentManager,"suc") |
| | |
| | | } |
| | | |
| | | override fun initView() { |
| | | if (!SPUtils.instance().getString(Const.User.TOKEN).isNullOrEmpty()) |
| | | title = "修改密码" |
| | | } |
| | | |
| | | } |
| | |
| | | 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 |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.login.ForgetActivity |
| | | import com.umeng.socialize.UMAuthListener |
| | | import com.umeng.socialize.UMShareAPI |
| | | import com.umeng.socialize.UMShareConfig |
| | | import com.umeng.socialize.bean.SHARE_MEDIA |
| | | import kotlinx.android.synthetic.main.activity_bind.* |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | |
| | | class BindActivity : TransparentStatusBarActivity() { |
| | | class BindActivity : TransparentStatusBarActivity(), UMAuthListener { |
| | | override fun setContentView() = R.layout.activity_bind |
| | | |
| | | private var data :UserInfo? = null |
| | |
| | | tv_phone.setOnClickListener { |
| | | if (data!=null) |
| | | startActivity<BindPhone1Activity>("phone" to data?.cellPhone) |
| | | } |
| | | tv_wx.setOnClickListener { |
| | | if (data!=null&&data?.wxOpenId.isNullOrEmpty()){ |
| | | thirdAuth() |
| | | } |
| | | } |
| | | tv_pwd.setOnClickListener { |
| | | startActivity<ForgetActivity>() |
| | | } |
| | | } |
| | | |
| | |
| | | HttpManager.getUserDetail().request(this){_,data-> |
| | | this.data = data |
| | | tv_phone.text = data?.cellPhone |
| | | tv_wx.text = if (data?.wxOpenId.isNullOrEmpty()) "" else "已绑定" |
| | | tv_wx.text = if (data?.wxOpenId.isNullOrEmpty()) "" else data?.wxName |
| | | } |
| | | } |
| | | |
| | | private fun thirdAuth() { |
| | | val umShareConfig = UMShareConfig() |
| | | umShareConfig.isNeedAuthOnGetUserInfo(true) |
| | | UMShareAPI.get(this).setShareConfig(umShareConfig) |
| | | UMShareAPI.get(this).getPlatformInfo(this, SHARE_MEDIA.WEIXIN, this) |
| | | } |
| | | |
| | | override fun onComplete(p0: SHARE_MEDIA?, p1: Int, p2: MutableMap<String, String>?) { |
| | | showDialog() |
| | | val openid = p2?.get("openid") |
| | | val nickname = p2?.get("name") |
| | | HttpManager.bindVx(openid?:"",nickname?:"").request(this,success = { _, data -> |
| | | toast("绑定成功") |
| | | tv_wx.text = nickname |
| | | this.data?.wxOpenId = openid |
| | | }) {_,msg-> |
| | | toast("绑定失败") |
| | | } |
| | | } |
| | | |
| | | override fun onCancel(p0: SHARE_MEDIA?, p1: Int) { |
| | | } |
| | | |
| | | override fun onError(p0: SHARE_MEDIA?, p1: Int, p2: Throwable?) { |
| | | } |
| | | |
| | | override fun onStart(p0: SHARE_MEDIA?) { |
| | | } |
| | | } |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.login.LoginActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.activity_change_phone_suc.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class ChangePhoneSucActivity : TransparentStatusBarActivity() { |
| | |
| | | |
| | | override fun onBackPressed() { |
| | | super.onBackPressed() |
| | | SPUtils.instance().put(Const.User.TOKEN,"").apply() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.CHANGE_USER)) |
| | | startActivity<MainActivity>() |
| | | } |
| | | } |
| | |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.Apis |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.MineInfo |
| | | import com.sinata.xqmuse.network.requestByF |
| | | import com.sinata.xqmuse.ui.H5Activity |
| | | import com.sinata.xqmuse.ui.course.MyCourseActivity |
| | | import com.sinata.xqmuse.ui.login.LoginActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | |
| | | iv_setting.callOnClick() |
| | | } |
| | | tv_share.setOnClickListener { |
| | | startActivity<ShareActivity>() |
| | | userInfo?.apply { |
| | | startActivity<ShareActivity>("userId" to userInfo?.id) |
| | | } |
| | | } |
| | | iv_msg.setOnClickListener { |
| | | startActivity<MsgActivity>() |
| | | } |
| | | tv_rank.setOnClickListener { |
| | | toast("H5") |
| | | userInfo?.apply { |
| | | startActivity<H5Activity>("title" to "爱心助力榜单","url" to Apis.RANK.format(id),"type" to 0,"pushList" to Apis.PUSH_LIST.format(id)) |
| | | } |
| | | } |
| | | tv_account.setOnClickListener { |
| | | startActivity<WalletActivity>() |
| | | userInfo?.apply { |
| | | startActivity<WalletActivity>("userId" to userInfo?.id) |
| | | } |
| | | } |
| | | tv_more_record.setOnClickListener { |
| | | startActivity<MyCourseActivity>() |
| | | } |
| | | tv_study_record.setOnClickListener { |
| | | startActivity<MyCourseActivity>() |
| | | } |
| | | } |
| | | |
| | | @Subscribe |
| | | fun refreshInfo(e: EmptyEvent){ |
| | | if (e.code == Const.EventCode.REFRESH_USER_INFO){ |
| | | if (e.code == Const.EventCode.CHANGE_USER){ |
| | | showUserInfo() |
| | | } |
| | | } |
| | | |
| | | private fun showUserInfo() { |
| | | HttpManager.getUserInfo().requestByF(this){_,data-> |
| | | userInfo = data |
| | | data?.apply { |
| | | iv_avatar.setImageURI(avatar) |
| | | tv_name.text = nickname |
| | | tv_phone.text = cellPhone.hidePhone() |
| | | tv_vip.text = if (isVip == 2){ |
| | | bg_vip.backgroundResource = R.mipmap.no_vip |
| | | "你还未开通会员服务" |
| | | } else{ |
| | | bg_vip.backgroundResource = R.mipmap.bg_vip |
| | | "${vipExpireTime.substring(0,10)}到期" |
| | | if (!SPUtils.instance().getString(Const.User.TOKEN).isNullOrEmpty()) |
| | | HttpManager.getUserInfo().requestByF(this){_,data-> |
| | | userInfo = data |
| | | data?.apply { |
| | | iv_avatar.setImageURI(avatar) |
| | | tv_name.text = nickname |
| | | tv_phone.text = cellPhone.hidePhone() |
| | | tv_vip.text = if (isVip == 2){ |
| | | bg_vip.backgroundResource = R.mipmap.no_vip |
| | | tv_describe.text = "升级为会员,解锁会员专属体验" |
| | | "你还未开通会员服务" |
| | | } else{ |
| | | bg_vip.backgroundResource = R.mipmap.bg_vip |
| | | tv_describe.text = "您将享受所有会员专享音频,尽情畅游心泉·疗愈世界" |
| | | "${vipExpireTime?.substring(0,10)}到期" |
| | | } |
| | | iv_vip.setImageURI(data.levelIcon) |
| | | tv_day.text = cumulative |
| | | tv_continue.text = continuity?:"0" |
| | | val format = "%d小时%d分".format(today / 60, today % 60) |
| | | tv_today.text = SpanBuilder(format).size(format.indexOf("小"),format.indexOf("小")+2,11).size(format.length-1,format.length,11).build() |
| | | } |
| | | iv_vip.setImageURI(data.levelIcon) |
| | | tv_day.text = cumulative |
| | | tv_continue.text = continuity?:"0" |
| | | val format = "%d小时%d分".format(today / 60, today % 60) |
| | | tv_today.text = SpanBuilder(format).size(format.indexOf("小"),format.indexOf("小")+2,11).size(format.length-1,format.length,11).build() |
| | | } |
| | | else{ |
| | | userInfo = null |
| | | iv_avatar.setImageURI("") |
| | | tv_name.text = "" |
| | | tv_phone.text = "" |
| | | tv_vip.text = "你还未开通会员服务" |
| | | tv_describe.text = "升级为会员,解锁会员专属体验" |
| | | } |
| | | } |
| | | |
| | | fun queryUnread(){ |
| | | HttpManager.queryNotice().requestByF(this){_,data-> |
| | | if (data == true) iv_unread.visible() else iv_unread.gone() |
| | | } |
| | | if (!SPUtils.instance().getString(Const.User.TOKEN).isNullOrEmpty()) |
| | | HttpManager.queryNotice().requestByF(this){_,data-> |
| | | if (data == true) iv_unread.visible() else iv_unread.gone() |
| | | } |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import android.app.Activity |
| | | import android.content.Intent |
| | | import androidx.core.os.bundleOf |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.CourseBean |
| | | import com.sinata.xqmuse.network.requestByF |
| | | import com.sinata.xqmuse.ui.course.BuyCourseActivity |
| | | import com.sinata.xqmuse.ui.course.adapter.CourseGridAdapter |
| | | import com.sinata.xqmuse.ui.home.VoiceDetailActivity |
| | | import kotlinx.android.synthetic.main.layout_common_list.* |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | import org.jetbrains.anko.support.v4.startActivityForResult |
| | | |
| | | class MineGridFragment : BaseFragment() { |
| | | override fun contentViewId() = R.layout.layout_common_list |
| | |
| | | override fun onFirstVisibleToUser() { |
| | | pType = when(type){ |
| | | COLLECTED_COURSE, COLLECTED_SAVE->WatchHisActivity.COLLECTED |
| | | HAS_BUY_VOICE, HAS_BUY_COURSE->WatchHisActivity.HAS_BUY |
| | | HAS_BUY_VOICE, HAS_BUY_COURSE->{ |
| | | adapter.isOrder = true |
| | | WatchHisActivity.HAS_BUY |
| | | } |
| | | else->WatchHisActivity.WATCH_HIS |
| | | } |
| | | state = when(type){ |
| | |
| | | } |
| | | refreshLayout.autoRefresh() |
| | | adapter.setOnItemClickListener { view, position -> |
| | | when(type){ |
| | | WATCH_HIS_SAVE, COLLECTED_SAVE->{ |
| | | startActivity<VoiceDetailActivity>("id" to list[position].id) |
| | | } |
| | | WATCH_HIS_COURSE, COLLECTED_COURSE->{ |
| | | showDialog() |
| | | HttpManager.getPayCourseInfoById(list[position].id).requestByF(this,success = {_,data-> |
| | | dismissDialog() |
| | | data?.goDetail(requireContext()) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | val courseBean = list[position] |
| | | if (adapter.isOrder&&courseBean.paymentStatus == 1) { |
| | | if (type == HAS_BUY_COURSE) |
| | | HttpManager.confirmOrder(courseBean.businessId?:"").requestByF(this){_,data-> |
| | | startActivityForResult<BuyCourseActivity>(1,"isSend" to false,"fromDetail" to false,"data" to data) |
| | | } |
| | | }else when(type){ |
| | | WATCH_HIS_SAVE, COLLECTED_SAVE, HAS_BUY_VOICE->{ |
| | | showDialog() |
| | | HttpManager.getMeditationDetails(courseBean.businessId?:"").requestByF(this,success = {_,data-> |
| | | dismissDialog() |
| | | data?.goDetail(requireContext()) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | WATCH_HIS_COURSE, COLLECTED_COURSE, HAS_BUY_COURSE->{ |
| | | showDialog() |
| | | HttpManager.getPayCourseInfoById(courseBean.businessId?:"").requestByF(this,success = { _, data-> |
| | | dismissDialog() |
| | | data?.goDetail(requireContext()) |
| | | }){_,_-> |
| | | dismissDialog() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | HttpManager.lookHistory(pType,page,state).requestByF(this,success = { _, data-> |
| | | if (page == 1) |
| | | list.clear() |
| | | list.addAll(data?.list?: arrayListOf()) |
| | | list.addAll(data?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | tv_empty.gone() |
| | | if (list.isEmpty()){ |
| | | refreshLayout.finishRefreshWithNoMoreData() |
| | | tv_empty.visible() |
| | | } else if (data?.list.isNullOrEmpty()) |
| | | } else if (data.isNullOrEmpty()) |
| | | refreshLayout.finishLoadMoreWithNoMoreData() |
| | | else if (page == 1) |
| | | refreshLayout.finishRefresh() |
| | |
| | | } |
| | | } |
| | | |
| | | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
| | | super.onActivityResult(requestCode, resultCode, data) |
| | | if (resultCode == Activity.RESULT_OK) |
| | | refreshLayout.autoRefresh() |
| | | } |
| | | |
| | | companion object{ |
| | | const val WATCH_HIS_SAVE = 1 //疗愈观看历史 |
| | | const val WATCH_HIS_COURSE = 2 //课程观看历史 |
| | |
| | | import android.content.Intent |
| | | import android.text.Editable |
| | | import android.text.TextWatcher |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | import cn.sinata.xldutils.utils.LengthFilter |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.PayDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.RechargeItem |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.H5Activity |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.home.PayResultActivity |
| | | import com.sinata.xqmuse.ui.mine.adapter.RechargeAdapter |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.NumberInputFilter |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.extention.clickDelay |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import com.sinata.xqmuse.utils.pay.PayListener |
| | | import com.sinata.xqmuse.utils.pay.PayUtil |
| | |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.sdk27.coroutines.onClick |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.startActivityForResult |
| | | import org.jetbrains.anko.toast |
| | | import java.lang.Exception |
| | | |
| | |
| | | |
| | | private fun pay(payType:Int,money:Double){ |
| | | toast("%s充值%.2f".format(if (payType == 1) "微信" else "支付宝",money)) |
| | | HttpManager.placeOrder(4,payType,2,money,null,null,null ) |
| | | .request(this){_,data-> |
| | | if (payType == 1){ |
| | | PayUtil.initWeChatPay(this,Const.WX_APP_ID) |
| | | PayUtil.weChatPay(data!!) |
| | | }else{ |
| | | PayUtil.aliPay(this,data?.orderInfo?:"") |
| | | } |
| | | } |
| | | onPaySuccess() |
| | | // HttpManager.payCourse(null,payType,3,null,money).request(this){ _, data-> |
| | | // HttpManager.pay(data?.id?:"",payType,3).request(this,false,success = {_,data-> |
| | | // if (payType == 2){ |
| | | // PayUtil.aliPay(this,data?.orderInfo?:"") |
| | | // }else{ |
| | | // PayUtil.initWeChatPay(this,Const.WX_APP_ID) |
| | | // PayUtil.weChatPay(data!!) |
| | | // } |
| | | // }){_,msg-> |
| | | // startActivityForResult<PayResultActivity>(1,"type" to PayResultActivity.TYPE_RECHARGE_FAILED,"msg" to msg) |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | override fun onPaySuccess() { |
| | |
| | | } |
| | | |
| | | override fun onPayError(msg: String) { |
| | | startActivityForResult<PayResultActivity>(1,"type" to PayResultActivity.TYPE_RECHARGE_FAILED) |
| | | } |
| | | |
| | | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
| | |
| | | override fun setContentView() = R.layout.activity_recharge_suc |
| | | |
| | | override fun initClick() { |
| | | tv_action.setOnClickListener { |
| | | onBackPressed() |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import android.content.Context |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import com.sinata.xqmuse.MainActivity |
| | |
| | | import com.sinata.xqmuse.ui.login.LoginActivity |
| | | import com.sinata.xqmuse.utils.CacheCleanUtil |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.download.DownloadUtil |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.extention.clickDelay |
| | | import kotlinx.android.synthetic.main.activity_setting.* |
| | |
| | | } |
| | | |
| | | tv_clear.setOnClickListener { |
| | | val tipDialog = TipDialog() |
| | | tipDialog.arguments = bundleOf("msg" to "是否清除应用缓存?") |
| | | tipDialog.setCallback(object : TipDialog.OnClickCallback { |
| | | override fun onOk() { |
| | | CacheCleanUtil.clearAllCache(this@SettingActivity) |
| | | toast("清理成功") |
| | | } |
| | | |
| | | override fun onCancel() { |
| | | } |
| | | }) |
| | | tipDialog.show(supportFragmentManager, "tip") |
| | | CacheCleanUtil.clearAllCache(this@SettingActivity) |
| | | toast("清理成功") |
| | | } |
| | | |
| | | tv_logout.setOnClickListener { |
| | | SPUtils.instance().put(Const.User.TOKEN,"").apply() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.SWITCH_HOME)) |
| | | SPUtils.instance().put(Const.User.TOKEN, "").apply() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.CHANGE_USER)) |
| | | startActivity<MainActivity>() |
| | | startActivity<LoginActivity>() |
| | | } |
| | | |
| | | tv_switch.setOnClickListener { |
| | | SPUtils.instance().put(Const.User.TOKEN,"").apply() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.SWITCH_HOME)) |
| | | startActivity<MainActivity>() |
| | | startActivity<LoginActivity>() |
| | | } |
| | |
| | | tv_about.setOnClickListener { |
| | | HttpManager.getH5(LoginRuleDialog.TYPE_ABOUT).request(this){ _, data-> |
| | | data?.let { |
| | | startActivity<H5Activity>("title" to "关于心泉","url" to it.content,"showClose" to false) |
| | | startActivity<H5Activity>( |
| | | "title" to "关于心泉", |
| | | "url" to it.content, |
| | | "showClose" to false |
| | | ) |
| | | } |
| | | } |
| | | } |
| | | |
| | | tv_update.clickDelay { |
| | | showDialog() |
| | | HttpManager.detailVersion().request(this){_,data-> |
| | | if (data?.versionNo.isNullOrEmpty()||data!!.versionNo > getAppVersion(this@SettingActivity)?:"") |
| | | toast("已经是最新版本") |
| | | else |
| | | TipDialog.show(supportFragmentManager,"当前有新版本,是否更新?",object :TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | DownloadUtil(this@SettingActivity).downloadAPK(data.androidFile, "泉疗愈") |
| | | toast("后台开始下载,请等待") |
| | | } |
| | | |
| | | override fun onCancel() { |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | titleBar.gone() |
| | | data = intent.getParcelableExtra("data") |
| | | tv_version.text = "当前版本:"+getAppVersion(this) |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取版本号 |
| | | * @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" |
| | | } |
| | | } |
| | | } |
| | |
| | | import android.webkit.WebChromeClient |
| | | import android.webkit.WebSettings |
| | | import android.webkit.WebViewClient |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.activity.BaseActivity |
| | | import com.github.zackratos.ultimatebar.UltimateBar |
| | | import com.share.utils.ShareUtils |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.ShareDialog |
| | | import com.sinata.xqmuse.network.Apis |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import com.umeng.socialize.bean.SHARE_MEDIA |
| | | import kotlinx.android.synthetic.main.activity_share.* |
| | | import org.jetbrains.anko.backgroundColor |
| | | |
| | | class ShareActivity:BaseActivity() { |
| | | private val userId by lazy { intent.getStringExtra("userId") } |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | | setContentView(R.layout.activity_share) |
| | |
| | | iv_back.setOnClickListener { finish() } |
| | | tv_action.setOnClickListener { |
| | | val shareDialog = ShareDialog() |
| | | shareDialog.arguments = bundleOf("isSave" to true) |
| | | shareDialog.callback = object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | if (rst == "wx"){ |
| | | ShareUtils.share(this@ShareActivity,SHARE_MEDIA.WEIXIN,"分享内容","分享标题",Apis.SHARE_APP.format(userId),null,"") |
| | | }else if (rst == "circle"){ |
| | | ShareUtils.share(this@ShareActivity,SHARE_MEDIA.WEIXIN_CIRCLE,"分享内容","分享标题",Apis.SHARE_APP.format(userId),null,"") |
| | | }else{ |
| | | |
| | | } |
| | | } |
| | | } |
| | | shareDialog.show(supportFragmentManager,"share") |
| | |
| | | "utf-8", |
| | | null |
| | | ) |
| | | iv_share.setImageURI(poster) |
| | | } |
| | | } |
| | | } |
| | |
| | | tv_ok.setOnClickListener { |
| | | HttpManager.deleteUser().request(this){_,_-> |
| | | val tipDialog = TipDialog() |
| | | tipDialog.arguments = bundleOf("msg" to "已提交注销申请,请耐心等待平台审核","isAlert" to true) |
| | | tipDialog.arguments = bundleOf("msg" to "注销成功","isAlert" to true) |
| | | tipDialog.showAllowingStateLoss(supportFragmentManager,"unregister") |
| | | tipDialog.setDismissCallback(object :TipDialog.OnDismiss{ |
| | | override fun onDismiss() { |
| | | SPUtils.instance().put(Const.User.TOKEN,"").apply() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.SWITCH_HOME)) |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.CHANGE_USER)) |
| | | startActivity<MainActivity>() |
| | | startActivity<LoginActivity>() |
| | | } |
| | |
| | | import android.os.Build |
| | | import android.os.Environment |
| | | import android.provider.Settings |
| | | import android.text.Editable |
| | | import android.text.TextWatcher |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.activity.SelectPhotoDialog |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.myToast |
| | |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivityForResult |
| | | |
| | | class UserInfoActivity:TransparentStatusBarActivity() { |
| | | class UserInfoActivity:TransparentStatusBarActivity(){ |
| | | override fun setContentView() = R.layout.activity_user_info |
| | | |
| | | private var userInfo:UserInfo? = null |
| | | private var changed = true |
| | | private var changed = false |
| | | |
| | | override fun initClick() { |
| | | iv_avatar.setOnClickListener { |
| | |
| | | ChoosSexDialog.show(supportFragmentManager,object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | userInfo?.gender = rst.toInt() |
| | | changed = true |
| | | tv_sex.text = if (userInfo?.gender == 1) "男" else if (userInfo?.gender == 2) "女" else if (userInfo?.gender == 3) "保密" else "" |
| | | } |
| | | }) |
| | | } |
| | | |
| | | tv_save.setOnClickListener { |
| | | updateInfo() |
| | | } |
| | | |
| | | tv_birth.clickDelay { |
| | | val chooseBirthDialog = ChooseBirthDialog() |
| | | chooseBirthDialog.arguments = bundleOf("data" to userInfo?.birthday) |
| | | chooseBirthDialog.setCallback(object : ChooseBirthDialog.Callback { |
| | | override fun onOk(s: String) { |
| | | userInfo?.birthday = s |
| | | changed = true |
| | | tv_birth.text = s |
| | | } |
| | | }) |
| | |
| | | } |
| | | |
| | | iv_back.setOnClickListener { |
| | | onBackPressed() |
| | | finish() |
| | | } |
| | | } |
| | | |
| | |
| | | data?.apply { |
| | | iv_avatar.setImageURI(avatar) |
| | | et_nick.setText(nickname) |
| | | et_name.setText("") //todo |
| | | et_name.setText(realname) |
| | | et_sign.setText(signature) |
| | | tv_sex.text = if (gender == 1) "男" else if (gender == 2) "女" else if (gender == 3) "保密" else "" |
| | | tv_birth.text = birthday |
| | |
| | | } |
| | | } |
| | | |
| | | override fun onBackPressed() { |
| | | if (changed) |
| | | TipDialog.show(supportFragmentManager,"是否保存修改?",object :TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | updateInfo() |
| | | } |
| | | |
| | | override fun onCancel() { |
| | | finish() |
| | | } |
| | | },"保存","不保存") |
| | | else |
| | | super.onBackPressed() |
| | | } |
| | | |
| | | |
| | | private fun updateInfo(){ |
| | | HttpManager.updateInfo(userInfo?.avatar,userInfo?.birthday,et_company.text.toString(),et_edu.text.toString(),et_mail.text.toString(),userInfo?.gender,et_homeland.text.toString(), |
| | | HttpManager.updateInfo(userInfo?.birthday,et_company.text.toString(),et_edu.text.toString(),et_mail.text.toString(),userInfo?.gender,et_homeland.text.toString(), |
| | | et_profess.text.toString(),et_location.text.toString(),et_nick.text.toString(),et_job.text.toString(),et_sign.text.toString(),et_name.text.toString()).request(this@UserInfoActivity,true){_,_-> |
| | | myToast("保存成功") |
| | | setResult(RESULT_OK) |
| | | finish() |
| | | } |
| | | } |
| | | |
| | | private fun updateAvatar(){ |
| | | HttpManager.updateUserAvatar(userInfo?.avatar?:"").request(this@UserInfoActivity,true){_,_-> |
| | | setResult(RESULT_OK) |
| | | } |
| | | } |
| | | |
| | |
| | | data.getStringExtra("path")!!.uploadWithCompress(this, object : StringCallback { |
| | | override fun onResult(rst: String) { |
| | | userInfo?.avatar = rst |
| | | updateAvatar() |
| | | iv_avatar.setImageURI(rst) |
| | | } |
| | | }) |
| | |
| | | import android.webkit.WebChromeClient |
| | | import android.webkit.WebSettings |
| | | import android.webkit.WebViewClient |
| | | import androidx.core.os.bundleOf |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.BuyRuleDialog |
| | | import com.sinata.xqmuse.dialog.PayDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.H5Activity |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.mine.adapter.VipPriceAdapter |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import com.sinata.xqmuse.utils.pay.PayListener |
| | | import com.sinata.xqmuse.utils.pay.PayUtil |
| | | import kotlinx.android.synthetic.main.activity_vip.* |
| | | import org.jetbrains.anko.backgroundResource |
| | | import org.jetbrains.anko.startActivityForResult |
| | | import org.jetbrains.anko.toast |
| | | |
| | | class VipActivity : TransparentStatusBarActivity() { |
| | | class VipActivity : TransparentStatusBarActivity(), PayListener { |
| | | override fun setContentView() = R.layout.activity_vip |
| | | |
| | | private val price = arrayListOf<Double>() |
| | |
| | | } |
| | | tv_rule.setOnClickListener { |
| | | HttpManager.getVipContent(2).request(this){ _, data-> |
| | | data?.let { |
| | | startActivityForResult<H5Activity>(1,"title" to "会员用户协议","url" to "","showClose" to true) |
| | | val buyRuleDialog = BuyRuleDialog() |
| | | buyRuleDialog.arguments = bundleOf("rule" to data,"title" to "会员用户协议") |
| | | buyRuleDialog.callback = object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | cb_rule.isChecked = rst == "ok" |
| | | } |
| | | } |
| | | buyRuleDialog.showAllowingStateLoss(supportFragmentManager,"rule") |
| | | } |
| | | } |
| | | |
| | | tv_action.setOnClickListener { |
| | | if (cb_rule.isChecked){ |
| | | |
| | | PayDialog.show(supportFragmentManager,object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | HttpManager.placeOrder(3,rst.toInt(),2,price[adapter.checked],null,null,adapter.checked+1 ) |
| | | .request(this@VipActivity){_,data-> |
| | | if (rst == "1"){ |
| | | PayUtil.initWeChatPay(this@VipActivity,Const.WX_APP_ID) |
| | | PayUtil.weChatPay(data!!) |
| | | }else{ |
| | | PayUtil.aliPay(this@VipActivity,data?.orderInfo?:"") |
| | | } |
| | | } |
| | | } |
| | | },enableBalance = false) |
| | | }else |
| | | toast("请阅读并同意《》") |
| | | toast("请阅读并同意《会员用户协议》") |
| | | } |
| | | } |
| | | |
| | |
| | | settings.layoutAlgorithm = WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING |
| | | webView.webChromeClient = object : WebChromeClient() {} |
| | | webView.webViewClient = object : WebViewClient() {} |
| | | PayUtil.addPayListener(this) |
| | | showVipInfo() |
| | | getPrice() |
| | | getH5() |
| | |
| | | data?.apply { |
| | | tv_vip.text = if (isVip == 2){ |
| | | bg_vip.backgroundResource = R.mipmap.no_vip |
| | | tv_describe.text = "升级为会员,解锁会员专属体验" |
| | | "你还未开通会员服务" |
| | | } else{ |
| | | bg_vip.backgroundResource = R.mipmap.bg_vip |
| | | "${vipExpireTime.substring(0,10)}到期" |
| | | tv_describe.text = "您将享受所有会员专享音频,尽情畅游心泉·疗愈世界" |
| | | "${vipExpireTime?.substring(0,10)}到期" |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | | super.onDestroy() |
| | | PayUtil.unregisterApp() |
| | | PayUtil.removePayListener(this) |
| | | } |
| | | |
| | | override fun onPaySuccess() { |
| | | showVipInfo() |
| | | } |
| | | |
| | | override fun onPayCancel() { |
| | | } |
| | | |
| | | override fun onPayError(msg: String) { |
| | | } |
| | | } |
| | |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.TipDialog |
| | | import com.sinata.xqmuse.dialog.WithdrawDialog |
| | | import com.sinata.xqmuse.network.Apis |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.H5Activity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.extention.clickDelay |
| | |
| | | |
| | | class WalletActivity : BaseActivity() { |
| | | private var balance = 0.0 |
| | | private val userId by lazy { intent.getStringExtra("userId") } |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | |
| | | tv_detail.setOnClickListener { |
| | | startActivity<BalanceDetailActivity>("balance" to balance) |
| | | } |
| | | tv_share.setOnClickListener { |
| | | startActivity<ShareActivity>("userId" to userId) |
| | | } |
| | | tv_push_list.setOnClickListener { |
| | | startActivity<H5Activity>("title" to "我的推荐","url" to Apis.PUSH_LIST.format(userId),"type" to 0) |
| | | } |
| | | } |
| | | |
| | | private fun withdraw(){ |
| | |
| | | override fun onBind(holder: ViewHolder, position: Int, data: Double) { |
| | | holder.setText(R.id.tv_name,if (position == 0) "月度会员" else if (position == 1) "季度会员" else "年度会员") |
| | | holder.setText(R.id.tv_price,SpanBuilder("¥%.2f".format(data)).size(0,1,15).build()) |
| | | holder.setText(R.id.tv_daily_price,"¥%.2f天".format(data/30)) |
| | | holder.setText(R.id.tv_daily_price,"¥%.2f/天".format(data/(if (position == 0)30 else if (position == 1) 90 else 365))) |
| | | val bg = holder.bind<View>(R.id.cl_bg) |
| | | val tvName = holder.bind<TextView>(R.id.tv_name) |
| | | val tvPrice = holder.bind<TextView>(R.id.tv_price) |
| | |
| | | tvDaily.textColorResource = R.color.textColor99 |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.tree |
| | | |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.Gift |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.tree.adapter.GiftRecordAdapter |
| | | import kotlinx.android.synthetic.main.layout_common_list.* |
| | | import org.jetbrains.anko.backgroundColorResource |
| | | |
| | | class ExchangeRecordActivity:TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.layout_common_list |
| | | |
| | | private var page = 1 |
| | | private val list = arrayListOf<Gift>() |
| | | private val adapter = GiftRecordAdapter(list) |
| | | |
| | | override fun initClick() { |
| | | } |
| | | |
| | | override fun initView() { |
| | | cl_root.backgroundColorResource = R.color.white |
| | | rv_list.layoutManager = LinearLayoutManager(this) |
| | | rv_list.adapter = adapter |
| | | refreshLayout.setOnRefreshListener { |
| | | page = 1 |
| | | getData() |
| | | } |
| | | refreshLayout.setOnLoadMoreListener { |
| | | page ++ |
| | | getData() |
| | | } |
| | | refreshLayout.autoRefresh() |
| | | } |
| | | |
| | | private fun getData(){ |
| | | HttpManager.exchangeRecordList(page).request(this,success = { _, data-> |
| | | if (page == 1) |
| | | list.clear() |
| | | list.addAll(data?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | if (list.isEmpty()){ |
| | | refreshLayout.finishRefreshWithNoMoreData() |
| | | } else if (data.isNullOrEmpty()) |
| | | refreshLayout.finishLoadMoreWithNoMoreData() |
| | | else if (page == 1) |
| | | refreshLayout.finishRefresh() |
| | | else |
| | | refreshLayout.finishLoadMore() |
| | | }){_,_-> |
| | | if (page == 1) |
| | | refreshLayout.finishRefresh(false) |
| | | else |
| | | refreshLayout.finishLoadMore(false) |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.tree |
| | | |
| | | import android.view.View |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.GiftSuccessDialog |
| | | import com.sinata.xqmuse.dialog.TipDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.Gift |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.tree.adapter.GiftAdapter |
| | | import kotlinx.android.synthetic.main.activity_gift.* |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.toast |
| | | |
| | | class GiftActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_gift |
| | | |
| | | private var page = 1 |
| | | private val list = arrayListOf<Gift>() |
| | | private val adapter = GiftAdapter(list) |
| | | private var power:Int? = null |
| | | private var code = "" |
| | | |
| | | override fun initClick() { |
| | | adapter.setOnItemClickListener { view, position -> |
| | | exchange(position) |
| | | } |
| | | } |
| | | |
| | | private fun exchange(position: Int) { |
| | | if (power == null) |
| | | return |
| | | val gift = list[position] |
| | | if (gift.receiveStatus==2){ |
| | | if (gift.energyValue > power?:0) |
| | | toast("兑换能量值不足") |
| | | else{ |
| | | TipDialog.show(supportFragmentManager,"是否确认使用 ${gift.energyValue} 能量值兑换当前礼品?兑换后系统将自动扣除能量值",object :TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | HttpManager.exchange(gift.id).request(this@GiftActivity){_,data-> |
| | | gift.receiveStatus = 1 |
| | | adapter.notifyItemChanged(position) |
| | | power = power!! - gift.energyValue |
| | | tv_total.text = power.toString() |
| | | GiftSuccessDialog.show(supportFragmentManager,data?:"",code) |
| | | } |
| | | } |
| | | |
| | | override fun onCancel() { |
| | | } |
| | | },cancel = "再想想") |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | titleBar.addRightButton("兑换记录",onClickListener = View.OnClickListener { |
| | | startActivity<ExchangeRecordActivity>() |
| | | }) |
| | | rv_list.layoutManager = LinearLayoutManager(this) |
| | | rv_list.adapter = adapter |
| | | refreshLayout.setOnRefreshListener { |
| | | page = 1 |
| | | getData() |
| | | } |
| | | refreshLayout.setOnLoadMoreListener { |
| | | page ++ |
| | | getData() |
| | | } |
| | | refreshLayout.autoRefresh() |
| | | getPower() |
| | | HttpManager.getQrCode().request(this){_,data-> |
| | | code = data?:"" |
| | | iv_code.setImageURI(data) |
| | | } |
| | | } |
| | | |
| | | private fun getPower() { |
| | | HttpManager.getTotalEnergyValue().request(this){_,data-> |
| | | power = data?:0 |
| | | tv_total.text = power.toString() |
| | | } |
| | | } |
| | | |
| | | private fun getData(){ |
| | | HttpManager.goodsList(page).request(this,success = { _, data-> |
| | | if (page == 1) |
| | | list.clear() |
| | | list.addAll(data?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | if (list.isEmpty()){ |
| | | refreshLayout.finishRefreshWithNoMoreData() |
| | | } else if (data.isNullOrEmpty()) |
| | | refreshLayout.finishLoadMoreWithNoMoreData() |
| | | else if (page == 1) |
| | | refreshLayout.finishRefresh() |
| | | else |
| | | refreshLayout.finishLoadMore() |
| | | }){_,_-> |
| | | if (page == 1) |
| | | refreshLayout.finishRefresh(false) |
| | | else |
| | | refreshLayout.finishLoadMore(false) |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.tree |
| | | |
| | | import androidx.fragment.app.Fragment |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_power.* |
| | | |
| | | class PowerActivity:TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_power |
| | | |
| | | private val power by lazy { intent.getIntExtra("power",0) } |
| | | |
| | | override fun initClick() { |
| | | } |
| | | |
| | | override fun initView() { |
| | | tv_total.text = power.toString() |
| | | val frags = arrayListOf<Fragment>() |
| | | frags.add(PowerDetailFragment.newInstance(PowerDetailFragment.STATE_ALL)) |
| | | frags.add(PowerDetailFragment.newInstance(PowerDetailFragment.STATE_INCOME)) |
| | | frags.add(PowerDetailFragment.newInstance(PowerDetailFragment.STATE_REDUCE)) |
| | | tab_bar.setViewPager(view_pager, arrayOf("全部","增加","扣除"),this,frags) |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.tree |
| | | |
| | | import androidx.core.os.bundleOf |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.PowerDetail |
| | | import com.sinata.xqmuse.network.entity.WalletDetail |
| | | import com.sinata.xqmuse.network.requestByF |
| | | import com.sinata.xqmuse.ui.mine.adapter.WalletAdapter |
| | | import com.sinata.xqmuse.ui.tree.adapter.PowerAdapter |
| | | import kotlinx.android.synthetic.main.layout_common_list.* |
| | | import org.jetbrains.anko.backgroundColorResource |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | |
| | | class PowerDetailFragment:BaseFragment() { |
| | | override fun contentViewId() = R.layout.layout_common_list |
| | | |
| | | private val state by lazy { arguments?.getInt("state",1)?:1 } |
| | | private var page = 1 |
| | | private val list = arrayListOf<PowerDetail>() |
| | | private val adapter = PowerAdapter(list) |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | cl_root.backgroundColorResource = R.color.white |
| | | rv_list.layoutManager = LinearLayoutManager(requireContext()) |
| | | rv_list.adapter = adapter |
| | | refreshLayout.setOnRefreshListener { |
| | | page = 1 |
| | | getData() |
| | | } |
| | | refreshLayout.setOnLoadMoreListener { |
| | | page ++ |
| | | getData() |
| | | } |
| | | refreshLayout.autoRefresh() |
| | | } |
| | | |
| | | private fun getData(){ |
| | | HttpManager.energyDetail(page,state).requestByF(this,success = { _, data-> |
| | | if (page == 1) |
| | | list.clear() |
| | | list.addAll(data?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | if (list.isEmpty()){ |
| | | refreshLayout.finishRefreshWithNoMoreData() |
| | | } else if (data.isNullOrEmpty()) |
| | | refreshLayout.finishLoadMoreWithNoMoreData() |
| | | else if (page == 1) |
| | | refreshLayout.finishRefresh() |
| | | else |
| | | refreshLayout.finishLoadMore() |
| | | }){_,_-> |
| | | if (page == 1) |
| | | refreshLayout.finishRefresh(false) |
| | | else |
| | | refreshLayout.finishLoadMore(false) |
| | | } |
| | | } |
| | | |
| | | companion object{ |
| | | const val STATE_ALL = 1 |
| | | const val STATE_INCOME = 2 |
| | | const val STATE_REDUCE = 3 |
| | | |
| | | fun newInstance(state:Int):PowerDetailFragment{ |
| | | val walletDetailFragment = PowerDetailFragment() |
| | | walletDetailFragment.arguments = bundleOf("state" to state) |
| | | return walletDetailFragment |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.sinata.xqmuse.ui.tree |
| | | |
| | | import android.animation.ValueAnimator |
| | | import android.content.res.Resources |
| | | import android.graphics.drawable.Drawable |
| | | import android.util.Log |
| | | import androidx.vectordrawable.graphics.drawable.Animatable2Compat |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.visible |
| | | import com.github.penfeizhou.animation.apng.APNGDrawable |
| | | import com.google.android.material.bottomsheet.BottomSheetBehavior |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.TreeTipDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.TreeInfo |
| | | import com.sinata.xqmuse.network.requestByF |
| | | import com.sinata.xqmuse.ui.H5Activity |
| | | import com.sinata.xqmuse.utils.AudioUtils |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.ScreenUtil |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.extention.clickDelay |
| | | import kotlinx.android.synthetic.main.fragment_tree.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.support.v4.dip |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | import org.jetbrains.anko.support.v4.toast |
| | | import kotlin.math.max |
| | | |
| | | class TreeFragment : BaseFragment() { |
| | | override fun contentViewId() = R.layout.fragment_tree |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | private val behavior by lazy { |
| | | BottomSheetBehavior.from(bottom) |
| | | } |
| | | |
| | | private val audioPlayer by lazy { AudioUtils() } //音频播放 |
| | | private var tree:TreeInfo? = null |
| | | //常量 |
| | | val GROWTH_ANIM_DURATION = 500L |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | //用于处理当虚拟导航栏存在时,BottomSheetBehavior窥视高度不对的问题 |
| | | val virtualBarHeigh = ScreenUtil().getVirtualBarHeigh(activity) |
| | | Log.e("虚拟导航栏高度", "$virtualBarHeigh") |
| | | val navigationBarHeight = getNavigationBarHeight() |
| | | Log.e("导航栏高度", "$navigationBarHeight") |
| | | if (virtualBarHeigh >= getNavigationBarHeight()) //如果虚拟导航栏高度大于或等于导航栏高度,说明虚拟导航栏在显示,需要减去导航栏的高度 |
| | | behavior.setPeekHeight(dip(63) - getNavigationBarHeight(), true) |
| | | else |
| | | behavior.setPeekHeight(dip(63), true) |
| | | tv_rule.setOnClickListener { |
| | | HttpManager.getH5(6).requestByF(this){ _, data-> |
| | | data?.let { |
| | | startActivity<H5Activity>("title" to "规则说明","url" to it.content,"showClose" to false) |
| | | } |
| | | } |
| | | } |
| | | tv_sign.clickDelay { |
| | | HttpManager.sign().requestByF(this){_,data-> |
| | | tv_sign.isEnabled = false |
| | | tv_sign.text = "已签到" |
| | | tree?.energyValue = (tree?.energyValue?:0)+10 |
| | | tree?.totalEnergyValue = (tree?.totalEnergyValue?:0)+10 |
| | | tv_power.text = "当前能量值:${(tree?.energyValue?:0)}" |
| | | signed.visible() |
| | | signed.postDelayed({signed.gone()},1500) |
| | | } |
| | | } |
| | | tv_to_think.setOnClickListener { |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.SWITCH_HOME)) |
| | | } |
| | | tv_to_think_2.setOnClickListener { |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.SWITCH_HOME)) |
| | | } |
| | | iv_water.clickDelay { |
| | | // showWater() |
| | | // tree?.energyValue = 0 |
| | | // tree!!.treeLevelType++ |
| | | // showTreeAnim(tree!!.getTreeApng(),true) |
| | | // audioPlayer.startPlayMusic(requireContext(),tree!!.getLevelUpAudio()) |
| | | // TreeTipDialog.show(childFragmentManager,"升级","恭喜!你的树苗已升级为${tree!!.getLevelName()}阶段!") |
| | | |
| | | if (tree?.energyValue == 0) |
| | | toast("能量值不足") |
| | | // else if (tree?.status == 1) |
| | | // toast("树苗已枯萎,请重新播种") |
| | | else if (tree?.sowAgain == 1) |
| | | toast("树苗已成熟,请重新播种") |
| | | else |
| | | HttpManager.watering().requestByF(this){_,data-> |
| | | data?.apply { |
| | | tv_max.text = "/$nextLevel" |
| | | tv_growth.text = growthValue.toString() |
| | | val targetHeight = growthValue.toDouble()/nextLevel*dip(155) |
| | | val layoutParams = progress.layoutParams |
| | | showGrowthAnim(layoutParams.height, max(1,targetHeight.toInt())) |
| | | showWater() |
| | | tree?.energyValue = 0 |
| | | tv_power.text = "当前能量值:${(tree?.energyValue?:0)}" |
| | | if (isNext){ |
| | | tree!!.treeLevelType++ |
| | | showTreeAnim(tree!!.getTreeApng(),true) |
| | | audioPlayer.startPlayMusic(requireContext(),tree!!.getLevelUpAudio()) |
| | | TreeTipDialog.show(childFragmentManager,"升级","恭喜!你的树苗已升级为${tree!!.getLevelName()}阶段!") |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | tv_power.setOnClickListener { |
| | | startActivity<PowerActivity>("power" to tree?.totalEnergyValue) |
| | | } |
| | | |
| | | tv_gif.setOnClickListener { |
| | | startActivity<GiftActivity>() |
| | | } |
| | | |
| | | tv_again.setOnClickListener { |
| | | HttpManager.restart().requestByF(this){_,_-> |
| | | getTree() |
| | | } |
| | | } |
| | | |
| | | //MediaPlayer,IjkPlayer |
| | | // val am = resources.assets |
| | | // var afd: AssetFileDescriptor? = null |
| | | // try { |
| | | // afd = am.openFd("bg_tree.mp4") |
| | | // } catch (e: IOException) { |
| | | // e.printStackTrace() |
| | | // } |
| | | // player.setAssetFileDescriptor(afd) |
| | | |
| | | val url = "android.resource://" + requireContext().packageName.toString() + "/" + R.raw.bg |
| | | player.setUrl(url) |
| | | player.setLooping(true) |
| | | player.start() |
| | | showSunshine() |
| | | checkFirst() |
| | | // getTree() |
| | | } |
| | | |
| | | private fun checkFirst() { |
| | | HttpManager.isFirst().requestByF(this){_,data-> |
| | | if (data == true){ |
| | | TreeTipDialog.show(childFragmentManager) |
| | | audioPlayer.startPlayMusic(requireContext(),Const.TREE.first) |
| | | } |
| | | } |
| | | } |
| | | |
| | | fun getTree(){ |
| | | HttpManager.getUserTree().requestByF(this){_,data-> |
| | | val changed = data?.treeLevelType != tree?.treeLevelType //等级发生变化 |
| | | tree = data |
| | | data?.apply { |
| | | tv_power.text = "当前能量值:${energyValue}" |
| | | tv_max.text = "/$nextLevel" |
| | | tv_growth.text = growthValue.toString() |
| | | val targetHeight = growthValue.toDouble()/nextLevel*dip(155) |
| | | val layoutParams = progress.layoutParams |
| | | showGrowthAnim(layoutParams.height, max(1,targetHeight.toInt())) |
| | | tv_sign.isEnabled = isSign == 2 |
| | | tv_sign.text = if (tv_sign.isEnabled) "打卡签到" else "已签到" |
| | | tv_to_think.isEnabled = taskOne == 2 |
| | | tv_to_think_2.isEnabled = taskTwo == 2 |
| | | if (status == 2){ |
| | | if (changed) |
| | | showTreeAnim(getTreeApng(),treeLevelType != 1) |
| | | } else |
| | | showTreeDead() |
| | | } |
| | | } |
| | | } |
| | | |
| | | private fun showTreeDead() { |
| | | iv_tree.setImageResource(tree!!.getTreeDead()) |
| | | // tv_again.visible() |
| | | } |
| | | |
| | | /** |
| | | * 成长值动画 |
| | | */ |
| | | private fun showGrowthAnim(start:Int,end:Int){ |
| | | val ofInt = ValueAnimator.ofInt(start, end) |
| | | ofInt.duration = GROWTH_ANIM_DURATION |
| | | ofInt.addUpdateListener { |
| | | val layoutParams = progress.layoutParams |
| | | layoutParams.height = it.animatedValue as Int |
| | | progress.layoutParams = layoutParams |
| | | } |
| | | ofInt.start() |
| | | } |
| | | |
| | | private fun showWater(){ |
| | | val apngDrawable = APNGDrawable.fromAsset(requireContext(),"apngb_water.png") |
| | | iv_water_anim.setImageDrawable(apngDrawable) |
| | | apngDrawable.setLoopLimit(2) |
| | | apngDrawable.registerAnimationCallback(object :Animatable2Compat.AnimationCallback(){ |
| | | override fun onAnimationEnd(drawable: Drawable?) { |
| | | super.onAnimationEnd(drawable) |
| | | iv_water_anim.setImageResource(0) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | private fun showSunshine(){ |
| | | val apngDrawable = APNGDrawable.fromAsset(requireContext(),"sunshine.png") |
| | | iv_sunshine.setImageDrawable(apngDrawable) |
| | | // apngDrawable.setLoopLimit(5) |
| | | } |
| | | |
| | | private fun showTreeAnim(resStr:String,isLoop:Boolean){ |
| | | val apngDrawable = APNGDrawable.fromAsset(requireContext(),resStr) |
| | | iv_tree.setImageDrawable(apngDrawable) |
| | | apngDrawable.setLoopLimit(if (isLoop) -1 else 1) |
| | | if (tree?.treeLevelType?:0 >= 10) |
| | | tv_again.visible() |
| | | else |
| | | tv_again.gone() |
| | | } |
| | | |
| | | override fun onPause() { |
| | | super.onPause() |
| | | player?.pause() |
| | | } |
| | | |
| | | override fun onResume() { |
| | | super.onResume() |
| | | player?.resume() |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | | super.onDestroy() |
| | | player?.release() |
| | | } |
| | | |
| | | private fun getNavigationBarHeight(): Int { |
| | | val resources: Resources = activity!!.getResources() |
| | | 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" |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.tree.adapter |
| | | |
| | | import android.view.View |
| | | import cn.sinata.xldutils.adapter.HFRecyclerAdapter |
| | | import cn.sinata.xldutils.adapter.util.ViewHolder |
| | | import com.facebook.drawee.view.SimpleDraweeView |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.entity.Gift |
| | | import java.util.ArrayList |
| | | |
| | | class GiftAdapter(list: ArrayList<Gift>):HFRecyclerAdapter<Gift>(list, R.layout.item_gift) { |
| | | override fun onBind(holder: ViewHolder, position: Int, data: Gift) { |
| | | holder.bind<SimpleDraweeView>(R.id.iv_cover).setImageURI(data.coverUrl) |
| | | val root = holder.bind<View>(R.id.cl_root) |
| | | holder.setText(R.id.tv_name,data.name) |
| | | holder.setText(R.id.tv_price,"奖品价值:¥%.2f".format(data.worth)) |
| | | holder.setText(R.id.tv_power,"所需能量值:%d".format(data.energyValue)) |
| | | holder.bind<View>(R.id.iv_used).visibility = if (data.receiveStatus == 1){ |
| | | root.alpha = 0.6f |
| | | View.VISIBLE |
| | | } else{ |
| | | root.alpha = 1f |
| | | View.GONE |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.tree.adapter |
| | | |
| | | import android.widget.TextView |
| | | import cn.sinata.xldutils.adapter.HFRecyclerAdapter |
| | | import cn.sinata.xldutils.adapter.util.ViewHolder |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.visible |
| | | import com.facebook.drawee.view.SimpleDraweeView |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.entity.Gift |
| | | import org.jetbrains.anko.backgroundResource |
| | | import java.util.ArrayList |
| | | |
| | | class GiftRecordAdapter(list: ArrayList<Gift>):HFRecyclerAdapter<Gift>(list, R.layout.item_gift_record) { |
| | | override fun onBind(holder: ViewHolder, position: Int, data: Gift) { |
| | | holder.bind<SimpleDraweeView>(R.id.iv_cover).setImageURI(data.coverUrl) |
| | | val tv_state = holder.bind<TextView>(R.id.tv_state) |
| | | val tv_code = holder.bind<TextView>(R.id.tv_code) |
| | | holder.setText(R.id.tv_name,data.name) |
| | | holder.setText(R.id.tv_price,"奖品价值:¥%.2f".format(data.worth)) |
| | | holder.setText(R.id.tv_power,"所需能量值:%d".format(data.energyValue)) |
| | | if (data.status == 2){ //1待领取 2已领取 |
| | | tv_code.gone() |
| | | tv_state.text = "已领取" |
| | | tv_state.backgroundResource = R.drawable.bg_gift_grey |
| | | }else{ |
| | | tv_code.visible() |
| | | tv_state.text = "待领取" |
| | | tv_state.backgroundResource = R.drawable.bg_gift_green |
| | | tv_code.text = "领取验证码:${data.code}" |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.tree.adapter |
| | | |
| | | import android.widget.TextView |
| | | import cn.sinata.xldutils.adapter.HFRecyclerAdapter |
| | | import cn.sinata.xldutils.adapter.util.ViewHolder |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.entity.PowerDetail |
| | | import org.jetbrains.anko.textColorResource |
| | | import java.util.ArrayList |
| | | |
| | | class PowerAdapter(list: ArrayList<PowerDetail>):HFRecyclerAdapter<PowerDetail>(list, R.layout.item_wallet) { |
| | | override fun onBind(holder: ViewHolder, position: Int, data: PowerDetail) { |
| | | val bind = holder.bind<TextView>(R.id.tv_money) |
| | | holder.setText(R.id.tv_reason,data.reason) |
| | | holder.setText(R.id.tv_time,data.createTime) |
| | | bind.text = "%s%d".format(if (data.changeType == 1)"+" else "-",data.energyValue) |
| | | bind.textColorResource = if (data.changeType == 1) R.color.colorRed else R.color.textColor |
| | | bind.setCompoundDrawablesWithIntrinsicBounds(0,0,0,0) |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | private float volume = 0.5f; //播放音量 |
| | | |
| | | private String audio = "";//音源 |
| | | |
| | | /** |
| | | * 文件存储默认sdcard/record |
| | | */ |
| | |
| | | public void onStartPlay(); |
| | | |
| | | public void onFinishPlay(); |
| | | |
| | | public void onGetDuration(int duration); |
| | | } |
| | | |
| | | //开始播放录音 |
| | | |
| | | /** |
| | | * 开始播放音频 |
| | | * @param context |
| | | * @param filePath |
| | | */ |
| | | public void startPlayMusic(Context context, String filePath) { |
| | | if (mMediaPlayer != null) { |
| | | stopPlayMusic(); |
| | | } |
| | | mMediaPlayer = new MediaPlayer(); |
| | | mMediaPlayer.setVolume(volume,volume); |
| | | try { |
| | | Log.e("mmp", "path:" + filePath); |
| | | mMediaPlayer.setDataSource(context, Uri.parse(filePath)); |
| | | mMediaPlayer.prepareAsync(); |
| | | mMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { |
| | | @Override |
| | | public void onPrepared(MediaPlayer mp) { |
| | | // 装载完毕回调 |
| | | mMediaPlayer.start(); |
| | | if (audioStatusUpdateListener != null){ |
| | | audioStatusUpdateListener.onGetDuration(mMediaPlayer.getDuration()); |
| | | audioStatusUpdateListener.onStartPlay(); |
| | | } |
| | | } |
| | | |
| | | |
| | | }); |
| | | mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { |
| | | @Override |
| | | public void onCompletion(MediaPlayer mp) { |
| | | stopPlayMusic(); |
| | | // BaseEvent baseEvent = new BaseEvent(BaseEvent.SEND_AODIO_PLAY_OVER); |
| | | // baseEvent.setMsg(filePath); |
| | | // EventBus.getDefault().post(baseEvent); |
| | | } |
| | | }); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 循环播放音频 |
| | | * @param context |
| | | * @param filePath |
| | | */ |
| | | public void loopPlayMusic(Context context, String filePath) { |
| | | if (mMediaPlayer != null) { |
| | | stopPlayMusic(); |
| | | } |
| | |
| | | mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { |
| | | @Override |
| | | public void onCompletion(MediaPlayer mp) { |
| | | stopPlayMusic(); |
| | | // BaseEvent baseEvent = new BaseEvent(BaseEvent.SEND_AODIO_PLAY_OVER); |
| | | // baseEvent.setMsg(filePath); |
| | | // EventBus.getDefault().post(baseEvent); |
| | | mMediaPlayer.start(); |
| | | } |
| | | }); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public void pause(){ |
| | | if (mMediaPlayer != null) { |
| | | mMediaPlayer.pause(); |
| | | } |
| | | } |
| | | |
| | | public void resume(){ |
| | | if (mMediaPlayer != null) { |
| | | mMediaPlayer.start(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public int getCurrentPosition(){ |
| | | if (mMediaPlayer!=null){ |
| | | return mMediaPlayer.getCurrentPosition(); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | //结束录音播放 |
| | | public void stopPlayMusic() { |
| | | if (mMediaPlayer == null) |
| | |
| | | try { |
| | | mMediaPlayer.stop(); |
| | | mMediaPlayer.release(); |
| | | mMediaPlayer = null; |
| | | if (audioStatusUpdateListener != null) |
| | | audioStatusUpdateListener.onFinishPlay(); |
| | | mMediaPlayer = null; |
| | | } catch (IllegalStateException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | * 一些常量等。 |
| | | */ |
| | | object Const { |
| | | const val Tag = "JKLog" |
| | | const val Tag = "XQLog" |
| | | const val PAGE_SIZE = 20 //列表页大小 |
| | | //各类第三方key |
| | | const val UMENG_KEY = "6620bc0fcac2a664de1f77eb" |
| | | const val WX_APP_ID = "wxe376c3189895ec7e" |
| | | const val WX_SECRET = "bd3ce1f17193b702ac13c9eeae2a2ca0" |
| | | const val WX_APP_ID = "wx4b9c1d814c2902a3" |
| | | const val WX_SECRET = "60fed4b6f52603ba6769e1118b4a57ae" |
| | | const val QQ_APP_ID = "101912859" |
| | | const val QQ_SECRET = "692a092b65a6ec830fb62d1dc2270813" |
| | | |
| | | const val APP_KEY = "BT7NPhA0f775uzcUuftWjCE1TYZlWmHZ" //接口秘钥 |
| | | |
| | | const val FIRST_LAUNCH = "isFirst" |
| | | |
| | | val OSS_DOMAIN = "https://xqgwzh.obs.cn-south-1.myhuaweicloud.com/" |
| | | |
| | | object TREE { |
| | | val first = OSS_DOMAIN+"xinquan/1d3254a9966b476789491032d8bb908a.wav" |
| | | val LEVEL_2 = OSS_DOMAIN+"xinquan/d8daa4d5490f40f9a68a8469ad697660.wav" |
| | | val LEVEL_3 = OSS_DOMAIN+"xinquan/0da0e117c4374c398347c480d2cfc6b4.wav" |
| | | val LEVEL_4 = OSS_DOMAIN+"xinquan/6160ba07229a486da93880ac19db3768.wav" |
| | | val LEVEL_5 = OSS_DOMAIN+"xinquan/1998498217564da7b3336fa867b5255d.wav" |
| | | val LEVEL_6 = OSS_DOMAIN+"xinquan/d829bf1c7b544a83a7a09b5dfab3226d.wav" |
| | | val LEVEL_7 = OSS_DOMAIN+"xinquan/0407fe616cd34ef0bffcd1d57520cd20.wav" |
| | | val LEVEL_8 = OSS_DOMAIN+"xinquan/d3980143fbc14f86b635efd05f05c24e.wav" |
| | | val LEVEL_9 = OSS_DOMAIN+"xinquan/b7bb109fc64f49e481013fe1c8f4693e.wav" |
| | | val LEVEL_10 = OSS_DOMAIN+"xinquan/8b0303829a6547f5a16c5232883b94cc.wav" |
| | | } |
| | | |
| | | object User { |
| | | const val TOKEN = "token" |
| | |
| | | const val USER_NAME = "userName" |
| | | const val USER_PWD = "pwd" |
| | | const val USER_PHONE = "userPhone" |
| | | const val SEARCH_HIS = "SEARCH_HIS" |
| | | const val SEARCH_HIS_HOME = "SEARCH_HIS_HOME" |
| | | const val SEARCH_HIS_COURSE = "SEARCH_HIS_COURSE" |
| | | const val ANSWER = "answers" |
| | | const val VOLUME = "VOLUME" |
| | | const val VOLUME_THINK = "VOLUME_THINK" //冥想音量 |
| | | const val BGM = "BGM" |
| | | const val BG = "BG" |
| | | const val IS_RECYCLE = "IS_RECYCLE" |
| | | const val LOCATION_REFUSED = "LOCATION_REFUSED" |
| | | } |
| | | |
| | | |
| | | object EventCode{ |
| | | const val CHANGE_STAR = 0x01 //更换星座 |
| | | const val CHANGE_USER = 0x01 //换角色 |
| | | const val REFRESH_COURSE = 0x02 //刷新课程 |
| | | const val USER_INFO_CHANGED = 0x03 //用户信息改变首页调取接口 |
| | | const val SWITCH_HOME = 0x04 //切换到首页 |
| | | |
| | | const val CHANGE_STARTCLASS = 0x05 //首页跳转到开始上课 |
| | | const val SWITCH_COURSE = 0x05 //首页跳转到课橙 |
| | | |
| | | const val CHANGE_COURSDATA = 0x08 //刷新开始上课的数据 |
| | | const val CHANGE_BGM = 0x08 //刷新首页背景音乐设置 |
| | | |
| | | const val SWITCH_DISCOVERY = 0x0A //首页跳转到使用福利 |
| | | const val CHANGE_EXPLORE = 0x0C //首页跳转到探索玩湃 |
| | |
| | | const val REFRESH_WALLET = 0x12 //刷新钱包 |
| | | |
| | | const val PRELOADED = 0x13 //预加载成功 |
| | | const val PAUSE_TEACHER_VIDEO = 0x14 //停止播放导师视频 |
| | | const val APP_FOREGROUND = 0x15 //回到前台 |
| | | const val APP_BACKGROUND = 0x16 //退到后台 |
| | | |
| | | const val THINK_TIMER = 0x17 //冥想定时 |
| | | const val PAUSE_OR_RESUME_THINK = 0x18 //暂停或继续冥想 |
| | | const val START_THINK = 0x19 //开始冥想 |
| | | const val FINISH_THINK = 0x1A //停止冥想 |
| | | const val CHANGE_THINK_VOLUME = 0x1B //调整音量 |
| | | const val GOT_THINK_DURATION = 0x1C //获取到音频总长度 |
| | | const val GOT_THINK_POSITION = 0x1D //获取到音频位置 |
| | | |
| | | const val START_GUIDE_AUDIO = 0x1E //开始引导音 |
| | | const val FINISH_GUIDE_AUDIO = 0x1F //停止引导音 |
| | | const val REFRESH_PRIVATE = 0x20 //刷新私人定制 |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.utils; |
| | | |
| | | import android.content.Context; |
| | | import android.content.res.Resources; |
| | | import android.util.DisplayMetrics; |
| | | import android.view.Display; |
| | | import android.view.WindowManager; |
| | | |
| | | import java.lang.reflect.Method; |
| | | |
| | | public class ScreenUtil { |
| | | /** |
| | | * 获取是否存在NavigationBar |
| | | * @param context |
| | | * @return |
| | | */ |
| | | public boolean checkDeviceHasNavigationBar(Context context) { |
| | | boolean hasNavigationBar = false; |
| | | Resources rs = context.getResources(); |
| | | int id = rs.getIdentifier("config_showNavigationBar", "bool", "android"); |
| | | if (id > 0) { |
| | | hasNavigationBar = rs.getBoolean(id); |
| | | } |
| | | try { |
| | | Class systemPropertiesClass = Class.forName("android.os.SystemProperties"); |
| | | Method m = systemPropertiesClass.getMethod("get", String.class); |
| | | String navBarOverride = (String) m.invoke(systemPropertiesClass, "qemu.hw.mainkeys"); |
| | | if ("1".equals(navBarOverride)) { |
| | | hasNavigationBar = false; |
| | | } else if ("0".equals(navBarOverride)) { |
| | | hasNavigationBar = true; |
| | | } |
| | | } catch (Exception e) { |
| | | } |
| | | return hasNavigationBar; |
| | | } |
| | | /** |
| | | * 获取虚拟功能键高度 |
| | | * @param context |
| | | * @return |
| | | */ |
| | | public int getVirtualBarHeigh(Context context) { |
| | | int vh = 0; |
| | | WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); |
| | | Display display = windowManager.getDefaultDisplay(); |
| | | DisplayMetrics dm = new DisplayMetrics(); |
| | | try { |
| | | @SuppressWarnings("rawtypes") |
| | | Class c = Class.forName("android.view.Display"); |
| | | @SuppressWarnings("unchecked") |
| | | Method method = c.getMethod("getRealMetrics", DisplayMetrics.class); |
| | | method.invoke(display, dm); |
| | | vh = dm.heightPixels - windowManager.getDefaultDisplay().getHeight(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return vh; |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.utils.download; |
| | | |
| | | import android.database.ContentObserver; |
| | | import android.net.Uri; |
| | | |
| | | /** |
| | | * Created by ts_xiaoA on 2019/12/2 16:05 |
| | | * E-Mail Address:443502578@qq.com |
| | | * Desc: |
| | | */ |
| | | public class DownloadObserver extends ContentObserver { |
| | | |
| | | private OnChangedCallback onChangedCallback; |
| | | |
| | | public DownloadObserver() { |
| | | super(null); |
| | | } |
| | | |
| | | @Override |
| | | public void onChange(boolean selfChange, Uri uri) { |
| | | super.onChange(selfChange, uri); |
| | | if (onChangedCallback != null) { |
| | | onChangedCallback.onChanged(selfChange, uri); |
| | | } |
| | | } |
| | | |
| | | public interface OnChangedCallback { |
| | | void onChanged(boolean selfChange, Uri uri); |
| | | } |
| | | |
| | | public void setOnChangedCallback(OnChangedCallback onChangedCallback) { |
| | | this.onChangedCallback = onChangedCallback; |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.utils.download; |
| | | |
| | | import android.app.DownloadManager; |
| | | import android.content.BroadcastReceiver; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.content.IntentFilter; |
| | | import android.database.Cursor; |
| | | import android.net.Uri; |
| | | import android.os.Environment; |
| | | import android.util.Log; |
| | | import android.widget.Toast; |
| | | |
| | | |
| | | /** |
| | | * Created by ts_xiaoA on 2019/12/2 14:35 |
| | | * E-Mail Address:443502578@qq.com |
| | | * Desc: |
| | | */ |
| | | public class DownloadUtil { |
| | | |
| | | //下载器 |
| | | private DownloadManager downloadManager; |
| | | //上下文 |
| | | private Context mContext; |
| | | //下载的ID |
| | | private long downloadId; |
| | | //进度变化监听 |
| | | private OnProgressListener onProgressChanged; |
| | | //下载进度观察者 |
| | | private DownloadObserver downloadObserver; |
| | | |
| | | public DownloadUtil(Context context) { |
| | | this(context, null); |
| | | } |
| | | |
| | | public DownloadUtil(Context mContext, OnProgressListener onChangedCallback) { |
| | | this.mContext = mContext; |
| | | this.onProgressChanged = onChangedCallback; |
| | | } |
| | | |
| | | //下载apk |
| | | public void downloadAPK(String url, String name) { |
| | | //创建下载任务 |
| | | DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); |
| | | //移动网络情况下是否允许漫游 |
| | | request.setAllowedOverRoaming(false); |
| | | |
| | | //在通知栏中显示,默认就是显示的 |
| | | request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE); |
| | | request.setTitle(name); |
| | | request.setDescription(name); |
| | | request.setVisibleInDownloadsUi(true); |
| | | //设置下载的路径 |
| | | request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, name); |
| | | |
| | | //获取DownloadManager |
| | | downloadManager = (DownloadManager) mContext.getSystemService(Context.DOWNLOAD_SERVICE); |
| | | //将下载请求加入下载队列,加入下载队列后会给该任务返回一个long型的id,通过该id可以取消任务,重启任务、获取下载的文件等等 |
| | | downloadId = downloadManager.enqueue(request); |
| | | //注册广播接收者,监听下载状态 |
| | | mContext.registerReceiver(receiver, |
| | | new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE)); |
| | | //添加监听 |
| | | if (onProgressChanged != null) { |
| | | Uri uriForDownloadedFile = Uri.parse("content://downloads/"); |
| | | downloadObserver = new DownloadObserver(); |
| | | downloadObserver.setOnChangedCallback((selfChange, uri) -> { |
| | | DownloadManager.Query query = new DownloadManager.Query(); |
| | | Cursor cursor = downloadManager.query(query); |
| | | cursor.moveToFirst(); |
| | | int bytes_downloaded = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR)); |
| | | int bytes_total = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_TOTAL_SIZE_BYTES)); |
| | | double progress = ((double) bytes_downloaded * 100) / (double) bytes_total; |
| | | Log.i("TAG", "bytes_downloaded: DX"+bytes_downloaded); |
| | | Log.i("TAG", "bytes_total: DX"+bytes_total); |
| | | Log.i("TAG", "progress: DX"+progress); |
| | | cursor.close(); |
| | | onProgressChanged.onProgressChanged((int) progress); |
| | | }); |
| | | mContext.getContentResolver().registerContentObserver(uriForDownloadedFile, true, downloadObserver); |
| | | } |
| | | } |
| | | |
| | | //广播监听下载的各个状态 |
| | | private BroadcastReceiver receiver = new BroadcastReceiver() { |
| | | @Override |
| | | public void onReceive(Context context, Intent intent) { |
| | | checkStatus(); |
| | | Log.e("onReceive", "onReceive: >>>>>>>>>>>>下载中"); |
| | | } |
| | | }; |
| | | |
| | | |
| | | //检查下载状态 |
| | | private void checkStatus() { |
| | | DownloadManager.Query query = new DownloadManager.Query(); |
| | | //通过下载的id查找 |
| | | query.setFilterById(downloadId); |
| | | Cursor c = downloadManager.query(query); |
| | | if (c.moveToFirst()) { |
| | | int status = c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS)); |
| | | switch (status) { |
| | | //下载暂停 |
| | | case DownloadManager.STATUS_PAUSED: |
| | | break; |
| | | //下载延迟 |
| | | case DownloadManager.STATUS_PENDING: |
| | | break; |
| | | //正在下载 |
| | | case DownloadManager.STATUS_RUNNING: |
| | | break; |
| | | //下载完成 |
| | | case DownloadManager.STATUS_SUCCESSFUL: |
| | | if (onProgressChanged != null) { |
| | | onProgressChanged.onFinish(); |
| | | } |
| | | //下载完成安装APK |
| | | if (downloadObserver != null) { |
| | | mContext.getContentResolver().unregisterContentObserver(downloadObserver); |
| | | } |
| | | installAPK(); |
| | | break; |
| | | //下载失败 |
| | | case DownloadManager.STATUS_FAILED: |
| | | Toast.makeText(mContext, "下载失败", Toast.LENGTH_SHORT).show(); |
| | | if (downloadObserver != null) { |
| | | mContext.getContentResolver().unregisterContentObserver(downloadObserver); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | c.close(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //下载到本地后执行安装 |
| | | private void installAPK() { |
| | | //获取下载文件的Uri |
| | | Uri downloadFileUri = downloadManager.getUriForDownloadedFile(downloadId); |
| | | if (downloadFileUri != null) { |
| | | Intent intent = new Intent(Intent.ACTION_VIEW); |
| | | intent.setDataAndType(downloadFileUri, "application/vnd.android.package-archive"); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
| | | mContext.startActivity(intent); |
| | | mContext.unregisterReceiver(receiver); |
| | | } |
| | | } |
| | | |
| | | //获取当前下载进度 |
| | | private int getDownloadPercent(long downloadId) { |
| | | DownloadManager.Query query = new DownloadManager.Query().setFilterById(downloadId); |
| | | Cursor c = downloadManager.query(query); |
| | | if (c.moveToFirst()) { |
| | | int downloadBytesIdx = c.getColumnIndexOrThrow( |
| | | DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR); |
| | | int totalBytesIdx = c.getColumnIndexOrThrow( |
| | | DownloadManager.COLUMN_TOTAL_SIZE_BYTES); |
| | | long totalBytes = c.getLong(totalBytesIdx); |
| | | long downloadBytes = c.getLong(downloadBytesIdx); |
| | | return (int) (downloadBytes * 100 / totalBytes); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | //进度监听 |
| | | public interface OnProgressListener { |
| | | void onProgressChanged(int progress); |
| | | |
| | | void onFinish(); |
| | | } |
| | | |
| | | //下载apk |
| | | public void download(String url, String name) { |
| | | //创建下载任务 |
| | | DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); |
| | | //移动网络情况下是否允许漫游 |
| | | request.setAllowedOverRoaming(false); |
| | | //在通知栏中显示,默认就是显示的 |
| | | request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE); |
| | | request.setTitle(name); |
| | | request.setDescription(name); |
| | | request.setVisibleInDownloadsUi(true); |
| | | //设置下载的路径 |
| | | request.setDestinationInExternalPublicDir(Environment.getExternalStorageDirectory().getAbsolutePath(), name); |
| | | //获取DownloadManager |
| | | downloadManager = (DownloadManager) mContext.getSystemService(Context.DOWNLOAD_SERVICE); |
| | | //将下载请求加入下载队列,加入下载队列后会给该任务返回一个long型的id,通过该id可以取消任务,重启任务、获取下载的文件等等 |
| | | downloadId = downloadManager.enqueue(request); |
| | | //注册广播接收者,监听下载状态 |
| | | // mContext.registerReceiver(receiver, |
| | | // new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE)); |
| | | // //添加监听 |
| | | // if (onProgressChanged != null) { |
| | | // Uri uriForDownloadedFile = Uri.parse("content://downloads/"); |
| | | // downloadObserver = new DownloadObserver(); |
| | | // downloadObserver.setOnChangedCallback((selfChange, uri) -> { |
| | | // DownloadManager.Query query = new DownloadManager.Query(); |
| | | // Cursor cursor = downloadManager.query(query); |
| | | // cursor.moveToFirst(); |
| | | // int bytes_downloaded = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR)); |
| | | // int bytes_total = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_TOTAL_SIZE_BYTES)); |
| | | // double progress = ((double) bytes_downloaded * 100) / (double) bytes_total; |
| | | // Log.i("TAG", "bytes_downloaded: DX"+bytes_downloaded); |
| | | // Log.i("TAG", "bytes_total: DX"+bytes_total); |
| | | // Log.i("TAG", "progress: DX"+progress); |
| | | // cursor.close(); |
| | | // onProgressChanged.onProgressChanged((int) progress); |
| | | // }); |
| | | // mContext.getContentResolver().registerContentObserver(uriForDownloadedFile, true, downloadObserver); |
| | | // } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.utils.exo; |
| | | |
| | | import android.content.Context; |
| | | import android.content.res.AssetFileDescriptor; |
| | | import android.view.Surface; |
| | | import android.view.SurfaceHolder; |
| | | |
| | | import com.google.android.exoplayer2.DefaultLoadControl; |
| | | import com.google.android.exoplayer2.DefaultRenderersFactory; |
| | | import com.google.android.exoplayer2.ExoPlayer; |
| | | import com.google.android.exoplayer2.LoadControl; |
| | | import com.google.android.exoplayer2.PlaybackException; |
| | | import com.google.android.exoplayer2.PlaybackParameters; |
| | | import com.google.android.exoplayer2.Player; |
| | | import com.google.android.exoplayer2.RenderersFactory; |
| | | import com.google.android.exoplayer2.analytics.DefaultAnalyticsCollector; |
| | | import com.google.android.exoplayer2.source.DefaultMediaSourceFactory; |
| | | import com.google.android.exoplayer2.source.MediaSource; |
| | | import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; |
| | | import com.google.android.exoplayer2.trackselection.MappingTrackSelector; |
| | | import com.google.android.exoplayer2.trackselection.TrackSelector; |
| | | import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter; |
| | | import com.google.android.exoplayer2.util.Clock; |
| | | import com.google.android.exoplayer2.util.EventLogger; |
| | | import com.google.android.exoplayer2.video.VideoSize; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import xyz.doikki.videoplayer.player.AbstractPlayer; |
| | | import xyz.doikki.videoplayer.player.VideoViewManager; |
| | | |
| | | |
| | | public class ExoMediaPlayer extends AbstractPlayer implements Player.Listener { |
| | | |
| | | protected Context mAppContext; |
| | | protected ExoPlayer mInternalPlayer; |
| | | protected MediaSource mMediaSource; |
| | | protected ExoMediaSourceHelper mMediaSourceHelper; |
| | | |
| | | private PlaybackParameters mSpeedPlaybackParameters; |
| | | |
| | | private boolean mIsPreparing; |
| | | |
| | | private LoadControl mLoadControl; |
| | | private RenderersFactory mRenderersFactory; |
| | | private TrackSelector mTrackSelector; |
| | | |
| | | public ExoMediaPlayer(Context context) { |
| | | mAppContext = context.getApplicationContext(); |
| | | mMediaSourceHelper = ExoMediaSourceHelper.getInstance(context); |
| | | } |
| | | |
| | | @Override |
| | | public void initPlayer() { |
| | | mInternalPlayer = new ExoPlayer.Builder( |
| | | mAppContext, |
| | | mRenderersFactory == null ? mRenderersFactory = new DefaultRenderersFactory(mAppContext) : mRenderersFactory, |
| | | new DefaultMediaSourceFactory(mAppContext), |
| | | mTrackSelector == null ? mTrackSelector = new DefaultTrackSelector(mAppContext) : mTrackSelector, |
| | | mLoadControl == null ? mLoadControl = new DefaultLoadControl() : mLoadControl, |
| | | DefaultBandwidthMeter.getSingletonInstance(mAppContext), |
| | | new DefaultAnalyticsCollector(Clock.DEFAULT)) |
| | | .build(); |
| | | setOptions(); |
| | | |
| | | //播放器日志 |
| | | if (VideoViewManager.getConfig().mIsEnableLog && mTrackSelector instanceof MappingTrackSelector) { |
| | | mInternalPlayer.addAnalyticsListener(new EventLogger((MappingTrackSelector) mTrackSelector, "ExoPlayer")); |
| | | } |
| | | |
| | | mInternalPlayer.addListener(this); |
| | | } |
| | | |
| | | public void setTrackSelector(TrackSelector trackSelector) { |
| | | mTrackSelector = trackSelector; |
| | | } |
| | | |
| | | public void setRenderersFactory(RenderersFactory renderersFactory) { |
| | | mRenderersFactory = renderersFactory; |
| | | } |
| | | |
| | | public void setLoadControl(LoadControl loadControl) { |
| | | mLoadControl = loadControl; |
| | | } |
| | | |
| | | @Override |
| | | public void setDataSource(String path, Map<String, String> headers) { |
| | | mMediaSource = mMediaSourceHelper.getMediaSource(path, headers); |
| | | } |
| | | |
| | | @Override |
| | | public void setDataSource(AssetFileDescriptor fd) { |
| | | //no support |
| | | } |
| | | |
| | | @Override |
| | | public void start() { |
| | | if (mInternalPlayer == null) |
| | | return; |
| | | mInternalPlayer.setPlayWhenReady(true); |
| | | } |
| | | |
| | | @Override |
| | | public void pause() { |
| | | if (mInternalPlayer == null) |
| | | return; |
| | | mInternalPlayer.setPlayWhenReady(false); |
| | | } |
| | | |
| | | @Override |
| | | public void stop() { |
| | | if (mInternalPlayer == null) |
| | | return; |
| | | mInternalPlayer.stop(); |
| | | } |
| | | |
| | | @Override |
| | | public void prepareAsync() { |
| | | if (mInternalPlayer == null) |
| | | return; |
| | | if (mMediaSource == null) return; |
| | | if (mSpeedPlaybackParameters != null) { |
| | | mInternalPlayer.setPlaybackParameters(mSpeedPlaybackParameters); |
| | | } |
| | | mIsPreparing = true; |
| | | mInternalPlayer.setMediaSource(mMediaSource); |
| | | mInternalPlayer.prepare(); |
| | | } |
| | | |
| | | @Override |
| | | public void reset() { |
| | | if (mInternalPlayer != null) { |
| | | mInternalPlayer.stop(); |
| | | mInternalPlayer.clearMediaItems(); |
| | | mInternalPlayer.setVideoSurface(null); |
| | | mIsPreparing = false; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean isPlaying() { |
| | | if (mInternalPlayer == null) |
| | | return false; |
| | | int state = mInternalPlayer.getPlaybackState(); |
| | | switch (state) { |
| | | case Player.STATE_BUFFERING: |
| | | case Player.STATE_READY: |
| | | return mInternalPlayer.getPlayWhenReady(); |
| | | case Player.STATE_IDLE: |
| | | case Player.STATE_ENDED: |
| | | default: |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void seekTo(long time) { |
| | | if (mInternalPlayer == null) |
| | | return; |
| | | mInternalPlayer.seekTo(time); |
| | | } |
| | | |
| | | @Override |
| | | public void release() { |
| | | if (mInternalPlayer != null) { |
| | | mInternalPlayer.removeListener(this); |
| | | mInternalPlayer.release(); |
| | | mInternalPlayer = null; |
| | | } |
| | | |
| | | mIsPreparing = false; |
| | | mSpeedPlaybackParameters = null; |
| | | } |
| | | |
| | | @Override |
| | | public long getCurrentPosition() { |
| | | if (mInternalPlayer == null) |
| | | return 0; |
| | | return mInternalPlayer.getCurrentPosition(); |
| | | } |
| | | |
| | | @Override |
| | | public long getDuration() { |
| | | if (mInternalPlayer == null) |
| | | return 0; |
| | | return mInternalPlayer.getDuration(); |
| | | } |
| | | |
| | | @Override |
| | | public int getBufferedPercentage() { |
| | | return mInternalPlayer == null ? 0 : mInternalPlayer.getBufferedPercentage(); |
| | | } |
| | | |
| | | @Override |
| | | public void setSurface(Surface surface) { |
| | | if (mInternalPlayer != null) { |
| | | mInternalPlayer.setVideoSurface(surface); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void setDisplay(SurfaceHolder holder) { |
| | | if (holder == null) |
| | | setSurface(null); |
| | | else |
| | | setSurface(holder.getSurface()); |
| | | } |
| | | |
| | | @Override |
| | | public void setVolume(float leftVolume, float rightVolume) { |
| | | if (mInternalPlayer != null) |
| | | mInternalPlayer.setVolume((leftVolume + rightVolume) / 2); |
| | | } |
| | | |
| | | @Override |
| | | public void setLooping(boolean isLooping) { |
| | | if (mInternalPlayer != null) |
| | | mInternalPlayer.setRepeatMode(isLooping ? Player.REPEAT_MODE_ALL : Player.REPEAT_MODE_OFF); |
| | | } |
| | | |
| | | @Override |
| | | public void setOptions() { |
| | | //准备好就开始播放 |
| | | mInternalPlayer.setPlayWhenReady(true); |
| | | } |
| | | |
| | | @Override |
| | | public void setSpeed(float speed) { |
| | | PlaybackParameters playbackParameters = new PlaybackParameters(speed); |
| | | mSpeedPlaybackParameters = playbackParameters; |
| | | if (mInternalPlayer != null) { |
| | | mInternalPlayer.setPlaybackParameters(playbackParameters); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public float getSpeed() { |
| | | if (mSpeedPlaybackParameters != null) { |
| | | return mSpeedPlaybackParameters.speed; |
| | | } |
| | | return 1f; |
| | | } |
| | | |
| | | @Override |
| | | public long getTcpSpeed() { |
| | | // no support |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public void onPlaybackStateChanged(int playbackState) { |
| | | if (mPlayerEventListener == null) return; |
| | | if (mIsPreparing) { |
| | | if (playbackState == Player.STATE_READY) { |
| | | mPlayerEventListener.onPrepared(); |
| | | mPlayerEventListener.onInfo(MEDIA_INFO_RENDERING_START, 0); |
| | | mIsPreparing = false; |
| | | } |
| | | return; |
| | | } |
| | | switch (playbackState) { |
| | | case Player.STATE_BUFFERING: |
| | | mPlayerEventListener.onInfo(MEDIA_INFO_BUFFERING_START, getBufferedPercentage()); |
| | | break; |
| | | case Player.STATE_READY: |
| | | mPlayerEventListener.onInfo(MEDIA_INFO_BUFFERING_END, getBufferedPercentage()); |
| | | break; |
| | | case Player.STATE_ENDED: |
| | | mPlayerEventListener.onCompletion(); |
| | | break; |
| | | case Player.STATE_IDLE: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onPlayerError(PlaybackException error) { |
| | | if (mPlayerEventListener != null) { |
| | | mPlayerEventListener.onError(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoSizeChanged(VideoSize videoSize) { |
| | | if (mPlayerEventListener != null) { |
| | | mPlayerEventListener.onVideoSizeChanged(videoSize.width, videoSize.height); |
| | | if (videoSize.unappliedRotationDegrees > 0) { |
| | | mPlayerEventListener.onInfo(MEDIA_INFO_VIDEO_ROTATION_CHANGED, videoSize.unappliedRotationDegrees); |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.utils.exo; |
| | | |
| | | import android.content.Context; |
| | | |
| | | import xyz.doikki.videoplayer.player.PlayerFactory; |
| | | |
| | | public class ExoMediaPlayerFactory extends PlayerFactory<ExoMediaPlayer> { |
| | | |
| | | public static ExoMediaPlayerFactory create() { |
| | | return new ExoMediaPlayerFactory(); |
| | | } |
| | | |
| | | @Override |
| | | public ExoMediaPlayer createPlayer(Context context) { |
| | | return new ExoMediaPlayer(context); |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.utils.exo; |
| | | |
| | | import android.content.Context; |
| | | import android.net.Uri; |
| | | import android.text.TextUtils; |
| | | |
| | | import com.google.android.exoplayer2.C; |
| | | import com.google.android.exoplayer2.MediaItem; |
| | | import com.google.android.exoplayer2.database.StandaloneDatabaseProvider; |
| | | import com.google.android.exoplayer2.ext.rtmp.RtmpDataSource; |
| | | import com.google.android.exoplayer2.source.MediaSource; |
| | | import com.google.android.exoplayer2.source.ProgressiveMediaSource; |
| | | import com.google.android.exoplayer2.source.dash.DashMediaSource; |
| | | import com.google.android.exoplayer2.source.hls.HlsMediaSource; |
| | | import com.google.android.exoplayer2.source.rtsp.RtspMediaSource; |
| | | import com.google.android.exoplayer2.upstream.DataSource; |
| | | import com.google.android.exoplayer2.upstream.DefaultDataSource; |
| | | import com.google.android.exoplayer2.upstream.DefaultHttpDataSource; |
| | | import com.google.android.exoplayer2.upstream.HttpDataSource; |
| | | import com.google.android.exoplayer2.upstream.cache.Cache; |
| | | import com.google.android.exoplayer2.upstream.cache.CacheDataSource; |
| | | import com.google.android.exoplayer2.upstream.cache.LeastRecentlyUsedCacheEvictor; |
| | | import com.google.android.exoplayer2.upstream.cache.SimpleCache; |
| | | import com.google.android.exoplayer2.util.Util; |
| | | |
| | | import java.io.File; |
| | | import java.lang.reflect.Field; |
| | | import java.util.Map; |
| | | |
| | | public final class ExoMediaSourceHelper { |
| | | |
| | | private static volatile ExoMediaSourceHelper sInstance; |
| | | |
| | | private final String mUserAgent; |
| | | private final Context mAppContext; |
| | | private HttpDataSource.Factory mHttpDataSourceFactory; |
| | | private Cache mCache; |
| | | |
| | | private ExoMediaSourceHelper(Context context) { |
| | | mAppContext = context.getApplicationContext(); |
| | | mUserAgent = Util.getUserAgent(mAppContext, mAppContext.getApplicationInfo().name); |
| | | } |
| | | |
| | | public static ExoMediaSourceHelper getInstance(Context context) { |
| | | if (sInstance == null) { |
| | | synchronized (ExoMediaSourceHelper.class) { |
| | | if (sInstance == null) { |
| | | sInstance = new ExoMediaSourceHelper(context); |
| | | } |
| | | } |
| | | } |
| | | return sInstance; |
| | | } |
| | | |
| | | public MediaSource getMediaSource(String uri) { |
| | | return getMediaSource(uri, null, false); |
| | | } |
| | | |
| | | public MediaSource getMediaSource(String uri, Map<String, String> headers) { |
| | | return getMediaSource(uri, headers, false); |
| | | } |
| | | |
| | | public MediaSource getMediaSource(String uri, boolean isCache) { |
| | | return getMediaSource(uri, null, isCache); |
| | | } |
| | | |
| | | public MediaSource getMediaSource(String uri, Map<String, String> headers, boolean isCache) { |
| | | Uri contentUri = Uri.parse(uri); |
| | | if ("rtmp".equals(contentUri.getScheme())) { |
| | | return new ProgressiveMediaSource.Factory(new RtmpDataSource.Factory()) |
| | | .createMediaSource(MediaItem.fromUri(contentUri)); |
| | | } else if ("rtsp".equals(contentUri.getScheme())) { |
| | | return new RtspMediaSource.Factory().createMediaSource(MediaItem.fromUri(contentUri)); |
| | | } |
| | | int contentType = inferContentType(uri); |
| | | DataSource.Factory factory; |
| | | if (isCache) { |
| | | factory = getCacheDataSourceFactory(); |
| | | } else { |
| | | factory = getDataSourceFactory(); |
| | | } |
| | | if (mHttpDataSourceFactory != null) { |
| | | setHeaders(headers); |
| | | } |
| | | switch (contentType) { |
| | | case C.CONTENT_TYPE_DASH: |
| | | return new DashMediaSource.Factory(factory).createMediaSource(MediaItem.fromUri(contentUri)); |
| | | case C.CONTENT_TYPE_HLS: |
| | | return new HlsMediaSource.Factory(factory).createMediaSource(MediaItem.fromUri(contentUri)); |
| | | default: |
| | | case C.CONTENT_TYPE_OTHER: |
| | | return new ProgressiveMediaSource.Factory(factory).createMediaSource(MediaItem.fromUri(contentUri)); |
| | | } |
| | | } |
| | | |
| | | private int inferContentType(String fileName) { |
| | | fileName = fileName.toLowerCase(); |
| | | if (fileName.contains(".mpd")) { |
| | | return C.CONTENT_TYPE_DASH; |
| | | } else if (fileName.contains(".m3u8")) { |
| | | return C.CONTENT_TYPE_HLS; |
| | | } else { |
| | | return C.CONTENT_TYPE_OTHER; |
| | | } |
| | | } |
| | | |
| | | private DataSource.Factory getCacheDataSourceFactory() { |
| | | if (mCache == null) { |
| | | mCache = newCache(); |
| | | } |
| | | return new CacheDataSource.Factory() |
| | | .setCache(mCache) |
| | | .setUpstreamDataSourceFactory(getDataSourceFactory()) |
| | | .setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR); |
| | | } |
| | | |
| | | private Cache newCache() { |
| | | return new SimpleCache( |
| | | new File(mAppContext.getExternalCacheDir(), "exo-video-cache"),//缓存目录 |
| | | new LeastRecentlyUsedCacheEvictor(512 * 1024 * 1024),//缓存大小,默认512M,使用LRU算法实现 |
| | | new StandaloneDatabaseProvider(mAppContext)); |
| | | } |
| | | |
| | | /** |
| | | * Returns a new DataSource factory. |
| | | * |
| | | * @return A new DataSource factory. |
| | | */ |
| | | private DataSource.Factory getDataSourceFactory() { |
| | | return new DefaultDataSource.Factory(mAppContext, getHttpDataSourceFactory()); |
| | | } |
| | | |
| | | /** |
| | | * Returns a new HttpDataSource factory. |
| | | * |
| | | * @return A new HttpDataSource factory. |
| | | */ |
| | | private DataSource.Factory getHttpDataSourceFactory() { |
| | | if (mHttpDataSourceFactory == null) { |
| | | mHttpDataSourceFactory = new DefaultHttpDataSource.Factory() |
| | | .setUserAgent(mUserAgent) |
| | | .setAllowCrossProtocolRedirects(true); |
| | | } |
| | | return mHttpDataSourceFactory; |
| | | } |
| | | |
| | | private void setHeaders(Map<String, String> headers) { |
| | | if (headers != null && headers.size() > 0) { |
| | | //如果发现用户通过header传递了UA,则强行将HttpDataSourceFactory里面的userAgent字段替换成用户的 |
| | | if (headers.containsKey("User-Agent")) { |
| | | String value = headers.remove("User-Agent"); |
| | | if (!TextUtils.isEmpty(value)) { |
| | | try { |
| | | Field userAgentField = mHttpDataSourceFactory.getClass().getDeclaredField("userAgent"); |
| | | userAgentField.setAccessible(true); |
| | | userAgentField.set(mHttpDataSourceFactory, value); |
| | | } catch (Exception e) { |
| | | //ignore |
| | | } |
| | | } |
| | | } |
| | | mHttpDataSourceFactory.setDefaultRequestProperties(headers); |
| | | } |
| | | } |
| | | |
| | | public void setCache(Cache cache) { |
| | | this.mCache = cache; |
| | | } |
| | | } |
| | |
| | | act.runOnUiThread { |
| | | act.dismissDialog() |
| | | callback.onResult(uploadSingle) |
| | | file.delete() |
| | | if (file.path != this@uploadWithCompress) |
| | | file.delete() |
| | | } |
| | | }).start() |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | fun String.getStarIcon() = when(this){ |
| | | "水瓶座"-> R.mipmap.shuipingzuo |
| | | "金牛座"-> R.mipmap.jinniuzuo |
| | | "白羊座"-> R.mipmap.baiyangzuo |
| | | "双鱼座"-> R.mipmap.double_fish |
| | | "摩羯座"-> R.mipmap.mojiezuo |
| | | "狮子座"-> R.mipmap.shizizuo |
| | | "双子座"-> R.mipmap.twis |
| | | "巨蟹座"-> R.mipmap.juxiezuo |
| | | "处女座"-> R.mipmap.chunvzuo |
| | | "天秤座"-> R.mipmap.tianpingzuo |
| | | "射手座"-> R.mipmap.shooter |
| | | "天蝎座"-> R.mipmap.tianhezuo |
| | | else -> R.mipmap.tianhezuo |
| | | } |
| | | |
| | | fun String.getArrowIcon():Int{ |
| | | if (isNullOrEmpty()) |
| | | return 0 |
| | | try { |
| | | if (toDouble() == 0.0) |
| | | return 0 |
| | | return if (startsWith("-")) R.mipmap.icondown else R.mipmap.iconup |
| | | }catch (e:Exception){ |
| | | return 0 |
| | | } |
| | | } |
| | | fun Double.formatDistance() = if(this>1000) "%.2fkm".format(this/1000) else "%dm".format(this.toInt()) |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <item android:color="@color/black" android:state_enabled="true"/> |
| | | <item android:color="@color/white" android:state_enabled="false"/> |
| | | </selector> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="#E3B25C"/> |
| | | <corners android:radius="14dp"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:topLeftRadius="0dp" android:topRightRadius="10dp" android:bottomRightRadius="0dp" android:bottomLeftRadius="4dp"/> |
| | | <solid android:color="@color/colorPrimary"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:topLeftRadius="0dp" android:topRightRadius="10dp" android:bottomRightRadius="0dp" android:bottomLeftRadius="4dp"/> |
| | | <solid android:color="#D0D0D0"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:topLeftRadius="18dp" android:bottomLeftRadius="18dp"/> |
| | | <gradient android:startColor="#E59A2F" android:endColor="#FF8228" android:angle="270"/> |
| | | </shape> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:topLeftRadius="50dp" android:topRightRadius="50dp"/> |
| | | <corners android:topLeftRadius="40dp" android:topRightRadius="40dp"/> |
| | | <gradient android:endColor="#F3FFF8" android:startColor="#E1FFFFFF" android:angle="270"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="21dp"/> |
| | | <solid android:color="#B2CA99"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="#ECF0E8"/> |
| | | <corners android:radius="4dp"/> |
| | | </shape> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="@color/textGreen"/> |
| | | <solid android:color="@color/darkGreen"/> |
| | | <corners android:radius="10dp"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="14dp"/> |
| | | <solid android:color="#CDCDCD"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:topRightRadius="20dp" android:topLeftRadius="20dp"/> |
| | | <solid android:color="@color/page_bg"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <gradient android:startColor="#3CB56A" android:endColor="#FCFECA" android:angle="90"/> |
| | | <corners android:radius="4dp"/> |
| | | </shape> |
| | |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <gradient android:endColor="#33999999" |
| | | android:centerColor="#15999999" |
| | | android:startColor="#00FFFFFF" android:angle="90"/> |
| | | android:startColor="#00FFFFFF" android:angle="270"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="#E2F5E1"/> |
| | | <corners android:topLeftRadius="8dp" android:bottomLeftRadius="2dp" android:topRightRadius="2dp" android:bottomRightRadius="8dp"/> |
| | | </shape> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="10dp"/> |
| | | <solid android:color="#33ffffff"/> |
| | | <solid android:color="#44ffffff"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="10dp"/> |
| | | <solid android:color="#99ffffff"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="20dp"/> |
| | | <solid android:color="@color/white"/> |
| | | <stroke android:color="@color/dividing_line_color" android:width="1dp"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="4dp"/> |
| | | <stroke android:color="@color/white" android:width="2dp"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <item android:state_enabled="true"> |
| | | <shape> |
| | | <size android:width="10dp" android:height="10dp"/> |
| | | <stroke android:width="1dp" android:color="@color/black"/> |
| | | <corners android:radius="5dp"/> |
| | | </shape> |
| | | </item> |
| | | <item android:state_enabled="false"> |
| | | <shape> |
| | | <size android:width="10dp" android:height="10dp"/> |
| | | <corners android:radius="5dp"/> |
| | | <solid android:color="@color/white"/> |
| | | </shape> |
| | | </item> |
| | | </selector> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape android:shape="oval" |
| | | xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <size |
| | | android:height="40dp" |
| | | android:width="40dp"/> |
| | | </shape> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layer-list |
| | | xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <item android:id="@android:id/background"> |
| | | <item android:id="@android:id/background" android:top="5dp" android:bottom="5dp"> |
| | | <shape> |
| | | <solid android:color="@color/white" /> |
| | | <corners android:radius="15dp"/> |
| | | </shape> |
| | | </item> |
| | | |
| | | <item android:id="@android:id/progress"> |
| | | <item android:id="@android:id/progress" android:top="5dp" android:bottom="5dp"> |
| | | <clip> |
| | | <shape> |
| | | <solid android:color="#FDCA8F" /> |
| | | <solid android:color="@color/colorPrimary" /> |
| | | <corners android:radius="15dp"/> |
| | | </shape> |
| | | </clip> |
| | | </item> |
| | | </layer-list> |
| | | |
| | | </layer-list> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layer-list |
| | | xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <item android:id="@android:id/background"> |
| | | <shape> |
| | | <solid android:color="@color/white" /> |
| | | <corners android:radius="15dp"/> |
| | | </shape> |
| | | </item> |
| | | |
| | | <item android:id="@android:id/progress"> |
| | | <clip> |
| | | <shape> |
| | | <solid android:color="#FDCA8F" /> |
| | | <corners android:radius="15dp"/> |
| | | </shape> |
| | | </clip> |
| | | </item> |
| | | </layer-list> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layer-list |
| | | xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <item android:id="@android:id/background" android:top="5dp" android:bottom="5dp"> |
| | | <shape> |
| | | <solid android:color="#C8C8C8" /> |
| | | <corners android:radius="15dp"/> |
| | | </shape> |
| | | </item> |
| | | |
| | | <item android:id="@android:id/progress" android:top="5dp" android:bottom="5dp"> |
| | | <clip> |
| | | <shape> |
| | | <solid android:color="@color/colorPrimary" /> |
| | | <corners android:radius="15dp"/> |
| | | </shape> |
| | | </clip> |
| | | </item> |
| | | </layer-list> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <item android:state_enabled="true" android:drawable="@drawable/bg_white_13dp"/> |
| | | <item android:state_enabled="false"> |
| | | <shape> |
| | | <solid android:color="@color/black1a"/> |
| | | <corners android:radius="13dp"/> |
| | | </shape> |
| | | </item> |
| | | </selector> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <item android:drawable="@mipmap/icon_eye" android:state_checked="false"/> |
| | | <item android:drawable="@mipmap/icon_eye_close" android:state_checked="true"/> |
| | | <item android:drawable="@mipmap/icon_eye" android:state_checked="true"/> |
| | | <item android:drawable="@mipmap/icon_eye_close" android:state_checked="false"/> |
| | | </selector> |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:textColor="@color/textColor" |
| | | android:layout_marginTop="45dp" |
| | | android:layout_marginTop="50dp" |
| | | android:textSize="15sp" |
| | | android:text="可用余额(元)"/> |
| | | <TextView |
| | |
| | | android:textColor="@color/textColor" |
| | | android:id="@+id/tv_money" |
| | | android:textSize="38sp" |
| | | android:layout_marginTop="8dp" |
| | | android:textStyle="bold" |
| | | android:text="0"/> |
| | | <Space |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"/> |
| | | <TextView |
| | | android:id="@+id/tv_withdraw" |
| | | android:layout_width="160dp" |
| | |
| | | android:textStyle="bold" |
| | | android:layout_marginTop="40dp" |
| | | android:textSize="18sp" |
| | | android:layout_marginBottom="21dp" |
| | | android:background="@drawable/bg_white_25dp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_action" |
| | | android:text="提现" /> |
| | | </LinearLayout> |
| | | <com.flyco.tablayout.SlidingTabLayout |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="44dp" |
| | | app:layout_constraintTop_toBottomOf="@id/ll" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginTop="18dp" |
| | | app:tl_tab_space_equal="true" |
| | | app:tl_indicator_width="12dp" |
| | | app:tl_indicator_height="2dp" |
| | |
| | | app:tl_textSelectColor="@color/textGreen"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:layout_height="1dp" |
| | | android:layout_marginTop="2dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_bar" |
| | | /> |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:id="@+id/view_pager" |
| | | android:layout_marginTop="3dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_bar" |
| | | app:layout_constraintBottom_toBottomOf="parent"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="243dp" |
| | | android:layout_marginTop="30dp" |
| | | app:is_auto_loop="false" |
| | | app:is_infinite_loop="false" |
| | | app:banner_auto_loop="false" |
| | | app:banner_infinite_loop="false" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_2" |
| | | android:id="@+id/banner_landscape"/> |
| | | <TextView |
| | |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" |
| | | android:text="+86" |
| | | android:textColor="@color/textColor" |
| | | android:drawableEnd="@mipmap/icon_nav_open" |
| | | android:drawablePadding="2dp" |
| | | android:textSize="16sp"/> |
| | | |
| | |
| | | app:layout_constraintTop_toTopOf="@id/iv_cover" |
| | | android:text="0.0" |
| | | android:textStyle="bold" |
| | | android:textSize="15sp" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textGreen" |
| | | android:layout_marginEnd="14dp" |
| | | android:layout_marginTop="11dp"/> |
| | |
| | | android:layout_marginStart="18dp" |
| | | android:textStyle="bold" |
| | | android:textSize="12sp" |
| | | android:text="心里咨询课程" |
| | | tools:text="心里咨询课程" |
| | | android:textColor="@color/textColor66" |
| | | android:layout_marginEnd="8dp"/> |
| | | <TextView |
| | |
| | | android:id="@+id/tv_count" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_teacher" |
| | | android:text="X1" |
| | | android:text="x1" |
| | | android:textStyle="bold" |
| | | android:textSize="15sp" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textGreen" |
| | | android:layout_marginEnd="14dp" |
| | | android:layout_marginTop="11dp"/> |
| | |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="60dp" |
| | | android:layout_marginTop="55dp" |
| | | android:text="操作成功\n您已成功更换绑定手机号,请重新登录" |
| | | android:drawablePadding="20dp" |
| | | android:gravity="center" |
| | | android:lineSpacingExtra="6dp" |
| | | android:textColor="@color/textColor" |
| | | android:drawableTop="@mipmap/successs" |
| | | android:id="@+id/tv_1"/> |
| | |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_btn_action" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | android:layout_marginTop="110dp" |
| | | android:layout_marginTop="100dp" |
| | | android:layout_marginHorizontal="45dp" |
| | | android:text="重新登录" |
| | | android:id="@+id/tv_action"/> |
| | |
| | | android:text="赠送好友" |
| | | android:drawableStart="@mipmap/send" |
| | | android:textSize="14sp" |
| | | android:visibility="gone" |
| | | android:layout_marginStart="26dp" |
| | | android:textColor="@color/textColor" |
| | | android:drawablePadding="8dp" |
| | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="10dp" |
| | | android:id="@+id/rv_chapter"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:layout_marginBottom="20dp" |
| | | android:id="@+id/rv_push"/> |
| | | </LinearLayout> |
| | | |
| | |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" |
| | | android:text="+86" |
| | | android:textColor="@color/textColor" |
| | | android:drawableEnd="@mipmap/icon_nav_open" |
| | | android:drawablePadding="2dp" |
| | | android:textSize="16sp"/> |
| | | |
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"> |
| | | <TextView |
| | | android:id="@+id/tv_total" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="98dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_margin="14dp" |
| | | android:background="@drawable/bg_green_10dp" |
| | | android:textSize="24sp" |
| | | android:text="0" |
| | | android:gravity="center_horizontal" |
| | | android:paddingTop="15dp" |
| | | android:textColor="@color/white" |
| | | android:textStyle="bold"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginBottom="20dp" |
| | | android:text="当前能量值" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:alpha="0.8" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_total"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_1" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66" |
| | | android:text="客服微信二维码" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginBottom="30dp"/> |
| | | |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:id="@+id/iv_code" |
| | | android:layout_width="96dp" |
| | | android:layout_height="96dp" |
| | | android:layout_gravity="center" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_1" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:actualImageScaleType="centerInside" |
| | | app:roundingBorderColor="@color/white" |
| | | app:placeholderImage="@color/page_bg" |
| | | android:layout_marginBottom="4dp" |
| | | app:roundingBorderWidth="8dp"/> |
| | | <com.scwang.smart.refresh.layout.SmartRefreshLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toTopOf="@id/iv_code" |
| | | android:layout_marginBottom="8dp" |
| | | android:layout_marginTop="128dp" |
| | | android:id="@+id/refreshLayout"> |
| | | <com.scwang.smart.refresh.header.ClassicsHeader |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"/> |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/rv_list" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"/> |
| | | <com.scwang.smart.refresh.footer.ClassicsFooter |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"/> |
| | | </com.scwang.smart.refresh.layout.SmartRefreshLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | app:screenScaleType="type_center_crop" |
| | | app:playerBackgroundColor="@color/white" |
| | | app:playerBackgroundColor="@color/black" |
| | | android:id="@+id/player"/> |
| | | |
| | | <TextView |
| | |
| | | android:text="跳过" |
| | | android:textColor="@color/white" |
| | | android:textSize="20sp" |
| | | android:layout_marginBottom="60dp" |
| | | android:layout_marginBottom="40dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:textSize="20sp" |
| | | android:textSize="19sp" |
| | | android:textColor="@color/white" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_action" |
| | | android:layout_marginBottom="20dp" |
| | |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginTop="47dp" |
| | | android:textSize="46sp" |
| | | android:textSize="41sp" |
| | | android:text="心泉·疗愈空间" |
| | | android:textColor="@color/white" |
| | | android:id="@+id/tv_1"/> |
| | |
| | | android:text="亲爱的家人,温暖喜悦问候您\n我是心泉老师\n欢迎来到心泉·疗愈空间\n愿这一方空间为您带来\n平和 喜悦 放松 宁静" |
| | | android:textColor="@color/white" |
| | | android:layout_marginTop="36dp" |
| | | android:textSize="21sp"/> |
| | | android:textSize="18sp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:textSize="22sp" |
| | | android:textColor="#404040" |
| | | android:lineSpacingExtra="10dp" |
| | | android:text="请您遵从本心\n回答以下问题\n挑选您喜欢的空间环境\n为您定制专属您的\n心泉·冥想空间"/> |
| | | android:text="请您遵从本心\n回答以下问题\n挑选您喜欢的空间环境\n为您定制专属您的\n心泉·疗愈空间"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
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"> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintDimensionRatio="39:45" |
| | | android:background="@mipmap/bg_help"/> |
| | | <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:textColor="@color/textColor" |
| | | android:textSize="16sp" |
| | | android:textStyle="bold" |
| | | android:id="@+id/tv_title" |
| | | android:layout_marginTop="44dp"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/back" |
| | | android:padding="10dp" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="4dp" |
| | | app:layout_constraintTop_toTopOf="@id/tv_title" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_title" |
| | | android:id="@+id/iv_back"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginTop="50dp" |
| | | android:layout_marginStart="21dp" |
| | | android:text="找不到\n已购课程怎么办?" |
| | | android:textSize="22sp" |
| | | android:id="@+id/tv_1" |
| | | android:textColor="@color/textGreen" |
| | | android:textStyle="bold"/> |
| | | <TextView |
| | | android:id="@+id/tv_2" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | android:layout_marginHorizontal="21dp" |
| | | android:layout_marginTop="28dp" |
| | | android:textColor="@color/textColor" |
| | | android:lineSpacingExtra="4dp" |
| | | android:text="找不到已购课程,通常是因为当前登录的手机号码并非购买课程时使用的手机号码所致,可通过以下方式找回课程。"/> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_2" |
| | | android:layout_marginTop="30dp" |
| | | android:background="@color/white" |
| | | android:orientation="vertical" |
| | | app:layout_constraintBottom_toBottomOf="parent"> |
| | | <com.flyco.tablayout.SlidingTabLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="54dp" |
| | | android:layout_marginTop="16dp" |
| | | app:tl_indicator_width="0dp" |
| | | app:tl_textSelectColor="@color/textColor" |
| | | app:tl_textUnselectColor="@color/textColor99" |
| | | app:tl_tab_space_equal="true" |
| | | app:tl_textsize="15sp" |
| | | app:tl_textBold="BOTH" |
| | | android:id="@+id/tab_bar"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:layout_marginHorizontal="21dp" |
| | | android:background="@color/dividing_line_color"/> |
| | | <androidx.viewpager.widget.ViewPager |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:id="@+id/view_pager"/> |
| | | </LinearLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_marginTop="22dp" |
| | | android:layout_marginStart="16dp" |
| | | android:layout_width="88dp" |
| | | android:layout_height="21dp" |
| | | android:src="@mipmap/vip_1"/> |
| | | android:layout_height="21dp"/> |
| | | <ProgressBar |
| | | style="?android:attr/progressBarStyleHorizontal" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="10dp" |
| | | android:progressDrawable="@drawable/progress_drawable" |
| | | android:progressDrawable="@drawable/progress_drawable_level" |
| | | android:thumb="@null" |
| | | app:layout_constraintTop_toBottomOf="@id/iv_level" |
| | | android:layout_marginTop="20dp" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginHorizontal="30dp" |
| | | android:text="登录" |
| | | app:layout_constraintTop_toBottomOf="@id/barrier1" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_other" /> |
| | | android:layout_marginTop="87dp" |
| | | app:layout_constraintTop_toBottomOf="@id/barrier1"/> |
| | | <TextView |
| | | android:id="@+id/tv_register" |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="@id/et_phone" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_action" |
| | | android:layout_marginBottom="8dp" |
| | | app:layout_constraintTop_toBottomOf="@id/barrier1" |
| | | android:layout_marginTop="18dp" |
| | | android:background="@null" |
| | | android:text="我已阅读并同意" |
| | | android:padding="2dp" |
| | | android:textSize="12sp" |
| | | android:button="@drawable/selector_check_radio" |
| | | app:layout_constraintHorizontal_chainStyle="packed" |
| | | android:textColor="@color/textColor" |
| | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_privacy_rule" |
| | | android:text="@string/privacy_rule" |
| | | android:id="@+id/tv_user_rule" |
| | | android:text="@string/user_register_rule" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/cb_rule" |
| | | app:layout_constraintStart_toEndOf="@id/cb_rule" |
| | | android:textSize="13sp" |
| | | android:textSize="12sp" |
| | | android:paddingVertical="4dp" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/black"/> |
| | | android:textColor="@color/colorPrimary"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_user_rule" |
| | | android:text="@string/user_rule" |
| | | android:id="@+id/tv_privacy_rule" |
| | | android:text="@string/user_privacy_rule" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/cb_rule" |
| | | app:layout_constraintStart_toEndOf="@id/tv_privacy_rule" |
| | | android:textSize="13sp" |
| | | app:layout_constraintStart_toEndOf="@id/tv_user_rule" |
| | | android:textSize="12sp" |
| | | android:paddingVertical="4dp" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/black"/> |
| | | android:textColor="@color/colorPrimary"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_wx" |
| | |
| | | <com.flyco.tablayout.CommonTabLayout |
| | | android:id="@+id/tab_bar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="74dp" |
| | | android:layout_height="94dp" |
| | | android:background="@color/white" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:tl_indicator_height="0dp" |
| | | android:paddingBottom="20dp" |
| | | app:tl_textBold="BOTH" |
| | | app:tl_iconMargin="15dp" |
| | | app:tl_textSelectColor="@color/colorPrimary" |
| | | app:tl_textUnselectColor="@color/textColor99" |
| | | app:tl_textsize="11sp" /> |
| | |
| | | android:src="@mipmap/tab_tree" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginBottom="20dp" |
| | | app:layout_constraintTop_toTopOf="@id/tab_bar" |
| | | app:layout_constraintBottom_toBottomOf="@id/tab_bar"/> |
| | | |
| | |
| | | android:background="@drawable/bg_shadow_bottom" |
| | | app:layout_constraintBottom_toTopOf="@id/tab_bar" /> |
| | | |
| | | <View |
| | | android:id="@+id/fg_bottom" |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:background="@color/halfTrans" |
| | | android:layout_height="47dp" |
| | | app:layout_constraintBottom_toTopOf="@id/tab_bar" |
| | | android:background="@drawable/bg_green_25dp" |
| | | android:layout_marginStart="18dp" |
| | | android:id="@+id/cl_player" |
| | | android:visibility="gone" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toTopOf="@id/tab_bar" /> |
| | | android:layout_marginEnd="14dp"> |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:layout_width="37dp" |
| | | android:layout_height="37dp" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginStart="8dp" |
| | | app:roundAsCircle="true" |
| | | app:actualImageScaleType="centerCrop" |
| | | app:roundingBorderWidth="3dp" |
| | | app:placeholderImage="@color/page_bg" |
| | | android:id="@+id/iv_player" |
| | | app:roundingBorderColor="@color/black"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/player_close" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginEnd="23dp" |
| | | android:id="@+id/player_close"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/player_pause" |
| | | app:layout_constraintEnd_toStartOf="@id/player_close" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginEnd="18dp" |
| | | android:id="@+id/player_play"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_player" |
| | | app:layout_constraintStart_toEndOf="@id/iv_player" |
| | | app:layout_constraintEnd_toStartOf="@id/player_play" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:singleLine="true" |
| | | android:ellipsize="end" |
| | | android:layout_marginHorizontal="16dp" |
| | | android:textColor="@color/white" |
| | | android:textStyle="bold" |
| | | android:textSize="14sp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:scrollbars="none"> |
| | | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:paddingBottom="20dp" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:text="找不到已购课程" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="14sp" |
| | | android:drawableStart="@mipmap/wenti" |
| | | android:drawablePadding="9dp" |
| | | android:padding="10dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="12dp" |
| | | android:id="@+id/tv_ask" |
| | | android:layout_marginEnd="11dp"/> |
| | | |
| | | <View |
| | | android:layout_width="29dp" |
| | | android:layout_height="6dp" |
| | | android:background="@drawable/bg_indicator_gradient" |
| | | app:layout_constraintEnd_toEndOf="@id/tv_1" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_1" |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="我的课程" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="15sp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_ask" |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="课程筛选" |
| | | android:text="已购课程" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="18sp" |
| | | android:textSize="15sp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="@id/et_search" /> |
| | | |
| | | android:layout_marginStart="20dp" |
| | | android:layout_marginTop="20dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_ask" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/rv_filter" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:layout_marginTop="9dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" /> |
| | | <EditText |
| | | android:id="@+id/et_search" |
| | | android:id="@+id/rv_my" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:layout_marginTop="16dp" |
| | | android:background="@drawable/bg_grey_16dp" |
| | | android:drawableStart="@mipmap/icon_search_gray" |
| | | android:drawablePadding="6dp" |
| | | android:hint="输入关键字搜索" |
| | | android:padding="9dp" |
| | | android:singleLine="true" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="12sp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toBottomOf="@id/rv_filter" /> |
| | | android:layout_marginTop="9dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_search" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginEnd="4dp" |
| | | android:background="@drawable/bg_green_14_alpha" |
| | | android:paddingHorizontal="16dp" |
| | | android:paddingVertical="5dp" |
| | | android:text="搜索" |
| | | android:textColor="@color/colorPrimary" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:id="@+id/tv_empty" |
| | | android:text="你还没有购买课程" |
| | | android:textSize="12sp" |
| | | android:layout_marginTop="30dp" |
| | | android:textColor="@color/textColor66" |
| | | android:drawableTop="@mipmap/wu" |
| | | android:drawablePadding="20dp" |
| | | android:gravity="center"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="42dp" |
| | | android:id="@+id/tv_action" |
| | | android:layout_marginHorizontal="52dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_empty" |
| | | android:layout_marginTop="25dp" |
| | | android:gravity="center" |
| | | android:text="前往选购课程" |
| | | android:textSize="15sp" |
| | | android:textColor="@color/white" |
| | | android:background="@drawable/bg_green_20dp"/> |
| | | <androidx.constraintlayout.widget.Barrier |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/barrier" |
| | | app:constraint_referenced_ids="tv_action,rv_my" |
| | | app:barrierDirection="bottom"/> |
| | | <TextView |
| | | android:id="@+id/tv_2" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="免费课程" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="15sp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_search" |
| | | app:layout_constraintEnd_toEndOf="@id/et_search" /> |
| | | |
| | | |
| | | |
| | | app:layout_constraintTop_toBottomOf="@id/barrier" |
| | | android:layout_marginTop="50dp" |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" /> |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/rv_course" |
| | | android:id="@+id/rv_free" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/et_search" /> |
| | | android:layout_marginHorizontal="14dp" |
| | | android:layout_marginTop="9dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_2" /> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.core.widget.NestedScrollView> |
| | | |
| | |
| | | android:id="@+id/banner" |
| | | android:layout_width="match_parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:indicator_height="0dp" |
| | | app:banner_indicator_height="0dp" |
| | | android:layout_height="220dp" |
| | | app:is_infinite_loop="true" |
| | | app:is_auto_loop="true"/> |
| | | app:banner_infinite_loop="true" |
| | | app:banner_auto_loop="true"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.core.widget.NestedScrollView 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"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginTop="40dp" |
| | | android:text="支付成功" |
| | | android:drawableTop="@mipmap/successs" |
| | | android:drawablePadding="20dp" |
| | | android:gravity="center" |
| | | android:textSize="14sp" |
| | | android:id="@+id/tv_1" |
| | | android:textColor="@color/textColor66" |
| | | android:textStyle="bold"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_money" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginTop="30dp" |
| | | android:textStyle="bold" |
| | | android:text="0.0" |
| | | android:textSize="30sp" |
| | | android:textColor="#FF9000"/> |
| | | <TextView |
| | | android:layout_width="140dp" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_ok" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toStartOf="@id/tv_ok" |
| | | android:id="@+id/tv_cancel" |
| | | android:gravity="center" |
| | | android:paddingVertical="10dp" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textGreen" |
| | | android:background="@drawable/bg_green_line_22dp" |
| | | android:text="返回首页"/> |
| | | |
| | | <TextView |
| | | android:layout_width="140dp" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toEndOf="@id/tv_cancel" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_money" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:id="@+id/tv_ok" |
| | | android:layout_marginTop="30dp" |
| | | android:paddingVertical="10dp" |
| | | android:textStyle="bold" |
| | | android:textSize="14sp" |
| | | android:background="@drawable/bg_btn_enable" |
| | | android:textColor="@color/white" |
| | | android:gravity="center" |
| | | android:text="查看课程"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_ok" |
| | | android:layout_marginTop="30dp" |
| | | android:text="猜你喜欢" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor66" |
| | | android:textStyle="bold" |
| | | android:id="@+id/tv_push"/> |
| | | <View |
| | | android:layout_width="67dp" |
| | | android:layout_height="1dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toTopOf="@id/tv_push" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_push" |
| | | app:layout_constraintEnd_toStartOf="@id/tv_push" |
| | | android:layout_marginEnd="9dp"/> |
| | | <View |
| | | android:layout_width="67dp" |
| | | android:layout_height="1dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toTopOf="@id/tv_push" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_push" |
| | | app:layout_constraintStart_toEndOf="@id/tv_push" |
| | | android:layout_marginStart="9dp"/> |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_push" |
| | | android:layout_marginTop="10dp" |
| | | android:layout_marginHorizontal="8dp" |
| | | android:id="@+id/rv_push"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | </androidx.core.widget.NestedScrollView> |
| | |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:id="@+id/banner" |
| | | app:indicator_selected_width="13dp" |
| | | app:indicator_normal_width="5dp" |
| | | app:indicator_height="5dp" |
| | | app:is_auto_loop="false" |
| | | app:layout_constraintDimensionRatio="39:31" |
| | | app:actualImageScaleType="centerCrop"/> |
| | | app:banner_indicator_selected_width="13dp" |
| | | app:banner_indicator_normal_width="5dp" |
| | | app:banner_indicator_height="5dp" |
| | | app:banner_indicator_selected_color="@color/white" |
| | | app:banner_indicator_normal_color="@color/white" |
| | | app:banner_auto_loop="true" |
| | | app:banner_infinite_loop="true" |
| | | app:layout_constraintDimensionRatio="3900:3135"/> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_address" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_phone" |
| | | android:layout_marginTop="9dp" |
| | | android:layout_marginStart="28dp" |
| | | android:drawableStart="@mipmap/detail_address" |
| | | android:drawablePadding="6dp" |
| | | android:textSize="9sp" |
| | | android:paddingVertical="9dp" |
| | | android:textColor="@color/textColor" |
| | | tools:text="成都市武侯区府城大道西段"/> |
| | | <TextView |
| | |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_time" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_address" |
| | | android:layout_marginTop="9dp" |
| | | android:layout_marginStart="28dp" |
| | | android:drawableStart="@mipmap/detail_time" |
| | | android:drawablePadding="6dp" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/webView" |
| | | android:layout_marginHorizontal="22dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_2" |
| | | android:layout_marginTop="30dp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
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"> |
| | | <TextView |
| | | android:id="@+id/tv_total" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="98dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_margin="14dp" |
| | | android:background="@drawable/bg_green_10dp" |
| | | android:textSize="24sp" |
| | | android:text="0" |
| | | android:gravity="center_horizontal" |
| | | android:paddingTop="15dp" |
| | | android:textColor="@color/white" |
| | | android:textStyle="bold"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginBottom="20dp" |
| | | android:text="当前能量值" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:alpha="0.8" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_total"/> |
| | | <com.flyco.tablayout.SlidingTabLayout |
| | | android:id="@+id/tab_bar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="44dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_total" |
| | | android:layout_marginTop="20dp" |
| | | app:tl_tab_space_equal="true" |
| | | app:tl_indicator_width="12dp" |
| | | app:tl_indicator_height="2dp" |
| | | app:tl_indicator_corner_radius="1dp" |
| | | app:tl_indicator_color="@color/textGreen" |
| | | app:tl_textsize="14sp" |
| | | app:tl_textUnselectColor="@color/textColor66" |
| | | app:tl_textSelectColor="@color/textGreen"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_bar" |
| | | /> |
| | | <androidx.viewpager.widget.ViewPager |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:id="@+id/view_pager" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_bar" |
| | | app:layout_constraintBottom_toBottomOf="parent"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_marginStart="7dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="12dp" |
| | | android:singleLine="true" |
| | | android:ellipsize="end" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" |
| | | tools:text="关于账户问题"/> |
| | |
| | | app:layout_constraintBottom_toTopOf="@id/tv_1" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:actualImageScaleType="centerInside" |
| | | app:roundingBorderColor="@color/white" |
| | | app:actualImageScaleType="fitXY" |
| | | app:placeholderImage="@color/page_bg" |
| | | android:layout_marginBottom="4dp" |
| | | app:roundingBorderWidth="8dp"/> |
| | | android:layout_marginBottom="4dp"/> |
| | | |
| | | <RelativeLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_marginTop="30dp" |
| | | android:background="@drawable/bg_grey_10dp_web" |
| | | app:layout_constraintBottom_toTopOf="@id/iv_code" |
| | | android:layout_marginBottom="50dp" |
| | | android:layout_marginBottom="45dp" |
| | | android:padding="10dp" |
| | | android:layout_marginHorizontal="16dp"> |
| | | <WebView |
| | |
| | | android:paddingVertical="13dp" |
| | | android:drawablePadding="10dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:textColor="@color/textColor" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="16sp" |
| | | android:textStyle="bold" |
| | | android:gravity="end"/> |
| | |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | |
| | | app:layout_constraintTop_toBottomOf="@id/cl" |
| | | android:layout_marginTop="60dp" |
| | | android:layout_marginHorizontal="35dp" |
| | | android:text="确认" |
| | | android:text="确认充值" |
| | | android:id="@+id/tv_action"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" |
| | | android:text="+86" |
| | | android:textColor="@color/textColor" |
| | | android:drawableEnd="@mipmap/icon_nav_open" |
| | | android:drawablePadding="2dp" |
| | | android:textSize="16sp"/> |
| | | |
| | |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <com.flyco.tablayout.SlidingTabLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="44dp" |
| | | android:layout_height="42dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:id="@+id/tab_bar" |
| | | app:tl_textSelectColor="@color/textGreen" |
| | |
| | | android:id="@+id/view_pager" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_marginTop="4dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_bar" |
| | | app:layout_constraintBottom_toBottomOf="parent"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1dp" |
| | | android:layout_marginTop="4dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_bar"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:drawablePadding="9dp" |
| | | android:hint="请输入冥想搜索内容" |
| | | android:singleLine="true" |
| | | android:maxLines="1" |
| | | android:imeOptions="actionDone" |
| | | android:paddingStart="15dp" |
| | | android:drawableStart="@mipmap/ic_search_grey"/> |
| | | <TextView |
| | |
| | | android:hint="请输入冥想搜索内容" |
| | | android:singleLine="true" |
| | | android:paddingStart="15dp" |
| | | android:imeOptions="actionDone" |
| | | android:drawableStart="@mipmap/ic_search_grey"/> |
| | | |
| | | <com.scwang.smart.refresh.layout.SmartRefreshLayout |
| | |
| | | android:layout_height="132dp" |
| | | android:layout_gravity="center" |
| | | android:layout_marginTop="10dp" |
| | | app:actualImageScaleType="centerInside" |
| | | app:roundingBorderColor="@color/white" |
| | | app:placeholderImage="@color/page_bg" |
| | | app:roundingBorderWidth="10dp"/> |
| | | app:actualImageScaleType="fitXY" |
| | | app:placeholderImage="@color/page_bg"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color"/> |
| | | <RelativeLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | <TextView |
| | | android:id="@+id/tv_update" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_form_text" |
| | | android:text="版本更新" |
| | | android:paddingHorizontal="12dp" |
| | | android:drawableEnd="@mipmap/more_black"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | 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"/> |
| | | </RelativeLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color"/> |
| | | <TextView |
| | | android:id="@+id/tv_unregister" |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="49dp" |
| | | app:layout_constraintTop_toBottomOf="@id/ll" |
| | | android:layout_marginStart="7dp" |
| | | android:layout_marginEnd="4dp" |
| | | android:layout_marginTop="9dp" |
| | | android:text="切换账号" |
| | | android:id="@+id/tv_switch" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="17sp" |
| | | android:gravity="center" |
| | | android:background="@drawable/bg_white_15dp"/> |
| | | android:background="@color/white"/> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="49dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_switch" |
| | | android:layout_marginStart="7dp" |
| | | android:layout_marginEnd="4dp" |
| | | android:layout_marginTop="9dp" |
| | | android:text="退出登录" |
| | | android:id="@+id/tv_logout" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="17sp" |
| | | android:gravity="center" |
| | | android:background="@drawable/bg_white_15dp"/> |
| | | android:background="@color/white"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | |
| | | <ImageView |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintDimensionRatio="390:483" |
| | | android:src="@mipmap/bg_share" |
| | | android:scaleType="fitXY" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | android:id="@+id/iv_share" |
| | | app:placeholderImageScaleType="fitXY" |
| | | app:actualImageScaleType="centerCrop" |
| | | app:placeholderImage="@mipmap/bg_share"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_title" |
| | |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginTop="60dp" |
| | | android:layout_marginTop="50dp" |
| | | android:fontFamily="@font/fly_flower_song" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/textGreen" /> |
| | |
| | | android:layout_gravity="center" |
| | | app:roundedCornerRadius="10dp" |
| | | android:layout_marginTop="50dp" |
| | | app:actualImageScaleType="centerInside" |
| | | app:actualImageScaleType="centerCrop" |
| | | app:roundingBorderColor="@color/white" |
| | | app:placeholderImage="@color/page_bg" |
| | | app:roundingBorderWidth="10dp"/> |
| | |
| | | app:layout_constraintTop_toBottomOf="@id/tv_action" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginHorizontal="20dp" |
| | | android:layout_marginTop="30dp" |
| | | android:layout_marginTop="20dp" |
| | | android:background="@drawable/bg_gradient_vertical" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp"> |
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" |
| | | android:background="@color/white" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <xyz.doikki.videoplayer.player.VideoView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintDimensionRatio="390:310" |
| | | android:id="@+id/mVideoView" |
| | | app:layout_constraintTop_toTopOf="parent"/> |
| | | <ImageView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintDimensionRatio="390:310" |
| | | android:id="@+id/iv_cover" |
| | | app:layout_constraintTop_toTopOf="parent"/> |
| | | <ImageView |
| | | android:layout_width="42dp" |
| | | android:layout_height="42dp" |
| | | android:id="@+id/ivPlay" |
| | | android:src="@mipmap/play_detail" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginTop="30dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="@id/iv_cover" |
| | | app:layout_constraintBottom_toBottomOf="@id/iv_cover"/> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:id="@+id/cl_title" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_width="match_parent" |
| | | android:background="@drawable/bg_shadow_top" |
| | | 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> |
| | | <TextView |
| | | android:id="@+id/tv_1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/mVideoView" |
| | | app:layout_constraintStart_toStartOf="@id/mVideoView" |
| | | android:layout_marginStart="20dp" |
| | | android:layout_marginTop="40dp" |
| | | android:textSize="15sp" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold" |
| | | android:text="课程目录"/> |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:id="@+id/rv_chapter" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginTop="18dp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:padding="10dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_action" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_skip" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="30dp" |
| | | android:text="选好了,进入下一步" |
| | | android:background="@drawable/bg_mid_green_30" |
| | | android:textColor="@color/white" |
| | | android:paddingVertical="12dp" |
| | | android:textSize="16sp" |
| | | android:layout_marginBottom="20dp" |
| | | android:paddingHorizontal="40dp"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | android:id="@+id/tv_last" |
| | |
| | | android:textSize="16sp" |
| | | android:layout_marginStart="30dp" |
| | | android:layout_marginEnd="20dp" |
| | | app:layout_constraintWidth_percent="0.32" |
| | | android:gravity="center" |
| | | android:background="@drawable/bg_deep_green_line_30" |
| | | android:text="上一步"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_action" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_skip" |
| | | app:layout_constraintStart_toEndOf="@id/tv_last" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="30dp" |
| | | android:text="选好了,进入下一步" |
| | | android:gravity="center" |
| | | android:background="@drawable/bg_mid_green_30" |
| | | android:textColor="@color/white" |
| | | android:paddingVertical="12dp" |
| | | android:textSize="16sp" |
| | | android:layout_marginBottom="20dp"/> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:textSize="13sp" |
| | | android:layout_marginTop="10dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | android:text="1、账号信息、第三方授权、认证身份将被清空和取消; \n2、所有使用、收藏、关注列表和购买记录将被清空;\n 3、账户中所有的余额将被清空;\n 4、账户对应的会员身份与权益将被取消;\n 5、您在平台发布的内容将做匿名处理。 \n\n一经确认,以上内容将无法恢复,请谨慎考虑后决定。 \n\n根据相关法律法规,注销心泉·冥想账号并不代表注销前 的账号行为和相关责任得到豁免或减轻。 \n\n 提交注销申请后的15日内,后台将进行审核工作,如无问 题即可注销成功。在此期间如您登录,则视为取消注销申 请。"/> |
| | | android:text="1、账号信息、第三方授权、认证身份将被清空和取消; \n2、所有使用、收藏、关注列表和购买记录将被清空;\n 3、账户中所有的余额将被清空;\n 4、账户对应的会员身份与权益将被取消;\n 5、您在平台发布的内容将做匿名处理。 \n\n一经确认,以上内容将无法恢复,请谨慎考虑后决定。 \n\n根据相关法律法规,注销泉疗愈账号并不代表注销前 的账号行为和相关责任得到豁免或减轻。 \n\n "/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | app:layout_constraintTop_toTopOf="@id/tv_1" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_1" |
| | | android:id="@+id/iv_back"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:padding="10dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="4dp" |
| | | android:text="保存" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" |
| | | app:layout_constraintTop_toTopOf="@id/tv_1" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_1" |
| | | android:id="@+id/tv_save"/> |
| | | <ScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | |
| | | android:layout_marginStart="100dp" |
| | | android:layout_marginTop="30dp" |
| | | android:layout_marginEnd="14dp" |
| | | android:maxLength="12" |
| | | android:gravity="end" |
| | | android:textColor="@color/textColor" |
| | | android:singleLine="true" |
| | |
| | | android:textSize="22sp" |
| | | android:textStyle="bold"/> |
| | | <TextView |
| | | android:id="@+id/tv_describe" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="升级为高级会员,解锁全部体验" |
| | | android:text="升级为会员,解锁会员专属体验" |
| | | app:layout_constraintBottom_toBottomOf="@id/bg_vip" |
| | | app:layout_constraintStart_toStartOf="@id/bg_vip" |
| | | android:layout_marginStart="19dp" |
| | |
| | | android:layout_marginBottom="20dp"/> |
| | | <ImageView |
| | | android:id="@+id/iv_play" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_width="60dp" |
| | | android:layout_height="60dp" |
| | | android:src="@mipmap/play_detail" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_name"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | android:layout_marginTop="18dp" |
| | | android:text="00:00" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/white" |
| | | android:textStyle="bold" |
| | | android:paddingVertical="8dp" |
| | | android:paddingHorizontal="6dp" |
| | | android:id="@+id/tv_timer" |
| | | android:visibility="gone" |
| | | android:drawablePadding="5dp" |
| | | android:drawableStart="@mipmap/think_timer" |
| | | android:background="@drawable/bg_white_alpha_60_10dp" |
| | | android:layout_height="wrap_content"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:background="@color/white" |
| | | android:background="@drawable/bg_white_top_10dp" |
| | | android:layout_height="320dp"> |
| | | <TextView |
| | | android:id="@+id/tv_title" |
| | |
| | | android:background="@drawable/bg_white_10dp"> |
| | | |
| | | <TextView |
| | | android:id="@+id/rg_title" |
| | | android:id="@+id/tv_title" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="20dp" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="5dp" |
| | | android:background="@drawable/bg_shadow_bottom" |
| | | app:layout_constraintTop_toBottomOf="@id/rg_title" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | android:layout_marginTop="11dp"/> |
| | | |
| | | <WebView |
| | |
| | | android:layout_height="450dp" |
| | | android:paddingStart="14dp" |
| | | android:paddingEnd="14dp" |
| | | app:layout_constraintTop_toBottomOf="@id/rg_title" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | android:layout_marginTop="26dp"/> |
| | | |
| | | <androidx.constraintlayout.widget.Guideline |
| | |
| | | android:layout_height="30dp" |
| | | android:background="@drawable/bg_green_14"/> |
| | | <EditText |
| | | android:id="@+id/et_content" |
| | | android:layout_width="0dp" |
| | | android:layout_height="30dp" |
| | | android:background="@drawable/bg_grey_line_14dp" |
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"> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:orientation="vertical" |
| | | android:layout_marginHorizontal="24dp" |
| | | android:gravity="center" |
| | | android:background="@drawable/bg_white_10dp"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="兑换成功" |
| | | android:textStyle="bold" |
| | | android:textSize="18sp" |
| | | android:layout_marginTop="17dp" |
| | | android:textColor="@color/textColor" |
| | | /> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="40dp" |
| | | android:id="@+id/tv_code" |
| | | android:gravity="center" |
| | | android:layout_marginTop="15dp" |
| | | android:paddingHorizontal="30dp" |
| | | android:textColor="@color/textGreen" |
| | | android:textSize="14sp" |
| | | android:textStyle="bold" |
| | | android:background="@drawable/bg_green_4_alpha" |
| | | android:text="领取验证码:333221"/> |
| | | |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:id="@+id/iv_code" |
| | | android:layout_width="230dp" |
| | | android:layout_height="230dp" |
| | | android:layout_gravity="center" |
| | | android:layout_marginTop="10dp" |
| | | app:actualImageScaleType="centerInside" |
| | | app:roundingBorderColor="@color/white" |
| | | app:placeholderImage="@color/page_bg" |
| | | app:roundingBorderWidth="10dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="可添加助教微信,了解课程详情" |
| | | android:layout_gravity="center" |
| | | android:layout_marginTop="13dp" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="14sp"/> |
| | | <TextView |
| | | android:id="@+id/tv_action" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:layout_marginTop="24dp" |
| | | android:layout_marginHorizontal="38dp" |
| | | style="@style/style_btn_action" |
| | | android:text="知道了" |
| | | android:layout_marginBottom="24dp"/> |
| | | </LinearLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_width="match_parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:paddingBottom="20dp" |
| | | android:id="@+id/cl" |
| | | android:layout_marginHorizontal="20dp" |
| | | android:background="@drawable/bg_white_20dp" |
| | | android:layout_height="wrap_content"> |
| | |
| | | android:background="@drawable/bg_grey_line_20" |
| | | android:gravity="center_vertical|top" |
| | | android:padding="18dp" |
| | | android:maxLength="6" |
| | | android:inputType="number" |
| | | android:hint="请输入补充说明内容" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title"/> |
| | | |
| | |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_close" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/close_white" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/cl" |
| | | android:padding="10dp" |
| | | android:layout_marginTop="35dp"/> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout 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"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:paddingBottom="18dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginHorizontal="20dp" |
| | | android:background="@drawable/bg_white_10dp"> |
| | | <com.flyco.tablayout.SlidingTabLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="44dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="2dp" |
| | | app:tl_indicator_width="12dp" |
| | | app:tl_indicator_height="2dp" |
| | | app:tl_indicator_corner_radius="1dp" |
| | | app:tl_indicator_color="@color/colorPrimary" |
| | | app:tl_tab_space_equal="true" |
| | | app:tl_textsize="14sp" |
| | | app:tl_textSelectColor="@color/colorPrimary" |
| | | app:tl_textUnselectColor="@color/textColor66" |
| | | android:id="@+id/tab_top"/> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="3dp" |
| | | android:background="@drawable/bg_shadow_bottom" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_top" |
| | | android:layout_marginTop="6dp"/> |
| | | <com.sinata.xqmuse.views.NoScrollViewPager |
| | | android:layout_width="2dp" |
| | | android:layout_height="2dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:id="@+id/vp_fake"/> |
| | | <WebView |
| | | android:id="@+id/sc_content" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="450dp" |
| | | android:paddingStart="14dp" |
| | | android:paddingEnd="14dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_top" |
| | | android:layout_marginTop="18dp"/> |
| | | |
| | | <androidx.constraintlayout.widget.Guideline |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:id="@+id/center" |
| | | app:layout_constraintGuide_percent="0.5" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_cancel" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:text="拒绝" |
| | | android:textColor="@color/colorPrimary" |
| | | android:textSize="14sp" |
| | | android:background="@drawable/bg_green_line_22dp" |
| | | app:layout_constraintEnd_toStartOf="@id/center" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:paddingTop="9dp" |
| | | android:paddingBottom="9dp" |
| | | android:paddingHorizontal="35dp" |
| | | android:layout_marginTop="14dp" |
| | | app:layout_constraintTop_toBottomOf="@id/sc_content" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_ok" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center" |
| | | android:text="确定" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:textStyle="bold" |
| | | android:paddingTop="9dp" |
| | | android:paddingBottom="9dp" |
| | | android:paddingHorizontal="35dp" |
| | | android:background="@drawable/bg_btn_dialog_ok" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/center" |
| | | app:layout_constraintTop_toTopOf="@id/tv_cancel" /> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
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"> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:background="@drawable/bg_white_top_20dp"> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_gaode" |
| | | android:text="高德地图" |
| | | android:layout_marginTop="5dp" |
| | | android:gravity="center" |
| | | android:paddingVertical="12dp" |
| | | style="@style/style_common_text"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_baidu" |
| | | android:text="百度地图" |
| | | android:layout_marginTop="5dp" |
| | | android:gravity="center" |
| | | android:paddingVertical="12dp" |
| | | style="@style/style_common_text"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_tencent" |
| | | android:text="腾讯地图" |
| | | android:layout_marginTop="5dp" |
| | | android:gravity="center" |
| | | android:paddingVertical="12dp" |
| | | android:layout_marginBottom="5dp" |
| | | style="@style/style_common_text"/> |
| | | </LinearLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_marginHorizontal="25dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="30dp" |
| | | android:layout_marginTop="25dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title"> |
| | | |
| | | <RadioButton |
| | |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginTop="27dp"/> |
| | | android:layout_marginTop="15dp"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/rg_pay" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginBottom="18dp" |
| | | android:layout_marginBottom="6dp" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:textColor="@color/white" |
| | |
| | | android:text="确认" |
| | | android:paddingVertical="10dp" |
| | | android:textStyle="bold" |
| | | android:background="@drawable/bg_orange_20dp"/> |
| | | android:background="@drawable/bg_btn_enable"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | <?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="wrap_content" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | |
| | | <RadioGroup |
| | | android:id="@+id/rg_time" |
| | | <Space |
| | | android:layout_width="match_parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_height="60dp" |
| | | android:id="@+id/bg" |
| | | app:layout_constraintTop_toTopOf="parent"/> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:background="@drawable/bg_white_top_20dp" |
| | | android:paddingBottom="30dp" |
| | | android:layout_height="wrap_content"> |
| | | android:orientation="vertical" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toBottomOf="@id/bg" |
| | | app:layout_constraintBottom_toBottomOf="parent"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:background="@color/dividing_line_color" |
| | | android:layout_marginHorizontal="20dp" |
| | | android:layout_marginTop="20dp"/> |
| | | <RadioButton |
| | | <ScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_1" |
| | | android:text="举报提问" |
| | | android:layout_marginTop="20dp" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:checked="true" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_2" |
| | | android:text="违法违规" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_3" |
| | | android:text="色情低俗" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_4" |
| | | android:text="低差广告" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_5" |
| | | android:text="不友善、引战" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_6" |
| | | android:text="诱导关注点赞" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_7" |
| | | android:text="网络暴力" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_8" |
| | | android:text="其他" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"> |
| | | <RadioGroup |
| | | android:id="@+id/rg_time" |
| | | android:layout_width="match_parent" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_action" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toTopOf="parent"> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_1" |
| | | android:text="举报提问" |
| | | android:layout_marginTop="20dp" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:checked="true" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_2" |
| | | android:text="违法违规" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_3" |
| | | android:text="色情低俗" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_4" |
| | | android:text="低差广告" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_5" |
| | | android:text="不友善、引战" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_6" |
| | | android:text="诱导关注点赞" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_7" |
| | | android:text="网络暴力" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/rb_8" |
| | | android:text="其他" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | | </RadioGroup> |
| | | |
| | | </ScrollView> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_action" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_btn_action" |
| | | android:text="确定" |
| | | android:layout_marginBottom="20dp" |
| | | android:layout_marginTop="20dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginHorizontal="45dp"/> |
| | | </RadioGroup> |
| | | </LinearLayout> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | <SeekBar |
| | | android:layout_width="0dp" |
| | | android:layout_height="16dp" |
| | | android:progressDrawable="@drawable/progress_drawable" |
| | | android:progressDrawable="@drawable/progress_drawable_think_volume" |
| | | app:layout_constraintStart_toEndOf="@id/iv_silent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:progress="50" |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:background="@color/white" |
| | | android:paddingBottom="30dp" |
| | | android:background="@drawable/bg_white_2dp" |
| | | android:layout_height="wrap_content"> |
| | | <TextView |
| | | android:id="@+id/tv_title" |
| | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintEnd_toStartOf="@id/tv_save" |
| | | app:layout_constraintStart_toEndOf="@id/tv_wx" |
| | | android:id="@+id/tv_circle" |
| | | android:text="朋友圈" |
| | |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | android:layout_marginTop="23dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/tv_circle" |
| | | android:id="@+id/tv_save" |
| | | android:text="保存至相册" |
| | | android:drawableTop="@mipmap/baocunxiangce" |
| | | android:gravity="center" |
| | | android:textColor="@color/textColor" |
| | | android:visibility="gone" |
| | | android:textSize="12sp" |
| | | android:drawablePadding="8dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | android:layout_marginTop="23dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_cancel" |
| | |
| | | android:layout_width="match_parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:background="@drawable/bg_white_top_20dp" |
| | | android:paddingBottom="30dp" |
| | | android:paddingBottom="22dp" |
| | | android:layout_height="wrap_content"> |
| | | <RadioButton |
| | | android:layout_width="match_parent" |
| | |
| | | android:text="5分钟" |
| | | android:layout_marginTop="20dp" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:paddingVertical="18dp" |
| | | android:button="@null" |
| | | android:background="@null" |
| | | android:textStyle="bold" |
| | | android:checked="true" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | |
| | | android:id="@+id/rb_10" |
| | | android:text="10分钟" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:paddingVertical="18dp" |
| | | android:button="@null" |
| | | android:checked="true" |
| | | android:background="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | |
| | | android:id="@+id/rb_15" |
| | | android:text="15分钟" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:paddingVertical="18dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:background="@null" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | | android:textColor="@color/selector_green_grey"/> |
| | |
| | | android:id="@+id/rb_30" |
| | | android:text="30分钟" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:paddingVertical="18dp" |
| | | android:button="@null" |
| | | android:background="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | |
| | | android:id="@+id/rb_60" |
| | | android:text="60分钟" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:background="@null" |
| | | android:paddingVertical="18dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | |
| | | android:id="@+id/rb_90" |
| | | android:text="90分钟" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:paddingVertical="18dp" |
| | | android:button="@null" |
| | | android:background="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableEnd="@drawable/selector_check" |
| | |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:paddingVertical="18dp" |
| | | android:paddingHorizontal="25dp" |
| | | android:textColor="@color/textColor66"/> |
| | | <TextView |
| | |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:paddingVertical="18dp" |
| | | android:paddingHorizontal="25dp" |
| | | android:textColor="@color/textColor66"/> |
| | | <EditText |
| | |
| | | android:layout_height="33dp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_custom" |
| | | app:layout_constraintEnd_toStartOf="@id/tv_min" |
| | | android:text="0" |
| | | android:text="1" |
| | | android:textColor="@color/textColor" |
| | | android:gravity="center" |
| | | android:inputType="number" |
| | |
| | | android:id="@+id/rb_0" |
| | | android:text="关闭倒计时" |
| | | android:textSize="16sp" |
| | | android:paddingVertical="22dp" |
| | | android:paddingVertical="18dp" |
| | | android:button="@null" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="25dp" |
| | |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_btn_action" |
| | | android:text="确定" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginTop="16dp" |
| | | android:layout_marginHorizontal="45dp"/> |
| | | </RadioGroup> |
| | | |
| | |
| | | android:layout_marginTop="35dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/tv_cancel" |
| | | android:background="@drawable/bg_btn_dialog_ok" |
| | | android:background="@drawable/bg_btn_enable" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_msg"/> |
| | | |
| | | <TextView |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:paddingBottom="17dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginHorizontal="45dp" |
| | | android:background="@mipmap/bg_tip" |
| | | android:layout_height="wrap_content"> |
| | | <TextView |
| | | android:id="@+id/tv_title" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="24dp" |
| | | android:layout_marginEnd="14dp" |
| | | android:gravity="center" |
| | | android:text="心泉之树" |
| | | android:textColor="@color/colorPrimary" |
| | | android:textSize="18sp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | <TextView |
| | | android:id="@+id/tv_msg" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="22dp" |
| | | android:layout_marginHorizontal="18dp" |
| | | android:lineSpacingExtra="10dp" |
| | | android:minHeight="100dp" |
| | | android:gravity="center_vertical" |
| | | android:text="亲爱的家人,感谢您用心的交流。\n现在,您心灵之树的种子已经植入这片沃土,请以农夫的心态用心浇灌,不久的将来,将会长成苍天大树,结出丰硕的果实。加油哦!" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_ok" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:gravity="center" |
| | | android:text="确定" |
| | | android:textColor="@color/white" |
| | | android:textSize="15sp" |
| | | android:layout_marginHorizontal="40dp" |
| | | android:textStyle="bold" |
| | | android:layout_marginTop="22dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:background="@drawable/bg_btn_enable" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_msg"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
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"> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_marginTop="25dp" |
| | | android:text="心泉课程" |
| | | android:textSize="20sp" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/black" |
| | | android:fontFamily="@font/sourcehansanscn_regular" |
| | | app:layout_constraintEnd_toEndOf="parent"/> |
| | | |
| | |
| | | android:layout_height="42dp" |
| | | android:id="@+id/et_search" |
| | | app:layout_constraintTop_toTopOf="@id/bg" |
| | | app:layout_constraintVertical_bias="0.56" |
| | | app:layout_constraintVertical_bias="0.6" |
| | | app:layout_constraintBottom_toBottomOf="@id/bg" |
| | | android:layout_marginHorizontal="34dp" |
| | | android:background="@drawable/bg_white_20dp" |
| | |
| | | android:textColor="@color/textColor" |
| | | android:imeActionLabel="搜索" |
| | | android:textColorHint="#DEDEDE" |
| | | android:paddingHorizontal="15dp" |
| | | android:paddingHorizontal="25dp" |
| | | android:drawableStart="@mipmap/ic_search_black"/> |
| | | |
| | | |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toBottomOf="@id/et_search" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginTop="32dp" |
| | | app:layout_constraintBottom_toBottomOf="parent"> |
| | | <com.scwang.smart.refresh.header.ClassicsHeader |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:id="@+id/rv_list" |
| | | android:layout_marginHorizontal="18dp" |
| | | app:layout_constraintTop_toBottomOf="@id/rv_filter" /> |
| | | android:layout_marginHorizontal="18dp" /> |
| | | <com.scwang.smart.refresh.footer.ClassicsFooter |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"/> |
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"> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_msg" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="24dp" |
| | | android:layout_marginHorizontal="20dp" |
| | | android:textSize="13sp" |
| | | android:textColor="@color/textColor"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="42dp" |
| | | android:id="@+id/tv_action" |
| | | android:layout_marginTop="40dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_msg" |
| | | android:layout_marginHorizontal="51dp" |
| | | android:gravity="center" |
| | | android:textColor="@color/white" |
| | | android:background="@drawable/bg_green_20dp" |
| | | /> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_marginTop="25dp" |
| | | android:text="心 泉 疗 愈" |
| | | android:textSize="20sp" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/black" |
| | | android:fontFamily="@font/sourcehansanscn_regular" |
| | | app:layout_constraintEnd_toEndOf="parent"/> |
| | | <TextView |
| | |
| | | android:text="0人已参加练习" |
| | | android:paddingEnd="18dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_length_today" |
| | | android:singleLine="true" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_today_count" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="18dp" |
| | | android:textSize="11sp" |
| | | android:textColor="@color/white" /> |
| | | |
| | | |
| | | <ImageView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | app:layout_constraintDimensionRatio="390:205" |
| | | android:scaleType="centerCrop" |
| | | android:src="@mipmap/ic_today" |
| | | android:id="@+id/iv_daily_empty" |
| | | android:layout_marginTop="6dp" /> |
| | | |
| | | <View |
| | | android:id="@+id/view_pri" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="9dp" |
| | | android:background="@color/page_bg" |
| | | app:layout_constraintTop_toBottomOf="@id/iv_today"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | android:textColor="@color/textColor" |
| | | android:fontFamily="@font/sourcehansanscn_regular"/> |
| | | <TextView |
| | | android:id="@+id/tv_sub_2" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="Private customization" |
| | |
| | | app:layout_constraintTop_toBottomOf="@id/tv_2" |
| | | app:layout_constraintDimensionRatio="390:205" |
| | | android:id="@+id/banner_privacy" |
| | | app:is_auto_loop="false" |
| | | app:banner_auto_loop="false" |
| | | android:layout_marginTop="6dp" /> |
| | | <ImageView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_marginTop="6dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_2" |
| | | app:layout_constraintDimensionRatio="390:205" |
| | | android:src="@mipmap/ic_pri" |
| | | android:scaleType="centerCrop" |
| | | android:id="@+id/iv_pri_empty"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:singleLine="true" |
| | | android:ellipsize="end" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_name" |
| | | android:layout_marginEnd="20dp" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_subtitle" |
| | | android:layout_marginBottom="4dp" |
| | | android:textStyle="bold" |
| | | android:textSize="18sp" |
| | | android:text="即刻开启私人订制课程" |
| | | android:textColor="@color/white" |
| | | app:layout_constraintStart_toEndOf="@id/iv_play"/> |
| | | <ImageView |
| | | android:id="@+id/iv_play" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/play_white" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="@id/tv_name" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_subtitle" |
| | | android:layout_marginStart="14dp" |
| | | android:padding="10dp"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | app:layout_constraintEnd_toEndOf="@id/tv_name" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_subtitle" |
| | | app:layout_constraintBottom_toBottomOf="@id/iv_pri_empty" |
| | | android:layout_marginBottom="16dp" |
| | | android:singleLine="true" |
| | | android:ellipsize="end" |
| | | app:layout_constraintStart_toStartOf="@id/tv_name" |
| | | android:textColor="@color/white" |
| | | android:textSize="10sp" |
| | | android:text="can be switched on" |
| | | android:textStyle="bold"/> |
| | | <androidx.constraintlayout.widget.Group |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/gp_pri_empty" |
| | | app:constraint_referenced_ids="tv_subtitle,iv_play,tv_name,iv_pri_empty"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="9dp" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/iv_guide" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="50dp" |
| | | android:id="@+id/rv_list"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.core.widget.NestedScrollView> |
| | |
| | | app:actualImageScaleType="centerCrop" |
| | | android:id="@+id/iv_avatar"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_name" |
| | | app:layout_constraintStart_toEndOf="@id/iv_avatar" |
| | | app:layout_constraintEnd_toStartOf="@id/iv_msg" |
| | | android:ellipsize="end" |
| | | android:singleLine="true" |
| | | android:layout_marginStart="11dp" |
| | | app:layout_constraintTop_toTopOf="@id/iv_avatar" |
| | | android:layout_marginTop="10dp" |
| | |
| | | android:textSize="22sp" |
| | | android:textStyle="bold"/> |
| | | <TextView |
| | | android:id="@+id/tv_describe" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="升级为高级会员,解锁全部体验" |
| | | android:text="升级为会员,解锁会员专属体验" |
| | | app:layout_constraintBottom_toBottomOf="@id/bg_vip" |
| | | app:layout_constraintStart_toStartOf="@id/bg_vip" |
| | | android:layout_marginStart="19dp" |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_level" |
| | | android:layout_marginHorizontal="21dp" |
| | | android:layout_marginTop="15dp" |
| | | android:paddingHorizontal="5dp" |
| | | app:layout_constraintTop_toBottomOf="@id/cl_data" |
| | |
| | | android:layout_height="28dp" |
| | | android:layout_gravity="center_vertical" |
| | | android:id="@+id/iv_vip" |
| | | app:actualImageScaleType="centerInside" |
| | | app:actualImageScaleType="centerCrop" |
| | | android:layout_marginStart="10dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="19dp" |
| | | android:layout_marginTop="9dp" |
| | | android:fontFamily="@font/sourcehansanscn_regular" |
| | | android:text="新手冥想指南" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="21sp" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginBottom="3dp" |
| | | android:text="Meditation guide" |
| | | android:textSize="8sp" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_1" |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" /> |
| | | |
| | | <com.youth.banner.Banner |
| | | android:id="@+id/banner" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_marginTop="6dp" |
| | | android:layout_marginTop="16dp" |
| | | android:src="@mipmap/bg_guide" |
| | | app:layout_constraintDimensionRatio="390:205" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" /> |
| | | |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="10dp" |
| | | android:background="@color/page_bg" |
| | | app:layout_constraintTop_toBottomOf="@id/banner" /> |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/rv_menu" |
| | | android:layout_width="match_parent" |
| | |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | app:layout_constraintTop_toBottomOf="@id/rv_menu" |
| | | android:paddingBottom="20dp" |
| | | android:background="@color/page_bg"> |
| | | <TextView |
| | | android:id="@+id/tv_2" |
| | |
| | | android:id="@+id/rv_course" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_2" |
| | | android:layout_marginTop="10dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="50dp" |
| | | android:layout_marginHorizontal="12dp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:id="@+id/banner" |
| | | android:layout_width="match_parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:indicator_height="0dp" |
| | | app:banner_indicator_height="0dp" |
| | | android:layout_height="220dp" |
| | | app:is_infinite_loop="true" |
| | | app:is_auto_loop="true"/> |
| | | app:banner_infinite_loop="true" |
| | | app:banner_auto_loop="true"/> |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/rv_list" |
| | | android:layout_width="match_parent" |
| | |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:background="@color/page_bg"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:paddingBottom="50dp" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | <xyz.doikki.videoplayer.player.VideoView |
| | |
| | | android:layout_marginTop="18dp" |
| | | android:id="@+id/mVideoView" |
| | | app:layout_constraintDimensionRatio="390:220"/> |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:id="@+id/iv_cover" |
| | | app:placeholderImage="@color/black" |
| | | app:layout_constraintTop_toTopOf="@id/mVideoView" |
| | | app:layout_constraintBottom_toBottomOf="@id/mVideoView" |
| | | app:actualImageScaleType="centerCrop"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/iv_play_teacher" |
| | | app:layout_constraintStart_toStartOf="@id/iv_cover" |
| | | app:layout_constraintEnd_toEndOf="@id/iv_cover" |
| | | app:layout_constraintTop_toTopOf="@id/iv_cover" |
| | | android:visibility="gone" |
| | | app:layout_constraintBottom_toBottomOf="@id/iv_cover" |
| | | android:src="@mipmap/play"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | <?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" |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/colorPrimary"> |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | <TextView |
| | | android:id="@+id/tv_1" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="85dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:background="@color/white" |
| | | android:text="树苗打卡站" |
| | | android:gravity="center|bottom" |
| | | android:paddingBottom="12dp" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="17sp" |
| | | android:textStyle="bold"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_1" |
| | | android:text="规则说明" |
| | | android:textSize="14sp" |
| | | android:padding="10dp" |
| | | android:layout_marginEnd="3dp" |
| | | android:id="@+id/tv_rule" |
| | | android:textColor="@color/textColor"/> |
| | | <androidx.coordinatorlayout.widget.CoordinatorLayout |
| | | android:id="@+id/cl" |
| | | android:layout_width="match_parent" |
| | | android:layout_marginTop="85dp" |
| | | android:background="@color/colorPrimary" |
| | | android:layout_height="match_parent"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | <xyz.doikki.videoplayer.player.VideoView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | app:screenScaleType="type_center_crop" |
| | | android:layout_marginBottom="20dp" |
| | | app:playerBackgroundColor="@color/white" |
| | | android:id="@+id/player"/> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/iv_sunshine" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/iv_water_anim" |
| | | android:layout_marginTop="110dp" |
| | | android:layout_marginEnd="50dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_power" |
| | | android:text="当前能量值:0" |
| | | android:textColor="@color/textGreen" |
| | | android:textSize="12sp" |
| | | android:drawableStart="@mipmap/ic_tree" |
| | | android:gravity="center" |
| | | android:drawablePadding="2dp" |
| | | android:layout_marginStart="14dp" |
| | | android:layout_marginTop="20dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent"/> |
| | | <TextView |
| | | android:id="@+id/tv_gif" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="35dp" |
| | | android:text="礼品兑换" |
| | | android:drawablePadding="3dp" |
| | | android:gravity="center_vertical|end" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:textStyle="bold" |
| | | android:paddingEnd="10dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:background="@drawable/bg_gradiant_gitf" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_power" |
| | | android:drawableStart="@mipmap/lipin"/> |
| | | <ImageView |
| | | android:id="@+id/iv_water" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/jiaoshui" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_gif" |
| | | android:layout_marginTop="50dp"/> |
| | | <View |
| | | android:id="@+id/bg_growth" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_width="10dp" |
| | | android:layout_marginBottom="20dp" |
| | | android:alpha="0.23" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="28dp" |
| | | android:background="@drawable/bg_white_line_2dp" |
| | | android:layout_height="161dp"/> |
| | | <View |
| | | android:id="@+id/progress" |
| | | android:layout_width="5dp" |
| | | android:layout_height="1dp" |
| | | app:layout_constraintBottom_toBottomOf="@id/bg_growth" |
| | | app:layout_constraintStart_toStartOf="@id/bg_growth" |
| | | app:layout_constraintEnd_toEndOf="@id/bg_growth" |
| | | android:layout_marginBottom="3dp" |
| | | android:background="@drawable/bg_growth"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_max" |
| | | app:layout_constraintBottom_toTopOf="@id/bg_growth" |
| | | app:layout_constraintStart_toStartOf="@id/bg_growth" |
| | | app:layout_constraintEnd_toEndOf="@id/bg_growth" |
| | | android:textSize="9sp" |
| | | android:layout_marginBottom="7dp" |
| | | android:alpha="0.7" |
| | | android:textColor="@color/white" |
| | | android:textStyle="bold" |
| | | tools:text="/1000"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_growth" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_max" |
| | | app:layout_constraintStart_toStartOf="@id/bg_growth" |
| | | app:layout_constraintEnd_toEndOf="@id/bg_growth" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/white" |
| | | android:textStyle="bold" |
| | | tools:text="900"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="成长值" |
| | | android:textColor="@color/darkGreen" |
| | | app:layout_constraintStart_toStartOf="@id/bg_growth" |
| | | app:layout_constraintEnd_toEndOf="@id/bg_growth" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_growth" |
| | | android:textSize="11sp" |
| | | android:textStyle="bold" |
| | | android:paddingHorizontal="5dp" |
| | | android:paddingVertical="1dp" |
| | | android:background="@drawable/bg_tv_growth"/> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/iv_tree" |
| | | app:layout_constraintTop_toTopOf="@id/player" |
| | | app:layout_constraintStart_toStartOf="@id/player" |
| | | app:layout_constraintEnd_toEndOf="@id/player" |
| | | android:paddingBottom="150dp" |
| | | app:layout_constraintBottom_toBottomOf="@id/player"/> |
| | | |
| | | <TextView |
| | | android:layout_width="164dp" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_again" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:background="@drawable/bg_white_grey_line_20dp" |
| | | android:textColor="@color/colorPrimary" |
| | | android:paddingVertical="10dp" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginBottom="80dp" |
| | | android:textStyle="bold" |
| | | android:visibility="gone" |
| | | android:textSize="15sp" |
| | | android:gravity="center" |
| | | android:text="重新播种"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | app:layout_behavior="@string/bottom_sheet_behavior" |
| | | android:id="@+id/bottom" |
| | | android:background="@drawable/bg_white_top_20dp" |
| | | android:layout_height="311dp"> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="53dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:text="任务列表" |
| | | android:textSize="20sp" |
| | | android:textColor="@color/textColor66" |
| | | android:textStyle="bold" |
| | | android:drawableStart="@mipmap/icon_all" |
| | | android:id="@+id/tv_title_task" |
| | | android:gravity="center_vertical" |
| | | android:paddingHorizontal="50dp" |
| | | android:drawablePadding="6dp" |
| | | android:background="@drawable/bg_grey_top_2p"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="Task List" |
| | | android:textSize="10sp" |
| | | app:layout_constraintEnd_toEndOf="@id/tv_title_task" |
| | | android:textColor="@color/textColor66" |
| | | android:layout_marginEnd="45dp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_title_task"/> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title_task" |
| | | android:orientation="vertical" |
| | | android:background="@color/white"> |
| | | <TextView |
| | | android:id="@+id/task_1" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="44dp" |
| | | android:layout_marginTop="31dp" |
| | | android:layout_marginHorizontal="21dp" |
| | | android:drawableStart="@mipmap/ic_task" |
| | | android:paddingStart="15dp" |
| | | android:text="每日打卡签到【+10能量值】" |
| | | android:textSize="12sp" |
| | | android:gravity="center_vertical" |
| | | android:drawablePadding="4dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:textColor="@color/white" |
| | | android:background="@drawable/bg_green_21dp"/> |
| | | <TextView |
| | | android:id="@+id/tv_sign" |
| | | android:layout_width="86dp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/task_1" |
| | | app:layout_constraintEnd_toEndOf="@id/task_1" |
| | | android:layout_marginEnd="9dp" |
| | | android:layout_height="25dp" |
| | | android:text="打卡签到" |
| | | android:enabled="true" |
| | | android:gravity="center" |
| | | android:textSize="12sp" |
| | | android:drawableStart="@drawable/black_ring" |
| | | android:paddingStart="12dp" |
| | | android:textColor="@color/selector_white_black_enable" |
| | | android:background="@drawable/selector_bg_task_enable"/> |
| | | <TextView |
| | | android:id="@+id/task_2" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="44dp" |
| | | android:layout_marginTop="17dp" |
| | | android:layout_marginHorizontal="21dp" |
| | | android:drawableStart="@mipmap/ic_task" |
| | | android:paddingStart="15dp" |
| | | android:text="每日疗愈满30分钟【+10能量值】" |
| | | android:textSize="12sp" |
| | | android:gravity="center_vertical" |
| | | android:drawablePadding="4dp" |
| | | app:layout_constraintTop_toBottomOf="@id/task_1" |
| | | android:textColor="@color/white" |
| | | android:background="@drawable/bg_green_21dp"/> |
| | | <TextView |
| | | android:id="@+id/tv_to_think" |
| | | android:layout_width="86dp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/task_2" |
| | | app:layout_constraintEnd_toEndOf="@id/task_1" |
| | | android:layout_marginEnd="9dp" |
| | | android:layout_height="25dp" |
| | | android:text="前往疗愈" |
| | | android:enabled="true" |
| | | android:gravity="center" |
| | | android:textSize="12sp" |
| | | android:drawableStart="@drawable/black_ring" |
| | | android:paddingStart="12dp" |
| | | android:textColor="@color/selector_white_black_enable" |
| | | android:background="@drawable/selector_bg_task_enable"/> |
| | | <TextView |
| | | android:id="@+id/task_3" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="44dp" |
| | | android:layout_marginTop="17dp" |
| | | android:layout_marginHorizontal="21dp" |
| | | android:drawableStart="@mipmap/ic_task" |
| | | android:paddingStart="15dp" |
| | | android:text="每日疗愈满60分钟【+20能量值】" |
| | | android:textSize="12sp" |
| | | android:gravity="center_vertical" |
| | | android:drawablePadding="4dp" |
| | | app:layout_constraintTop_toBottomOf="@id/task_2" |
| | | android:textColor="@color/white" |
| | | android:background="@drawable/bg_green_21dp"/> |
| | | <TextView |
| | | android:id="@+id/tv_to_think_2" |
| | | android:layout_width="86dp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/task_3" |
| | | app:layout_constraintEnd_toEndOf="@id/task_1" |
| | | android:layout_marginEnd="9dp" |
| | | android:layout_height="25dp" |
| | | android:text="前往疗愈" |
| | | android:enabled="true" |
| | | android:gravity="center" |
| | | android:textSize="12sp" |
| | | android:drawableStart="@drawable/black_ring" |
| | | android:paddingStart="12dp" |
| | | android:textColor="@color/selector_white_black_enable" |
| | | android:background="@drawable/selector_bg_task_enable"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.coordinatorlayout.widget.CoordinatorLayout> |
| | | <ImageView |
| | | android:id="@+id/signed" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:visibility="gone" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:src="@mipmap/signed"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | app:layout_constraintBottom_toBottomOf="@id/iv_bg" |
| | | android:background="@drawable/bg_black_alpha50_bottom_25"> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_width="0dp" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toStartOf="@id/play" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="15dp" |
| | | android:layout_marginStart="18dp" |
| | | android:layout_marginStart="16dp" |
| | | android:layout_marginEnd="4dp" |
| | | android:text="缓解压力" |
| | | android:singleLine="true" |
| | | android:ellipsize="end" |
| | | android:textSize="11sp" |
| | | android:textColor="@color/white" |
| | | android:id="@+id/tv_title"/> |
| | |
| | | android:layout_marginStart="2dp" |
| | | android:text="0"/> |
| | | <ImageView |
| | | android:id="@+id/play" |
| | | android:layout_width="29dp" |
| | | android:layout_height="29dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:layout_marginBottom="10dp" |
| | | android:background="@drawable/bg_white_alpha_20_10dp"> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_title" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="15dp" |
| | | android:layout_marginTop="13dp" |
| | | android:layout_marginStart="11dp" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toStartOf="@id/play" |
| | | android:singleLine="true" |
| | | android:layout_marginEnd="3dp" |
| | | android:ellipsize="end" |
| | | android:textColor="@color/white" |
| | | android:textSize="20sp" |
| | | android:textStyle="bold" |
| | |
| | | app:layout_constraintStart_toStartOf="@id/tv_title" |
| | | android:layout_marginTop="5dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="15dp" |
| | | android:layout_marginBottom="13dp" |
| | | android:textStyle="bold" |
| | | android:text="想法思绪"/> |
| | | <TextView |
| | |
| | | android:textStyle="bold" |
| | | android:text="0"/> |
| | | <ImageView |
| | | android:id="@+id/play" |
| | | android:layout_width="42dp" |
| | | android:layout_height="42dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | |
| | | android:src="@mipmap/ic_vip"/> |
| | | |
| | | <TextView |
| | | android:layout_width="26dp" |
| | | android:layout_height="26dp" |
| | | android:layout_width="28dp" |
| | | android:layout_height="28dp" |
| | | android:id="@+id/tv_price" |
| | | app:layout_constraintTop_toTopOf="@id/iv_bg" |
| | | app:layout_constraintStart_toStartOf="@id/iv_bg" |
| | | android:layout_margin="22dp" |
| | | android:text="0.0" |
| | | android:textSize="10sp" |
| | | android:textSize="9sp" |
| | | android:textColor="@color/white" |
| | | android:gravity="center" |
| | | android:background="@drawable/bg_brown_30"/> |
| | |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | <TextView |
| | | android:id="@+id/tv" |
| | | android:id="@+id/tv_action" |
| | | android:layout_width="70dp" |
| | | android:layout_height="30dp" |
| | | android:textSize="14sp" |
| | |
| | | android:text="1" |
| | | android:textColor="@color/textColor99" |
| | | android:textSize="16sp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv"/> |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_action"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | |
| | | app:layout_constraintStart_toStartOf="@id/iv_bg" |
| | | android:layout_margin="15dp" |
| | | android:text="0.0" |
| | | android:textSize="10sp" |
| | | android:textSize="8sp" |
| | | android:textColor="@color/white" |
| | | android:gravity="center" |
| | | android:background="@drawable/bg_brown_30"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_not_pay" |
| | | app:layout_constraintTop_toTopOf="@id/iv_bg" |
| | | app:layout_constraintStart_toStartOf="@id/iv_bg" |
| | | android:layout_margin="15dp" |
| | | android:text="0.0" |
| | | android:paddingVertical="4dp" |
| | | android:paddingStart="10dp" |
| | | android:paddingEnd="8dp" |
| | | android:textSize="10sp" |
| | | android:visibility="gone" |
| | | android:textColor="@color/white" |
| | | android:background="@drawable/bg_brown_30"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_free" |
| | | android:visibility="gone" |
| | | android:src="@mipmap/xianmian" |
| | | app:layout_constraintTop_toTopOf="@id/iv_bg" |
| | | app:layout_constraintStart_toStartOf="@id/iv_bg" |
| | | android:layout_margin="8dp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | app:layout_constraintStart_toStartOf="@id/iv_bg" |
| | | android:layout_margin="8dp" |
| | | android:text="0.0" |
| | | android:textSize="10sp" |
| | | android:textSize="8sp" |
| | | android:textColor="@color/white" |
| | | android:gravity="center" |
| | | android:background="@drawable/bg_brown_30"/> |
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="wrap_content" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/bg_white_10dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginHorizontal="13dp" |
| | | android:layout_marginTop="7dp" |
| | | android:elevation="2dp" |
| | | android:id="@+id/cl_root" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="5dp"> |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:layout_width="50dp" |
| | | android:layout_height="50dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:roundedCornerRadius="4dp" |
| | | app:actualImageScaleType="centerCrop" |
| | | app:placeholderImage="@color/page_bg" |
| | | android:id="@+id/iv_cover" |
| | | android:layout_marginStart="11dp" |
| | | android:layout_marginTop="15dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="15dp"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:src="@mipmap/dui" |
| | | android:layout_marginEnd="5dp" |
| | | android:id="@+id/iv"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toEndOf="@id/iv_cover" |
| | | app:layout_constraintEnd_toStartOf="@id/iv" |
| | | app:layout_constraintTop_toTopOf="@id/iv_cover" |
| | | android:layout_marginStart="10dp" |
| | | android:textSize="12sp" |
| | | android:id="@+id/tv_name" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/textColor" |
| | | android:singleLine="true" |
| | | android:text="奖品名称名称名称"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toEndOf="@id/iv_cover" |
| | | app:layout_constraintEnd_toStartOf="@id/iv" |
| | | app:layout_constraintBottom_toBottomOf="@id/iv_cover" |
| | | android:layout_marginStart="10dp" |
| | | android:textSize="10sp" |
| | | android:textColor="@color/textColor66" |
| | | android:singleLine="true" |
| | | android:id="@+id/tv_power" |
| | | android:text="奖品名称名称名称"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toEndOf="@id/iv_cover" |
| | | app:layout_constraintEnd_toStartOf="@id/iv" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_power" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_name" |
| | | android:layout_marginStart="10dp" |
| | | android:textSize="10sp" |
| | | android:textColor="@color/textColor66" |
| | | android:singleLine="true" |
| | | android:id="@+id/tv_price" |
| | | android:text="奖品名称名称名称"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/yiduihuan" |
| | | app:layout_constraintEnd_toStartOf="@id/iv" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:id="@+id/iv_used"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
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="wrap_content" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/bg_white_10dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginHorizontal="13dp" |
| | | android:layout_marginTop="7dp" |
| | | android:elevation="2dp" |
| | | android:id="@+id/cl_root" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="5dp"> |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:layout_width="50dp" |
| | | android:layout_height="50dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:roundedCornerRadius="4dp" |
| | | app:actualImageScaleType="centerCrop" |
| | | app:placeholderImage="@color/page_bg" |
| | | android:id="@+id/iv_cover" |
| | | android:layout_marginStart="11dp" |
| | | android:layout_marginTop="15dp"/> |
| | | |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toEndOf="@id/iv_cover" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="14dp" |
| | | app:layout_constraintTop_toTopOf="@id/iv_cover" |
| | | android:layout_marginStart="10dp" |
| | | android:textSize="12sp" |
| | | android:id="@+id/tv_name" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/textColor" |
| | | android:singleLine="true" |
| | | android:text="奖品名称名称名称"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toEndOf="@id/iv_cover" |
| | | app:layout_constraintBottom_toBottomOf="@id/iv_cover" |
| | | android:layout_marginStart="10dp" |
| | | android:textSize="10sp" |
| | | android:textColor="@color/textColor66" |
| | | android:singleLine="true" |
| | | android:id="@+id/tv_power" |
| | | android:text="奖品名称名称名称"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toEndOf="@id/iv_cover" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_power" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_name" |
| | | android:layout_marginStart="10dp" |
| | | android:textSize="10sp" |
| | | android:textColor="@color/textColor66" |
| | | android:singleLine="true" |
| | | android:id="@+id/tv_price" |
| | | android:text="奖品名称名称名称"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/iv_cover" |
| | | android:layout_marginTop="14dp" |
| | | android:layout_marginStart="11dp"/> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:id="@+id/tv_code" |
| | | android:gravity="center" |
| | | android:layout_marginTop="20dp" |
| | | android:paddingHorizontal="30dp" |
| | | android:textColor="@color/textGreen" |
| | | android:textSize="14sp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toBottomOf="@id/iv_cover" |
| | | android:layout_marginStart="11dp" |
| | | android:visibility="gone" |
| | | android:layout_marginEnd="6dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="6dp" |
| | | android:background="@drawable/bg_green_4_alpha" |
| | | android:text="领取验证码:333221"/> |
| | | <TextView |
| | | android:layout_width="72dp" |
| | | android:layout_height="28dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/white" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:id="@+id/tv_state"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_height="259dp" |
| | | android:layout_marginTop="20dp" |
| | | android:visibility="gone" |
| | | app:is_auto_loop="false" |
| | | app:banner_auto_loop="false" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | android:id="@+id/banner_landscape"/> |
| | | <com.youth.banner.Banner |
| | | android:layout_width="match_parent" |
| | | android:layout_height="214dp" |
| | | android:visibility="gone" |
| | | app:is_auto_loop="false" |
| | | app:banner_auto_loop="false" |
| | | app:banner_infinite_loop="false" |
| | | android:layout_marginTop="20dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | android:id="@+id/banner_card"/> |
| | |
| | | app:roundedCornerRadius="10dp" |
| | | app:actualImageScaleType="centerCrop" |
| | | app:placeholderImage="@color/page_bg" |
| | | android:layout_margin="10dp"/> |
| | | android:layout_margin="6dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="16dp" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginTop="15dp" |
| | | android:id="@+id/iv"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_question" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="18dp" |
| | | android:layout_marginTop="14dp" |
| | | app:layout_constraintStart_toEndOf="@id/iv" |
| | | android:layout_marginStart="7dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:singleLine="true" |
| | | android:ellipsize="end" |
| | | android:layout_marginEnd="12dp" |
| | | android:textColor="@color/black" |
| | | android:textSize="15sp" |
| | |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_answer" |
| | | android:singleLine="true" |
| | | android:ellipsize="end" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_question" |
| | | android:layout_marginTop="10dp" |
| | | app:layout_constraintStart_toEndOf="@id/iv" |
| | |
| | | android:background="@color/dividing_line_color" |
| | | android:layout_marginHorizontal="16dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_answer" |
| | | android:layout_marginTop="20dp"/> |
| | | android:layout_marginTop="15dp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintDimensionRatio="111:132" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="12dp" |
| | | android:layout_marginHorizontal="6dp" |
| | |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_name" |
| | | android:layout_marginTop="10dp" |
| | | app:layout_constraintBottom_toTopOf="@id/tv_daily_price" |
| | | android:text="20"/> |
| | | <TextView |
| | | android:id="@+id/tv_daily_price" |
| | |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_price" |
| | | android:layout_marginTop="10dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="30dp" |
| | | android:text="20"/> |
| | |
| | | <color name="colorTextOrange">#EF6D3B</color> |
| | | <color name="colorTextDark">#2F5264</color> |
| | | <color name="dkplayer_theme_color">@color/colorAccent</color> |
| | | <color name="black1a">#1a000000</color> |
| | | <color name="black33">#33000000</color> |
| | | <color name="black45">#73606060</color> |
| | | </resources> |
| | |
| | | <resources> |
| | | <string name="app_name">心泉·疗愈</string> |
| | | <string name="app_name">泉疗愈</string> |
| | | <string name="id_card">1234567890Xx</string> |
| | | <string name="储值说明"><u>储值说明?</u></string> |
| | | <string name="reserve_record"><u>上课记录</u></string> |
| | |
| | | <item name="android:background">@drawable/selector_bg_filter</item> |
| | | </style> |
| | | |
| | | <!-- 解析题筛选CheckBox样式--> |
| | | <style name="style_rb_analysis"> |
| | | <item name="android:paddingTop">5dp</item> |
| | | <item name="android:paddingBottom">5dp</item> |
| | | <item name="android:textSize">15sp</item> |
| | | <item name="android:textColor">@color/selector_grey_white</item> |
| | | <item name="android:gravity">center</item> |
| | | <item name="android:button">@null</item> |
| | | <item name="android:background">@drawable/selector_bg_cb_analysis</item> |
| | | </style> |
| | | |
| | | <!-- 通用的simpledraweeView--> |
| | | <style name="style_common_img"> |
| | | <item name="placeholderImage">@color/page_bg</item> |
| | |
| | | import androidx.fragment.app.Fragment |
| | | import androidx.fragment.app.FragmentManager |
| | | import cn.sinata.xldutils.R |
| | | import org.jetbrains.anko.dip |
| | | |
| | | /** |
| | | * 扩展方法:允许DialogFragment使用 commitAllowingStateLoss 弹窗 |
| | |
| | | toast.view = toastLayout |
| | | toast.show() |
| | | } |
| | | |
| | | fun Context.whiteToast(message: CharSequence,longTime:Boolean=false) { |
| | | val toast = Toast(this) |
| | | toast.duration = if (longTime)Toast.LENGTH_LONG else Toast.LENGTH_SHORT |
| | | toast.setGravity(Gravity.CENTER, 0, dip(100)) |
| | | val toastLayout = LayoutInflater.from(this).inflate(R.layout.layout_white_toast, null) |
| | | val txtToast: TextView = toastLayout.findViewById(R.id.txt_toast) |
| | | txtToast.text = message |
| | | toast.view = toastLayout |
| | | toast.show() |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 返回格式化后的手机号,加空格 |
| | | */ |
| | | fun String?.formatPhone(): String { |
| | | if (!isValidPhone()) { |
| | | return this?:"" |
| | | } |
| | | return "${this!!.substring(0,3)} ${substring(3,7)} ${substring(7)}" |
| | | } |
| | | |
| | | /** |
| | | * 返回格式化后的手机号,加空格 |
| | | */ |
| | | fun String.ellipsize(maxCount:Int): String { |
| | | if (isNullOrEmpty()||length<maxCount){ |
| | | return this |
| | | } |
| | | return "${this!!.substring(0,maxCount)}…" |
| | | } |
| | | |
| | | /** |
| | | * 隐藏身份证号,必须不为null并且length大于10才返回处理后的字符串 |
| | | */ |
| | | fun String?.hideIdCard(): String { |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="15dp"/> |
| | | <solid android:color="#99ffffff"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:id="@+id/container" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_toast" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/bg_white_60_15dp" |
| | | android:paddingVertical="8dp" |
| | | android:paddingHorizontal="20dp" |
| | | android:textColor="@color/white" /> |
| | | </LinearLayout> |