中建365
@ -0,0 +1,234 @@
|
|||||||
|
package com.zj365.dc.activity
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.text.Editable
|
||||||
|
import android.text.TextWatcher
|
||||||
|
import android.util.Log
|
||||||
|
import com.alibaba.android.arouter.facade.annotation.Route
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter
|
||||||
|
import com.luck.picture.lib.PictureSelector
|
||||||
|
import com.luck.picture.lib.config.PictureConfig
|
||||||
|
import com.tamsiree.rxkit.RxActivityTool
|
||||||
|
import com.tamsiree.rxkit.RxKeyboardTool
|
||||||
|
import com.tencent.qcloud.tuicore.TUILogin
|
||||||
|
import com.tencent.qcloud.tuicore.interfaces.TUICallback
|
||||||
|
import com.xty.base.act.BaseVmAct
|
||||||
|
import com.xty.common.TimeSelect
|
||||||
|
import com.xty.common.TimeUtils
|
||||||
|
import com.xty.common.arouter.ARouterUrl
|
||||||
|
import com.xty.common.arouter.RouteManager
|
||||||
|
import com.xty.common.event.MyInfoEvent
|
||||||
|
import com.xty.common.picture.PictureUtils
|
||||||
|
import com.xty.common.setImage
|
||||||
|
import com.xty.common.util.CommonToastUtils
|
||||||
|
import com.zj365.dc.R
|
||||||
|
import com.zj365.dc.databinding.ActInfoSimpleBinding
|
||||||
|
import com.zj365.dc.vm.InfoSimpleVm
|
||||||
|
import org.greenrobot.eventbus.EventBus
|
||||||
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基本信息
|
||||||
|
* 简单信息填写
|
||||||
|
*/
|
||||||
|
@Route(path = ARouterUrl.INFO_SIMPLE)
|
||||||
|
class InfoSimpleAct : BaseVmAct<InfoSimpleVm>() {
|
||||||
|
|
||||||
|
val binding by lazy { ActInfoSimpleBinding.inflate(layoutInflater) }
|
||||||
|
override fun setLayout() = binding.root
|
||||||
|
|
||||||
|
private var isBinding: Boolean = false
|
||||||
|
private var sexType = 1
|
||||||
|
private var birthdayType = 1
|
||||||
|
|
||||||
|
var phone: String = ""
|
||||||
|
private var pwd: String = ""
|
||||||
|
|
||||||
|
private val timeSelect by lazy { TimeSelect(this) {} }
|
||||||
|
private val textListener by lazy {
|
||||||
|
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?) {
|
||||||
|
binding.mName.removeTextChangedListener(this)
|
||||||
|
val str = s.toString().trim()
|
||||||
|
if (str.isNotEmpty()) {
|
||||||
|
val isNum = Pattern.matches("[0-9]", str.substring(0, 1))
|
||||||
|
if (isNum) {
|
||||||
|
if (str.length > 2) {
|
||||||
|
binding.mName.setText(str.substring(1, str.length))
|
||||||
|
} else {
|
||||||
|
binding.mName.setText("")
|
||||||
|
}
|
||||||
|
CommonToastUtils.showToast(R.string.name_first_num)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding.mName.addTextChangedListener(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun initData() {
|
||||||
|
super.initData()
|
||||||
|
isDarkBar = true
|
||||||
|
phone = intent.getStringExtra("phone").toString()
|
||||||
|
pwd = intent.getStringExtra("password").toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun initView() {
|
||||||
|
super.initView()
|
||||||
|
statusBar(binding.title.mView)
|
||||||
|
binding.title.mTvTitle.text = getString(R.string.base_info)
|
||||||
|
binding.title.mIvBack.setOnClickListener { finish() }
|
||||||
|
binding.mImage.setOnClickListener { PictureUtils.openCamera(this) }
|
||||||
|
// val calendaryear = Calendar.getInstance()
|
||||||
|
// calendaryear.add(Calendar.YEAR, -14)
|
||||||
|
timeSelect.startDate.set(1922, 0, 1)
|
||||||
|
// timeSelect.endDate = calendaryear
|
||||||
|
binding.llBirthday.setOnClickListener {
|
||||||
|
RxKeyboardTool.hideSoftInput(this)
|
||||||
|
timeSelect.selectTime(binding.mBirthday)
|
||||||
|
}
|
||||||
|
sexType = if (binding.checkSex.isChecked) 2 else 1
|
||||||
|
birthdayType = if (binding.checkBirthday.isChecked) 2 else 1
|
||||||
|
// binding.mRadio.setOnCheckedChangeListener { group, checkedId ->
|
||||||
|
// when(checkedId){
|
||||||
|
// R.id.mRadio1->birthdayType=1
|
||||||
|
// R.id.mRadio2->birthdayType=2
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
binding.bindingTv.setOnClickListener {
|
||||||
|
isBinding = true
|
||||||
|
// dialogChooseDevice.show()
|
||||||
|
turnToSaveBaseData()
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// binding.mGroup.setOnCheckedChangeListener { group, checkedId ->
|
||||||
|
// when(checkedId){
|
||||||
|
// R.id.mMale->sexType=1
|
||||||
|
// R.id.mGirl->sexType=2
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
binding.mName.addTextChangedListener(textListener)
|
||||||
|
|
||||||
|
binding.mSubmit.setOnClickListener {
|
||||||
|
isBinding = false
|
||||||
|
turnToSaveBaseData()
|
||||||
|
//跳转注册
|
||||||
|
// var bean =SimpleInfoBean()
|
||||||
|
// if( binding.mImage.tag!=null){
|
||||||
|
// bean.avatar= binding.mImage.tag.toString()
|
||||||
|
// }
|
||||||
|
// bean.name=name
|
||||||
|
// bean.sex=sexType
|
||||||
|
// bundle.clear()
|
||||||
|
// bundle.putSerializable("bean",bean)
|
||||||
|
// RouteManager.goActRequest(ARouterUrl.REGIST_ACT,this,1000,bundle)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用接口保存
|
||||||
|
*/
|
||||||
|
private fun turnToSaveBaseData() {
|
||||||
|
|
||||||
|
val birthDay = binding.mBirthday.text.toString().trim()
|
||||||
|
val name = binding.mName.text.toString().trim()
|
||||||
|
// if (name.isEmpty()) {
|
||||||
|
// isBinding = false
|
||||||
|
// ToastUtils.show(R.string.please_input_name)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
if (TimeUtils.getAgeByBirth(birthDay) < 14) {
|
||||||
|
CommonToastUtils.showToast("需要年满14岁才可使用")
|
||||||
|
isBinding = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val avatar = binding.mImage.tag
|
||||||
|
val datanal = avatar?.toString() ?: ""
|
||||||
|
val sexValue = if (binding.checkSex.isChecked) "2" else "1"
|
||||||
|
birthdayType = if (binding.checkBirthday.isChecked) 2 else 1
|
||||||
|
//调用接口
|
||||||
|
if (name.trim().isEmpty()) {
|
||||||
|
mViewModel.submit(datanal, null, sexValue, birthdayType.toString(), birthDay)
|
||||||
|
} else {
|
||||||
|
mViewModel.submit(datanal, name, sexValue, birthdayType.toString(), birthDay)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun liveObserver() {
|
||||||
|
mViewModel.setBasic.observe(this) {
|
||||||
|
|
||||||
|
//不管点击绑定还是完成都会去登录
|
||||||
|
EventBus.getDefault().post(MyInfoEvent())
|
||||||
|
mViewModel.login(phone, pwd)
|
||||||
|
|
||||||
|
if (isBinding) {
|
||||||
|
return@observe
|
||||||
|
}
|
||||||
|
CommonToastUtils.showSucceedToast("信息设置成功")
|
||||||
|
}
|
||||||
|
|
||||||
|
mViewModel.mLogin.observe(this) {
|
||||||
|
//登录成功请求用户token
|
||||||
|
mViewModel.getImUserSig("user_${it.data.id}")
|
||||||
|
}
|
||||||
|
|
||||||
|
mViewModel.getImUserSig.observe(this) {
|
||||||
|
Log.e("simon", "login" + it.data)
|
||||||
|
TUILogin.login(
|
||||||
|
applicationContext,
|
||||||
|
1400807230,
|
||||||
|
it.paramsData,
|
||||||
|
it.data,
|
||||||
|
object : TUICallback() {
|
||||||
|
override fun onSuccess() {
|
||||||
|
Log.e("simon", "onSuccess")
|
||||||
|
if (!isBinding) { //如果是直接点击完成,跳转到主页面
|
||||||
|
ARouter.getInstance().build(ARouterUrl.MAIN_ACT).navigation()
|
||||||
|
RxActivityTool.finishAllActivity()
|
||||||
|
} else { //如果是去绑定设备,跳转到设备选择界面,同是给予标记,告诉该界面已经登录
|
||||||
|
bundle.clear()
|
||||||
|
bundle.putBoolean("isLogin", true)
|
||||||
|
RouteManager.goAct(ARouterUrl.DEVICE_CHOICE, bundle)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(errorCode: Int, errorMessage: String?) {
|
||||||
|
Log.e("simon", "onError")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
|
|
||||||
|
if (resultCode === RESULT_OK) {
|
||||||
|
when (requestCode) {
|
||||||
|
PictureConfig.CHOOSE_REQUEST -> {
|
||||||
|
var result = PictureSelector.obtainMultipleResult(data)
|
||||||
|
if (result.size > 0) {
|
||||||
|
var path = if (result[0].compressPath.isEmpty()) {
|
||||||
|
result[0].androidQToPath
|
||||||
|
} else {
|
||||||
|
result[0].compressPath
|
||||||
|
}
|
||||||
|
binding.mImage.setImage(this, path)
|
||||||
|
binding.mImage.tag = path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
1000 -> {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.zj365.dc.adapter
|
||||||
|
|
||||||
|
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||||
|
import com.xty.base.adapter.BaseAdapter
|
||||||
|
import com.xty.common.Dateutils
|
||||||
|
import com.xty.network.model.ScienceBean
|
||||||
|
import com.xty.network.model.SystemMsgBean
|
||||||
|
import com.zj365.dc.R
|
||||||
|
|
||||||
|
class HomeMessageAdapter : BaseAdapter<SystemMsgBean>(R.layout.item_home_message) {
|
||||||
|
override fun convert(holder: BaseViewHolder, item: SystemMsgBean) {
|
||||||
|
holder.setText(R.id.tv_msg_title,item.title)
|
||||||
|
holder.setText(R.id.tv_msg_content,item.content)
|
||||||
|
holder.setText(R.id.tv_msg_time,Dateutils.formatTime(item.time,Dateutils.YYYY_MM_DD_HH_MM))
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.zj365.dc.fragment
|
||||||
|
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.view.View
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import com.xty.base.fragment.BaseFragList
|
||||||
|
import com.zj365.dc.adapter.HomeMessageAdapter
|
||||||
|
import com.zj365.dc.databinding.FragMessageBinding
|
||||||
|
import com.zj365.dc.vm.MessageVm
|
||||||
|
|
||||||
|
class MessageFragment : BaseFragList<MessageVm>() {
|
||||||
|
|
||||||
|
val binding by lazy { FragMessageBinding.inflate(layoutInflater) }
|
||||||
|
|
||||||
|
val adapter by lazy { HomeMessageAdapter() }
|
||||||
|
override fun initAdapter() {
|
||||||
|
binding.mRecycle.layoutManager= LinearLayoutManager(requireContext())
|
||||||
|
binding.mRecycle.adapter=adapter
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun initView() {
|
||||||
|
super.initView()
|
||||||
|
statusBar(binding.title.mView)
|
||||||
|
binding.title.mTvTitle.text="消息"
|
||||||
|
binding.title.mTvRight.text="全部已读"
|
||||||
|
binding.title.mTvRight.setTextColor(Color.parseColor("#02C191"))
|
||||||
|
binding.title.mTvRight.visibility = View.VISIBLE
|
||||||
|
binding.title.mIvBack.visibility = View.INVISIBLE
|
||||||
|
binding.title.mTvRight.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
|
initAdapter()
|
||||||
|
setRecycleRefresh(binding.mRecycle,binding.mRefresh)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun refresh() {
|
||||||
|
mViewModel.getSystemMsg()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setViewModel()= MessageVm()
|
||||||
|
|
||||||
|
override fun observer() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setLayout()=binding.root
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,123 @@
|
|||||||
|
package com.zj365.dc.vm
|
||||||
|
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.tamsiree.rxkit.RxTool
|
||||||
|
import com.xty.base.vm.BaseVm
|
||||||
|
import com.xty.common.Const
|
||||||
|
import com.xty.common.MMkvHelper
|
||||||
|
import com.xty.common.util.CommonToastUtils
|
||||||
|
import com.xty.network.model.ImageUploadBean
|
||||||
|
import com.xty.network.model.MainBean
|
||||||
|
import com.xty.network.model.NotAccepted
|
||||||
|
import com.xty.network.model.RespBody
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.async
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
|
import okhttp3.Headers
|
||||||
|
import okhttp3.MultipartBody
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
class InfoSimpleVm : BaseVm() {
|
||||||
|
|
||||||
|
val setBasic by lazy { MutableLiveData<RespBody<NotAccepted>>() }
|
||||||
|
val mLogin by lazy { MutableLiveData<RespBody<MainBean.User>>() }
|
||||||
|
val getImUserSig by lazy { MutableLiveData<RespBody<String>>() }
|
||||||
|
|
||||||
|
fun login(account: String, pwd: String) {
|
||||||
|
startHttp {
|
||||||
|
val json = JSONObject()
|
||||||
|
json.put("phone", account)
|
||||||
|
json.put("userPwd", RxTool.Md5(pwd))
|
||||||
|
//json.put("userPwd", pwd)
|
||||||
|
val login = apiInterface().login(retrofits.getRequestBody(json.toString()))
|
||||||
|
if (login.body()?.code == 500) {
|
||||||
|
login.body()?.msg?.let { CommonToastUtils.showToast(it) }
|
||||||
|
return@startHttp
|
||||||
|
}
|
||||||
|
saveToken(login.raw().headers)
|
||||||
|
val bodys = login.body() as RespBody
|
||||||
|
|
||||||
|
MMkvHelper.put(Const.USER_ID, bodys.data.id)
|
||||||
|
bodys.getCodeStatus(mLogin, nowData, loading)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun saveToken(headers: Headers) {
|
||||||
|
val headerIterator = headers.iterator()
|
||||||
|
while (headerIterator.hasNext()) {
|
||||||
|
val next = headerIterator.next()
|
||||||
|
if (Const.Auth_Token == next.first) MMkvHelper.put(Const.Auth_Token, next.second)
|
||||||
|
|
||||||
|
if (Const.Auth_Id == next.first) MMkvHelper.put(Const.Auth_Id, next.second)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getImUserSig(identifier: String) {
|
||||||
|
startHttp {
|
||||||
|
val imUserSig = apiInterface().getImUserSig(identifier)
|
||||||
|
imUserSig.body()?.getCodeStatus(getImUserSig, nowData, paramsData = identifier)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun submit(path: String, name: String?, sex: String, birthDaytype: String, birthDay: String) {
|
||||||
|
startHttp {
|
||||||
|
withContext(Dispatchers.IO) {
|
||||||
|
var fileId = ""
|
||||||
|
if (path.isNullOrEmpty()) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
val image = async { uploadImage(path) }
|
||||||
|
val await = image.await()
|
||||||
|
fileId = await.fileId
|
||||||
|
}
|
||||||
|
val upload = async { uploadInfo(name, sex, fileId, birthDaytype, birthDay) }
|
||||||
|
val await = upload.await() //个人信息上传
|
||||||
|
if (await.code != 0) {
|
||||||
|
CommonToastUtils.showToast(await.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private suspend fun uploadInfo(
|
||||||
|
name: String?,
|
||||||
|
sex: String,
|
||||||
|
fileId: String = "",
|
||||||
|
birthdayType: String,
|
||||||
|
birthDay: String
|
||||||
|
): RespBody<NotAccepted> {
|
||||||
|
val json = JSONObject()
|
||||||
|
json.put("name", name)
|
||||||
|
json.put("sex", sex)
|
||||||
|
if (sex == "1") {
|
||||||
|
json.put("height", "170")
|
||||||
|
json.put("weight", "65")
|
||||||
|
} else {
|
||||||
|
json.put("height", "160")
|
||||||
|
json.put("weight", "49")
|
||||||
|
}
|
||||||
|
|
||||||
|
json.put("birthday", birthDay)
|
||||||
|
json.put("birthdayType", birthdayType)
|
||||||
|
|
||||||
|
if (!fileId.isNullOrEmpty()) {
|
||||||
|
json.put("avatarUrl", fileId)
|
||||||
|
}
|
||||||
|
val rb = retrofits.getRequestBody(json.toString())
|
||||||
|
val body = apiInterface().setUpdateUser(rb)
|
||||||
|
body.getCodeStatus(setBasic, nowData)
|
||||||
|
return body
|
||||||
|
}
|
||||||
|
|
||||||
|
private suspend fun uploadImage(path: String): ImageUploadBean {
|
||||||
|
val f = File(path)
|
||||||
|
val fileRb = MultipartBody.Part.createFormData(
|
||||||
|
"file",
|
||||||
|
f.name,
|
||||||
|
retrofits.getMultiPartFileRb(f)
|
||||||
|
)
|
||||||
|
val body = apiInterface().uploadImage(fileRb)
|
||||||
|
return body.data
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.zj365.dc.vm
|
||||||
|
|
||||||
|
import com.xty.base.vm.BaseVm
|
||||||
|
|
||||||
|
class MessageVm(): BaseVm() {
|
||||||
|
|
||||||
|
fun getSystemMsg(){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,291 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/title"
|
||||||
|
layout="@layout/title_white_bar" />
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/title"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_marginRight="@dimen/dp_10"
|
||||||
|
android:background="@color/col_f1f" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="@dimen/dp_6"
|
||||||
|
android:paddingRight="@dimen/dp_10"
|
||||||
|
android:paddingBottom="@dimen/dp_6">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:drawablePadding="@dimen/dp_10"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:paddingLeft="@dimen/dp_12"
|
||||||
|
android:paddingTop="@dimen/dp_12"
|
||||||
|
android:paddingBottom="@dimen/dp_12"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/head_portrait"
|
||||||
|
android:textColor="@color/col_455"
|
||||||
|
android:textSize="@dimen/dp_14" />
|
||||||
|
|
||||||
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
|
android:id="@+id/mImage"
|
||||||
|
android:layout_width="@dimen/dp_46"
|
||||||
|
android:layout_height="@dimen/dp_46"
|
||||||
|
android:layout_marginRight="@dimen/dp_12"
|
||||||
|
android:layout_toLeftOf="@+id/right_im"
|
||||||
|
android:src="@mipmap/ic_default_man" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/right_im"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginRight="@dimen/dp_3"
|
||||||
|
android:src="@mipmap/arrow_right"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_marginRight="@dimen/dp_10"
|
||||||
|
android:background="@color/col_f1f" />
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/mRelName"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingRight="@dimen/dp_10">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/m1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:drawablePadding="@dimen/dp_10"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:paddingLeft="@dimen/dp_10"
|
||||||
|
android:paddingTop="@dimen/dp_15"
|
||||||
|
android:paddingBottom="@dimen/dp_15"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/name"
|
||||||
|
android:textColor="@color/col_455"
|
||||||
|
android:textSize="@dimen/dp_14" />
|
||||||
|
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
|
||||||
|
android:id="@+id/mName"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_toRightOf="@+id/m1"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="center|right"
|
||||||
|
android:paddingTop="@dimen/dp_15"
|
||||||
|
android:paddingBottom="@dimen/dp_15"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/col_455"
|
||||||
|
android:textSize="@dimen/dp_16"
|
||||||
|
tools:text="旅行者2号" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_marginRight="@dimen/dp_10"
|
||||||
|
android:background="@color/col_f1f" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingRight="@dimen/dp_10">
|
||||||
|
|
||||||
|
|
||||||
|
<com.xty.common.weight.RequiredTextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:drawablePadding="@dimen/dp_10"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:paddingLeft="@dimen/dp_10"
|
||||||
|
android:paddingTop="@dimen/dp_14"
|
||||||
|
android:paddingBottom="@dimen/dp_14"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/sex"
|
||||||
|
android:textColor="@color/col_455"
|
||||||
|
android:textSize="@dimen/dp_14" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/check_sex"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:checked="false"
|
||||||
|
android:background="@drawable/selector_check_sex_new"
|
||||||
|
android:button="@null"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_marginRight="@dimen/dp_10"
|
||||||
|
android:background="@color/col_f1f" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingRight="@dimen/dp_12"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<com.xty.common.weight.RequiredTextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:background="@null"
|
||||||
|
android:paddingLeft="@dimen/dp_10"
|
||||||
|
android:text="@string/birthday_type"
|
||||||
|
android:textColor="@color/col_455"
|
||||||
|
android:paddingTop="@dimen/dp_14"
|
||||||
|
android:paddingBottom="@dimen/dp_14"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textSize="@dimen/dp_14" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/check_birthday"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:checked="true"
|
||||||
|
android:background="@drawable/selector_check_birthday"
|
||||||
|
android:button="@null"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_marginRight="@dimen/dp_10"
|
||||||
|
android:background="@color/col_f1f" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_birthday"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<com.xty.common.weight.RequiredTextView
|
||||||
|
android:id="@+id/mBirthday_date"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:paddingLeft="@dimen/dp_10"
|
||||||
|
android:text="@string/birthday"
|
||||||
|
android:paddingTop="@dimen/dp_14"
|
||||||
|
android:textColor="@color/col_455"
|
||||||
|
android:paddingBottom="@dimen/dp_14"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textSize="@dimen/dp_14" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/mBirthday"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:drawablePadding="@dimen/dp_8"
|
||||||
|
android:layout_marginRight="@dimen/dp_12"
|
||||||
|
android:textSize="@dimen/dp_16"
|
||||||
|
android:hint=" 请选择生日 "
|
||||||
|
tools:text="2023-02-03"
|
||||||
|
android:textColorHint="@color/col_7b8"
|
||||||
|
android:textColor="@color/col_313"
|
||||||
|
android:drawableRight="@mipmap/arrow_right"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_marginRight="@dimen/dp_10"
|
||||||
|
android:background="@color/col_f1f" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_12"
|
||||||
|
android:layout_marginEnd="@dimen/dp_12"
|
||||||
|
android:textColor="@color/col_c7c"
|
||||||
|
android:textSize="@dimen/sp_13"
|
||||||
|
android:layout_marginBottom="@dimen/dp_50"
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
|
android:text="请完善以上基本信息,以便于更好的为您提供健管的服务"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginBottom="@dimen/dp_30"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:layout_weight="1"
|
||||||
|
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bindingTv"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="@dimen/dp_8"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_marginLeft="@dimen/dp_20"
|
||||||
|
android:paddingBottom="@dimen/dp_8"
|
||||||
|
android:paddingRight="@dimen/dp_20"
|
||||||
|
android:paddingLeft="@dimen/dp_20"
|
||||||
|
android:background="@drawable/shape_btn_select_bg_white"
|
||||||
|
android:textColor="@color/col_8D0"
|
||||||
|
android:textSize="@dimen/dp_16"
|
||||||
|
android:text="去绑定手表"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/mSubmit"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingTop="@dimen/dp_8"
|
||||||
|
android:paddingBottom="@dimen/dp_8"
|
||||||
|
android:layout_marginLeft="@dimen/dp_20"
|
||||||
|
android:autoSizeMaxTextSize="@dimen/dp_20"
|
||||||
|
android:layout_marginRight="@dimen/dp_20"
|
||||||
|
android:background="@drawable/shape_btn_select_bg"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="@dimen/dp_10"
|
||||||
|
android:text="完成"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/dp_16" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
tools:ignore="MissingDefaultResource">
|
||||||
|
|
||||||
|
<include android:id="@+id/title"
|
||||||
|
layout="@layout/title_white_bar"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||||
|
android:id="@+id/mRefresh"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.scwang.smart.refresh.header.ClassicsHeader
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/mRecycle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="@dimen/dp_10" />
|
||||||
|
|
||||||
|
<com.scwang.smart.refresh.footer.ClassicsFooter
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 115 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 6.6 KiB |
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<stroke android:color="@color/col_25C" android:width="@dimen/dp_1"/>
|
<stroke android:color="@color/col_02c" android:width="@dimen/dp_1"/>
|
||||||
<corners android:radius="@dimen/dp_15"/>
|
<corners android:radius="@dimen/dp_15"/>
|
||||||
</shape>
|
</shape>
|
After Width: | Height: | Size: 393 B |
Before Width: | Height: | Size: 460 B |
After Width: | Height: | Size: 462 B |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 2.9 KiB |
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,73 @@
|
|||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'org.jetbrains.kotlin.android'
|
||||||
|
id 'kotlin-kapt'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def androidId = rootProject.ext.defaultSetting
|
||||||
|
def rely = rootProject.ext.relyOn
|
||||||
|
def imagePrefix =rootProject.ext.image_preifx
|
||||||
|
android {
|
||||||
|
compileSdkVersion androidId.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion androidId.minSdk
|
||||||
|
targetSdkVersion androidId.targetSdk
|
||||||
|
versionCode androidId.versionCode
|
||||||
|
versionName androidId.versionName
|
||||||
|
|
||||||
|
kapt {
|
||||||
|
arguments {
|
||||||
|
arg("AROUTER_MODULE_NAME", project.getName())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ndk{
|
||||||
|
moduleName "libnew_native_libe"
|
||||||
|
ldLibs "log"
|
||||||
|
abiFilters "armeabi-v7a","arm64-v8a"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
buildConfigField("String","url","\"${url.release_url}\"")
|
||||||
|
buildConfigField("String", "image_prefix","\"${imagePrefix.release_url}\"")
|
||||||
|
|
||||||
|
buildConfigField("Boolean","isRelease",String.valueOf(true))
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
debug{
|
||||||
|
buildConfigField("String","url","\"${url.debug_url}\"")
|
||||||
|
|
||||||
|
buildConfigField("Boolean","isRelease",String.valueOf(false))
|
||||||
|
buildConfigField("String", "image_prefix","\"${imagePrefix.debug_url}\"")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
|
viewBinding{
|
||||||
|
enabled=true
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlinOptions{
|
||||||
|
jvmTarget="1.8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
flatDir {
|
||||||
|
dirs 'libs'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
api project(':base')
|
||||||
|
implementation (name: 'ycbtsdk-release', ext: 'aar')
|
||||||
|
kapt rely.arouter_compiler
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# You can control the set of applied configuration files using the
|
||||||
|
# proguardFiles setting in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,92 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@color/white">
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/title"
|
||||||
|
layout="@layout/title_white_bar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/mTvModifyPwd"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableRight="@mipmap/ic_next"
|
||||||
|
android:drawablePadding="@dimen/dp_10"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:paddingLeft="@dimen/dp_21"
|
||||||
|
android:paddingTop="@dimen/dp_20"
|
||||||
|
android:paddingRight="@dimen/dp_21"
|
||||||
|
android:paddingBottom="@dimen/dp_20"
|
||||||
|
android:layout_below="@+id/title"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/change_pwd"
|
||||||
|
android:textColor="@color/col_313"
|
||||||
|
android:textSize="@dimen/sp_15" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/mTvUserAgree"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableRight="@mipmap/ic_next"
|
||||||
|
android:drawablePadding="@dimen/dp_10"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:paddingLeft="@dimen/dp_21"
|
||||||
|
android:layout_below="@+id/mTvModifyPwd"
|
||||||
|
android:paddingTop="@dimen/dp_20"
|
||||||
|
android:paddingRight="@dimen/dp_21"
|
||||||
|
android:paddingBottom="@dimen/dp_20"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="用户协议"
|
||||||
|
android:textColor="@color/col_313"
|
||||||
|
android:textSize="@dimen/sp_15" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/mTvPrivacy"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableRight="@mipmap/ic_next"
|
||||||
|
android:drawablePadding="@dimen/dp_10"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:paddingLeft="@dimen/dp_21"
|
||||||
|
android:paddingTop="@dimen/dp_20"
|
||||||
|
android:layout_below="@+id/mTvUserAgree"
|
||||||
|
android:paddingRight="@dimen/dp_21"
|
||||||
|
android:paddingBottom="@dimen/dp_20"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="隐私协议"
|
||||||
|
android:textColor="@color/col_313"
|
||||||
|
android:textSize="@dimen/sp_15" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/mTvSignOut"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableRight="@mipmap/ic_next"
|
||||||
|
android:drawablePadding="@dimen/dp_10"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:paddingLeft="@dimen/dp_21"
|
||||||
|
android:paddingTop="@dimen/dp_20"
|
||||||
|
android:paddingRight="@dimen/dp_21"
|
||||||
|
android:layout_below="@+id/mTvPrivacy"
|
||||||
|
android:paddingBottom="@dimen/dp_20"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/account_dest"
|
||||||
|
android:textColor="@color/col_313"
|
||||||
|
android:textSize="@dimen/sp_15" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_logout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_44"
|
||||||
|
android:layout_marginRight="@dimen/dp_78"
|
||||||
|
android:layout_marginLeft="@dimen/dp_78"
|
||||||
|
android:background="@drawable/shape_btn_select_bg"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginBottom="@dimen/dp_67"
|
||||||
|
android:text="退出登录"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="@dimen/sp_16"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -0,0 +1,5 @@
|
|||||||
|
package com.xty.network.model
|
||||||
|
|
||||||
|
import android.content.ContentResolver
|
||||||
|
|
||||||
|
data class SystemMsgBean(var id:Long,var title:String,var time:Long,var content:String)
|