中建365

develop
wlh 2 years ago
parent d253ed4c83
commit 9d31c548f3

@ -28,7 +28,7 @@ android {
manifestPlaceholders = [
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "7f6d979240babce41b3625ab",
JPUSH_APPKEY : "4469bc1d5cfba9e5aea1cac4",
//.
JPUSH_CHANNEL : "developer-default",

@ -132,6 +132,16 @@
<activity android:name=".activity.HealthScienceAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".activity.DietManagementAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".activity.CalorieAnalyzeAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".activity.RecognizeResultAct"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<activity android:name=".activity.OneKeyBinderDeviceAct"
android:launchMode="singleTop"
@ -304,6 +314,63 @@
android:launchMode="singleTop"
android:screenOrientation="portrait"/>
<service
android:name="com.xty.common.services.MusicService"
android:exported="true"
android:label="music_service"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
<service android:name="com.amap.api.location.APSService" />
<service
android:name="com.xty.common.services.NoneService"
android:enabled="true"
android:exported="false"
android:process=":health_user_1">
<intent-filter>
<action android:name="com.xty.common.services.NoneService" />
</intent-filter>
</service>
<service
android:name="com.xty.common.services.JPushService"
android:exported="true"
android:process=":pushcore">
<intent-filter>
<action android:name="cn.jiguang.user.service.action" />
</intent-filter>
</service>
<receiver
android:name="com.xty.common.receiver.JpushReceive"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
<category android:name="com.xty.healthuser" />
</intent-filter>
</receiver>
<activity
android:name="com.zj365.dc.wxapi.WXEntryActivity"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTask"
android:taskAffinity="com.xty.healthuser"
android:theme="@style/Theme.AppCompat.NoActionBar.Transparent"></activity>
<activity
android:name="com.zj365.dc.wxapi.WXPayEntryActivity"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTask"
android:taskAffinity="com.xty.healthuser"
android:theme="@style/Theme.AppCompat.NoActionBar.Transparent" />
</application>
</manifest>

@ -0,0 +1,86 @@
package com.zj365.dc.activity
import android.view.LayoutInflater
import android.widget.TextView
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.luck.picture.lib.config.PictureMimeType
import com.xty.base.act.BaseVmAct
import com.xty.base.vm.BaseVm
import com.xty.common.arouter.ARouterUrl
import com.xty.common.picture.PictureUtils
import com.zj365.dc.databinding.ActCalorieAnalyzeBinding
import com.zj365.health.R
@Route(path = ARouterUrl.CALORIE_ANALYZE)
class CalorieAnalyzeAct : BaseVmAct<BaseVm>() {
val binding by lazy { ActCalorieAnalyzeBinding.inflate(layoutInflater) }
var bottomSheetDialog: BottomSheetDialog? = null
override fun liveObserver() {
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text = "热卡分析"
binding.title.mIvBack.setOnClickListener {
finish()
}
binding.tvContent.text = "1.注意事项、操作指南文案。平台能通过照片分析出大部分食物、水果蔬菜、菜品。上传更清晰完整的照片,分析结果更准确。" +
"\n2.平台能通过照片分析出大部分食物、水果蔬菜、菜品。\n" +
"3.上传更清晰完整的招聘,分析结果更准确。平台能通过照片分析出大部分食物。\n" +
"4.上传更清晰完整的照片,分析结果更准确。平台能通过照片分析出大部分食物、水果蔬菜、菜品。\n" +
"5.上传更清晰完整的招聘,分析结果更准确。平台能通过照片分析出大部分食物、水果蔬菜、菜品。上传更清晰完整的招聘,分析结果更准确。\n"
binding.tvDishes.setOnClickListener {
bottomSheetDialog?.show()
}
binding.tvFruitVegetable.setOnClickListener {
bottomSheetDialog?.show()
}
binding.tvSnack.setOnClickListener {
bottomSheetDialog?.show()
}
initBottomDialog()
}
override fun setLayout() = binding.root
fun initBottomDialog() {
if (bottomSheetDialog == null) {
bottomSheetDialog = BottomSheetDialog(this, R.style.Theme_ChartDialogManager)
bottomSheetDialog?.let { dialog ->
val view = LayoutInflater.from(this).inflate(R.layout.dialog_choose_pic, null)
dialog.setContentView(view)
val tvTakePhoto = view.findViewById<TextView>(R.id.tv_take_photo)
val tvChoosePhotoAlbum = view.findViewById<TextView>(R.id.tv_choose_photo_album)
val tvCancel = view.findViewById<TextView>(R.id.tv_cancel)
tvCancel.setOnClickListener {
dialog.dismiss()
}
tvTakePhoto.setOnClickListener {
PictureUtils.openTheCamera(this, PictureMimeType.ofImage())
dialog.dismiss()
}
tvChoosePhotoAlbum.setOnClickListener {
PictureUtils.openCamera(this, PictureMimeType.ofImage(),9)
dialog.dismiss()
}
}
}
}
}

@ -0,0 +1,59 @@
package com.zj365.dc.activity
import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseVmAct
import com.xty.base.vm.BaseVm
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.zj365.dc.R
import com.zj365.dc.databinding.ActDietManagementBinding
@Route(path = ARouterUrl.DIET_MANAGEMENT)
class DietManagementAct : BaseVmAct<BaseVm>(){
val binding by lazy{ ActDietManagementBinding.inflate(layoutInflater)}
override fun liveObserver() {
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text ="膳食管理"
binding.title.mIvBack.setOnClickListener {
finish()
}
binding.rxCalorie.setOnClickListener(setOnClickListener)
binding.rxHealthyDiet.setOnClickListener(setOnClickListener)
binding.rxMedicineFood.setOnClickListener(setOnClickListener)
binding.rxFoodDiary.setOnClickListener(setOnClickListener)
binding.rxMore.setOnClickListener(setOnClickListener)
}
var setOnClickListener = View.OnClickListener {
when(it.id){
R.id.rx_calorie ->{
RouteManager.goAct(ARouterUrl.CALORIE_ANALYZE)
}
R.id.rx_healthy_diet ->{
}
R.id.rx_medicine_food ->{
}
R.id.rx_food_diary ->{
}
R.id.rx_more ->{
}
}
}
override fun setLayout() = binding.root
}

@ -29,6 +29,7 @@ import com.xty.base.vp2.VpAdapter
import com.xty.common.Const
import com.xty.common.MMkvHelper
import com.xty.common.arouter.ARouterUrl
import com.xty.common.arouter.RouteManager
import com.xty.common.bracelet.checkBlueConnectPermission
import com.xty.common.event.MeasureWeightEvent
import com.xty.common.event.MqttReceive
@ -188,8 +189,13 @@ class MainActivity : BaseVmAct<MainVm>(), Consumer<AbstractMeasureData> {
}
R.id.nav_dynamic_management -> {
binding.mVp2.setCurrentItem(2, false)
return@setOnNavigationItemSelectedListener true
if (MMkvHelper.getLong(Const.USER_ID).toString() == "0"){
RouteManager.goAct(ARouterUrl.LOGIN_ACT)
}else{
binding.mVp2.setCurrentItem(2, false)
return@setOnNavigationItemSelectedListener true
}
}
R.id.nav_message -> {

@ -0,0 +1,95 @@
package com.zj365.dc.activity
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.luck.picture.lib.config.PictureMimeType
import com.xty.base.act.BaseVmAct
import com.xty.base.vm.BaseVm
import com.xty.common.arouter.ARouterUrl
import com.xty.common.picture.PictureUtils
import com.xty.common.util.SpannableUtils
import com.zj365.dc.adapter.RecognizeResultAdapter
import com.zj365.dc.databinding.ActRecognizeResultBinding
import com.zj365.health.R
@Route(path = ARouterUrl.RECOGNIZE_RESULT)
class RecognizeResultAct : BaseVmAct<BaseVm>() {
val binding by lazy{ ActRecognizeResultBinding.inflate(layoutInflater)}
val adapter by lazy { RecognizeResultAdapter() }
var bottomSheetDialog: BottomSheetDialog? = null
override fun liveObserver() {
}
override fun initView() {
super.initView()
statusBar(binding.title.mView)
binding.title.mTvTitle.text = "识别结果"
binding.title.mIvBack.setOnClickListener {
finish()
}
initAdapter()
binding.tvPhotographAgain.setOnClickListener {
}
binding.tvDetail.setOnClickListener {
}
initBottomDialog()
}
fun initAdapter(){
binding.recycler.layoutManager = LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false)
binding.recycler.adapter = adapter
adapter.setOnItemChildClickListener { adapter, view, position ->
}
}
override fun initData() {
super.initData()
}
override fun setLayout() = binding.root
fun initBottomDialog() {
if (bottomSheetDialog == null) {
bottomSheetDialog = BottomSheetDialog(this, R.style.Theme_ChartDialogManager)
bottomSheetDialog?.let { dialog ->
val view = LayoutInflater.from(this).inflate(R.layout.dialog_choose_pic, null)
dialog.setContentView(view)
val tvTakePhoto = view.findViewById<TextView>(R.id.tv_take_photo)
val tvChoosePhotoAlbum = view.findViewById<TextView>(R.id.tv_choose_photo_album)
val tvCancel = view.findViewById<TextView>(R.id.tv_cancel)
tvCancel.setOnClickListener {
dialog.dismiss()
}
tvTakePhoto.setOnClickListener {
PictureUtils.openTheCamera(this, PictureMimeType.ofImage())
dialog.dismiss()
}
tvChoosePhotoAlbum.setOnClickListener {
PictureUtils.openCamera(this, PictureMimeType.ofImage(),9)
dialog.dismiss()
}
}
}
}
}

@ -0,0 +1,13 @@
package com.zj365.dc.adapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.xty.network.model.HomeLayoutBean
import com.zj365.dc.R
class RecognizeResultAdapter : BaseAdapter<HomeLayoutBean.HomeChildBean>(R.layout.item_recognize_result){
override fun convert(holder: BaseViewHolder, item: HomeLayoutBean.HomeChildBean) {
}
}

@ -148,10 +148,10 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
* 0.心率1.血氧2.呼吸率3.体温4.步数5.睡眠6.血压7.血糖8.心电9.尿酸10.血脂
*/
private val pageIndexs = arrayOf(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
0, 1, 2, 3, 4, 5, 6, 7, 8, 9/*, 10*/
)
private val pageNames = arrayOf(
"心率", "血氧", "呼吸率", "体温", "步数", "睡眠", "血压", "血糖", "心电", "尿酸", "血脂"
"心率", "血氧", "呼吸率", "体温", "步数", "睡眠", "血压", "血糖", "心电", "尿酸"/*, "血脂"*/
)
@SuppressLint("ResourceType")
@ -826,7 +826,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
binding.mHeader.mWearInfo.visibility = View.INVISIBLE
binding.mHeader.mWatchType.visibility = View.INVISIBLE
} else {
binding.mHeader.mWatchType.visibility = View.VISIBLE
binding.mHeader.mWatchType.visibility = View.GONE
binding.mHeader.mWearInfo.visibility = View.VISIBLE
}
/*if (mFamilyAdapter.position != -1) {
@ -1751,7 +1751,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() {
}
}
binding.mHeader.mConnectStatu.visibility = View.VISIBLE
binding.mHeader.mConnectStatu.visibility = View.GONE
} else {
binding.mHeader.mBindState.apply {
text = "未绑定"

@ -280,6 +280,9 @@ HealthHomeFrag : BaseVmFrag<HomeVm>() {
}
"MEALS"->{ //膳食管理
bundle.clear()
bundle.putString("userId",showIdInfo)
RouteManager.goAct(ARouterUrl.DIET_MANAGEMENT,bundle)
}

@ -2,6 +2,8 @@ package com.zj365.dc.vm
import androidx.lifecycle.MutableLiveData
import com.xty.base.vm.BaseVm
import com.xty.common.Const
import com.xty.common.MMkvHelper
import com.xty.network.model.BannerBean
import com.xty.network.model.FamilyBean
import com.xty.network.model.HomeLayoutBean
@ -26,10 +28,7 @@ class HomeVm: BaseVm() {
startHttp(false) {
withContext(Dispatchers.IO){
var json = JSONObject()
json.put("userId",id)
json.put("location",location) // 1,首页顶部2首页中部
var nowLine = async{apiInterface().getBanners(retrofits.getRequestBody(json.toString()))}
var nowLine = async{apiInterface().getBanners(MMkvHelper.getLong(Const.USER_ID).toString(),location)}
var showInfo = nowLine.await()
// var value=apiInterface().getBanners(retrofits.getRequestBody(json.toString()))
var dataMap = setMapValue(bannerLive.value,showInfo.data,location)

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/col_6f7">
<include layout="@layout/title_white_bar"
android:id="@+id/title"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="@dimen/dp_14"
android:paddingTop="@dimen/dp_22"
android:paddingLeft="@dimen/dp_16"
android:paddingRight="@dimen/dp_23"
android:paddingBottom="@dimen/dp_26"
android:background="@drawable/shape_8round_white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
>
<com.ruffian.library.widget.RView
android:layout_width="@dimen/dp_4"
android:layout_height="@dimen/dp_18"
app:background_normal="@color/col_02c"
app:corner_radius="2dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_313"
android:text="提示文案标题"
android:textStyle="bold"
android:textSize="@dimen/sp_17"
android:paddingHorizontal="@dimen/dp_10"
/>
</LinearLayout>
<TextView
android:id="@+id/tv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_21"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_46">
<TextView
android:id="@+id/tv_dishes"
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_46"
android:layout_weight="1"
android:background="@drawable/shape_r25_02c"
android:textColor="@color/white"
android:textSize="@dimen/sp_18"
android:textStyle="bold"
android:gravity="center"
android:text="菜品"/>
<TextView
android:id="@+id/tv_fruit_vegetable"
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_46"
android:layout_weight="1"
android:layout_marginLeft="@dimen/dp_17"
android:layout_marginRight="@dimen/dp_17"
android:background="@drawable/shape_r25_02c"
android:textColor="@color/white"
android:textSize="@dimen/sp_18"
android:textStyle="bold"
android:gravity="center"
android:text="果蔬"/>
<TextView
android:id="@+id/tv_snack"
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_46"
android:layout_weight="1"
android:background="@drawable/shape_r25_02c"
android:textColor="@color/white"
android:textSize="@dimen/sp_18"
android:textStyle="bold"
android:gravity="center"
android:text="零食"/>
</LinearLayout>
</LinearLayout>

@ -9,12 +9,13 @@
android:id="@+id/title"/>
<RelativeLayout
android:id="@+id/rx_calorie"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_91"
android:orientation="horizontal"
android:background="@drawable/shape_8round_white"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_12">
@ -35,6 +36,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="热卡分析"
android:textStyle="bold"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"/>
<TextView
@ -50,12 +52,13 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/rx_healthy_diet"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_91"
android:orientation="horizontal"
android:background="@drawable/shape_8round_white"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_12">
@ -76,6 +79,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="健康食谱"
android:textStyle="bold"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"/>
<TextView
@ -90,12 +94,13 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/rx_medicine_food"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_91"
android:orientation="horizontal"
android:background="@drawable/shape_8round_white"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_12">
<ImageView
@ -115,6 +120,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="药食同源"
android:textStyle="bold"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"/>
<TextView
@ -129,12 +135,13 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/rx_food_diary"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_91"
android:orientation="horizontal"
android:background="@drawable/shape_8round_white"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_12">
<ImageView
@ -154,6 +161,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="饮食日记"
android:textStyle="bold"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"/>
<TextView
@ -168,12 +176,13 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/rx_more"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_91"
android:orientation="horizontal"
android:background="@drawable/shape_8round_white"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_12">
<ImageView
@ -193,6 +202,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="更多功能"
android:textStyle="bold"
android:textColor="@color/col_313"
android:textSize="@dimen/sp_15"/>
<TextView

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:background="@color/col_6f7"
android:layout_height="match_parent">
<include layout="@layout/title_white_bar"
android:id="@+id/title"/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14"
android:layout_marginLeft="@dimen/dp_14"
android:layout_below="@+id/title"
android:id="@+id/recycler"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@+id/recycler"
android:layout_marginLeft="@dimen/dp_27"
android:layout_marginTop="@dimen/dp_12"
android:id="@+id/ll_analyze">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_analyze_arrow"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_c7c"
android:layout_marginLeft="@dimen/dp_5"
android:text="相似解析"/>
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/ll_analyze"
android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_42"
android:layout_marginTop="@dimen/dp_12"
android:fitsSystemWindows="true"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="@dimen/dp_22"
android:paddingLeft="@dimen/dp_16"
android:paddingRight="@dimen/dp_16"
android:paddingBottom="@dimen/dp_25"
android:background="@drawable/shape_8round_white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
>
<com.ruffian.library.widget.RView
android:layout_width="@dimen/dp_4"
android:layout_height="@dimen/dp_18"
app:background_normal="@color/col_02c"
app:corner_radius="2dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_313"
android:text="识别结果"
android:textStyle="bold"
android:textSize="@dimen/sp_17"
android:paddingHorizontal="@dimen/dp_10"
/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_analyze_title"
android:textStyle="bold"
android:layout_marginTop="@dimen/dp_21"
android:textSize="@dimen/sp_18"
android:textColor="@color/col_313"
tools:text="剁椒鱼头"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_analyze_content"
android:textSize="@dimen/sp_14"
android:textColor="@color/col_313"
android:layout_marginTop="@dimen/dp_14"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="@dimen/dp_25"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="@dimen/dp_50"
android:layout_weight="1"
android:background="@drawable/shape_r25_stroke_02c"
android:text="重新拍照"
android:id="@+id/tv_photograph_again"
android:textColor="@color/col_02c"
android:textStyle="bold"
android:gravity="center"/>
<TextView
android:id="@+id/tv_detail"
android:layout_width="0dp"
android:layout_height="@dimen/dp_50"
android:layout_weight="1"
android:background="@drawable/shape_r25_02c"
android:layout_marginLeft="@dimen/dp_19"
android:text="查看详情"
android:textColor="@color/white"
android:textStyle="bold"
android:gravity="center"/>
</LinearLayout>
</RelativeLayout>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_132"
android:layout_height="@dimen/dp_104">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_r8_02c_stroke_1_5"/>
<com.ruffian.library.widget.RImageView
android:id="@+id/img_pic"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:is_circle="false"
android:layout_margin="@dimen/dp_1"
app:corner_radius="@dimen/dp_8"/>
</FrameLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -1,3 +1,3 @@
<resources>
<string name="app_name">zhongjian</string>
<string name="app_name">中健365</string>
</resources>

@ -3,9 +3,11 @@ package com.xty.common
import android.content.Context
import android.graphics.Color
import android.view.View
import android.widget.CheckBox
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.bigkoo.pickerview.builder.TimePickerBuilder
import com.bigkoo.pickerview.listener.CustomListener
import com.bigkoo.pickerview.listener.OnTimeSelectListener
import com.bigkoo.pickerview.view.TimePickerView
import com.tamsiree.rxkit.RxTimeTool
@ -42,6 +44,8 @@ class TimeSelect(var context: Context, var select: (String) -> Unit) {
var showSec = false
var setStartTime: Boolean = false
var isLanu:Boolean = false
init {
val instance = Calendar.getInstance()
startDate.set(
@ -197,6 +201,10 @@ class TimeSelect(var context: Context, var select: (String) -> Unit) {
.isDialog(showDialog)//是否显示为对话框样式
.build()
}
private var pvLunarTime : TimePickerView?= null
// 设置结束日期
fun selectManyTime2(timeTv: View, format: String = "yyyy-MM-dd") {
@ -276,6 +284,98 @@ class TimeSelect(var context: Context, var select: (String) -> Unit) {
showDay = true
pvTime.show()
}
fun selectTimeTwo(timeTv: View,timeType:View) {
this.timeTv = timeTv as TextView
showYear = true
showMonth = true
showDay = true
pvLunarTime = TimePickerBuilder(context, object : OnTimeSelectListener {
override fun onTimeSelect(date: Date?, v: View?) {
val date2String = RxTimeTool.date2String(date, SimpleDateFormat(format))
if (chooseMany) {
var str = StringBuilder(timeTv?.text)
if (!timeTv?.text.isNullOrEmpty()) {
str.append(",$date2String")
} else {
str.append(date2String)
}
selectTime = str.toString()
timeTv?.text = str
} else {
selectTime = date2String
timeTv?.text = date2String
}
if (otherView != null && otherView is InputView) {
(otherView as InputView).setValues(date2String)
}
if(isLanu){
(timeType as TextView).text = "公历"
}else{
(timeType as TextView).text = "农历"
}
select.invoke(date2String)
}
})
.setLayoutRes(R.layout.layout_customer_date_picker,object : CustomListener{
override fun customLayout(v: View?) {
var tvSubmit =v!!.findViewById<TextView>(R.id.tv_confirm)
var tvCancel = v!!.findViewById<TextView>(R.id.tv_cancel)
var checkLuna = v!!.findViewById<CheckBox>(R.id.check_brithday)
tvSubmit.setOnClickListener {
pvLunarTime?.returnData()
pvLunarTime?.dismiss()
}
tvCancel.setOnClickListener {
pvLunarTime?.dismiss()
}
checkLuna.setOnCheckedChangeListener { compoundButton, b ->
isLanu = b
/*if(b){
(timeType as TextView).text = "农历"
}else{
(timeType as TextView).text = "公历"
}*/
}
}
})
.setType(
booleanArrayOf(
showYear,
showMonth,
showDay,
showHour,
showMin,
showSec
)
)// 显示需要的时间
.setOutSideCancelable(true)//点击屏幕,点在控件外部范围时,是否取消显示
.isCyclic(false)//是否循环滚动
.setBgColor(Color.WHITE)//滚轮背景颜色 Night mode
.setLineSpacingMultiplier(2.0f)
.setTextColorCenter(ContextCompat.getColor(context, R.color.col_313))
.setTextColorOut(ContextCompat.getColor(context, R.color.col_6B6))
.setDividerColor(ContextCompat.getColor(context, R.color.transparent))
.setItemVisibleCount(3)
.setRangDate(if (setStartTime) startDate else null, endDate)//起始终止年月日设定
.setDate(selectedDate)// 如果不设置的话,默认是系统时间*/
.setLabel("", "", "", "", "", "")//默认设置为年月日时分秒
.isCenterLabel(false) //是否只显示中间选中项的label文字false则每项item全部都带有label。
.isDialog(showDialog)//是否显示为对话框样式
.build()
pvLunarTime?.show()
}
fun selectTime(timeTv: View, format: String = "yyyy-MM-dd", selectedDate: Calendar? = null) {
this.selectedDate =
selectedDate ?: Calendar.getInstance() // 如果 selectedDate 为空,则使用当前日期作为默认时间

@ -15,6 +15,9 @@ class ARouterUrl {
const val DEVICE_SEARCH = "/com/zj365/dc/activity/DeviceSearchBodyFatAct"
const val DEVICE_BIND = "/com/zj365/dc/activity/DeviceBindAct"
const val SCIENCE_LIST = "/com/zj365/dc/activity/HealthScienceAct"
const val DIET_MANAGEMENT = "/com/zj365/dc/activity/DietManagementAct"
const val CALORIE_ANALYZE = "/com/zj365/dc/activity/CalorieAnalyzeAct"
const val RECOGNIZE_RESULT = "/com/zj365/dc/activity/RecognizeResultAct"
// const val FAMILY_INFO="/com/zj365/dc/act/FamilyMainAct"

@ -0,0 +1,8 @@
package com.xty.common.listener
interface OnChoosePicListener {
fun onChooseTakePhoto()
fun onChoosePhotoAlbum()
}

@ -39,6 +39,16 @@ class PictureUtils {
.forResult(PictureConfig.CHOOSE_REQUEST)
}
fun openTheCamera(act: Activity, type: Int = PictureMimeType.ofImage()){
PictureSelector.create(act)
.openCamera(type)
.imageEngine(GlideEngine.createGlideEngine()) // 请参考Demo GlideEngine.java
.isCompress(true)//是否压缩
.forResult(PictureConfig.CHOOSE_REQUEST)
}
/**
* 选择图片或者拍照
*/

@ -0,0 +1,7 @@
package com.xty.common.util
import android.app.Dialog
import android.content.Context
class TakePhotoDialog(context: Context) : Dialog(context) {
}

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:color="@color/col_02c" android:width="@dimen/dp_1"/>
<solid android:color="@color/white"/>
<corners
android:radius="@dimen/dp_25"/>
</shape>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:color="@color/col_02c" android:width="@dimen/dp_1_5"/>
<corners android:radius="@dimen/dp_8"/>
</shape>

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_lt15_rt15_white"
android:paddingBottom="@dimen/dp_25"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_56"
android:text="拍 摄"
android:gravity="center"
android:textSize="@dimen/sp_18"
android:textColor="@color/col_313"
android:textStyle="bold"
android:id="@+id/tv_take_photo"/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:layout_marginLeft="@dimen/dp_19"
android:layout_marginRight="@dimen/dp_19"
android:background="@color/col_0F2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_56"
android:gravity="center"
android:textSize="@dimen/sp_18"
android:textColor="@color/col_313"
android:textStyle="bold"
android:text="从手机相册选择"
android:id="@+id/tv_choose_photo_album"/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:layout_marginLeft="@dimen/dp_19"
android:layout_marginRight="@dimen/dp_19"
android:background="@color/col_0F2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_56"
android:gravity="center"
android:textSize="@dimen/sp_18"
android:textColor="@color/col_C7C"
android:textStyle="bold"
android:id="@+id/tv_cancel"
android:text="取 消"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_270"
android:orientation="vertical"
android:background="@drawable/shape_lt15_rt15_white"
android:paddingBottom="@dimen/dp_27"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginBottom="@dimen/dp_24">
<TextView
android:id="@+id/tv_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="取消"
android:textStyle="bold"
android:textSize="@dimen/sp_17"
android:textColor="@color/col_C7C"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="选择年龄"
android:textColor="@color/col_313"
android:layout_centerInParent="true"
android:textSize="@dimen/sp_17"
android:textStyle="bold"/>
<TextView
android:id="@+id/tv_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确认"
android:layout_alignParentEnd="true"
android:textStyle="bold"
android:textSize="@dimen/sp_17"
android:textColor="@color/col_02c"/>
</RelativeLayout>
<CheckBox
android:id="@+id/check_brithday"
android:layout_width="wrap_content"
android:layout_marginLeft="@dimen/dp_31"
android:layout_height="wrap_content"
android:background="@drawable/selector_check_birthday"
android:button="@null"
android:checked="false" />
<LinearLayout
android:id="@+id/timepicker"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:gravity="center"
android:minHeight="150dp"
android:orientation="horizontal">
<com.contrarywind.view.WheelView
android:id="@+id/year"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="年"
android:textSize="@dimen/sp_15"
android:gravity="center"
android:textColor="@color/col_C7C"/>
<com.contrarywind.view.WheelView
android:id="@+id/month"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.1" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="月"
android:gravity="center"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_C7C"/>
<com.contrarywind.view.WheelView
android:id="@+id/day"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.1" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="日"
android:gravity="center"
android:textSize="@dimen/sp_15"
android:textColor="@color/col_C7C"/>
<com.contrarywind.view.WheelView
android:id="@+id/hour"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.1" />
<com.contrarywind.view.WheelView
android:id="@+id/min"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.1" />
<com.contrarywind.view.WheelView
android:id="@+id/second"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.1" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,16 @@
package com.zj365.health.act.skin
import android.view.View
import com.xty.base.act.BaseVmAct
import com.zj365.health.databinding.ActAiSkinMeasurementBinding
import com.zj365.health.vm.TongueDiagnosisVm
class SkinMeasurementMainAct : BaseVmAct<TongueDiagnosisVm>() {
val binding by lazy { ActAiSkinMeasurementBinding.inflate(layoutInflater)}
override fun liveObserver() {
}
override fun setLayout() = binding.root
}

@ -0,0 +1,50 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="MissingDefaultResource">
<include
android:id="@+id/title"
layout="@layout/title_white_bar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>
<androidx.core.widget.NestedScrollView
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
>
<ImageView
android:id="@+id/ivBg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:paddingBottom="100dp"
/>
</androidx.core.widget.NestedScrollView>
<TextView
android:id="@+id/tvSubmit"
android:layout_width="0dp"
android:layout_height="@dimen/dp_50"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginHorizontal="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_26"
android:background="@drawable/shape_button_bg"
android:gravity="center"
android:textSize="@dimen/sp_18"
android:text="立即购买"
android:textColor="@color/white"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -181,7 +181,7 @@ class BaseInfoChangeAct : BaseVmAct<BaseInfoVm>() {
// birthdayType = if (binding.checkBirthday.isChecked) 2 else 1
binding.mBirthday.setOnClickListener {
RxKeyboardTool.hideSoftInput(this)
timeSelect.selectTime(it)
timeSelect.selectTimeTwo(it,binding.tvCalType)
}
binding.mArea.setOnClickListener {
if (areaSelectDialog == null) {
@ -245,6 +245,11 @@ class BaseInfoChangeAct : BaseVmAct<BaseInfoVm>() {
binding.mPhone.text = it.phone
// binding.mId.setText(it.idCard)
binding.mBirthday.text = it.birthday
if(binding.tvCalType.text.toString().equals("公历")){
it.birthdayType == 2
}else{
it.birthdayType == 1
}
binding.checkBirthday.isChecked = it.birthdayType == 2
// when(it.birthdayType){
// 1-> binding.checkBirthday.isChecked = false

@ -221,6 +221,14 @@
android:button="@null"
android:visibility="gone"
android:checked="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/col_313"
android:textSize="@dimen/dp_14"
android:id="@+id/tv_cal_type"
android:layout_marginRight="@dimen/dp_5"
android:layout_toLeftOf="@+id/mBirthday"/>
<TextView
android:id="@+id/mBirthday"

@ -480,8 +480,8 @@ interface ApiInterface {
/**
* 首页轮播图
*/
@POST("customer/bannerImg/listNew")
suspend fun getBanners(@Body rb: RequestBody): RespBody<MutableList<BannerBean>>
@GET("customer/bannerImg/listNew")
suspend fun getBanners(@Query("userId") userId: String,@Query("location") location: Int): RespBody<MutableList<BannerBean>>
/**
* 打卡首页信息

Loading…
Cancel
Save