中建365
@ -0,0 +1,57 @@
|
||||
package com.zj365.dc.activity
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.xty.base.act.BaseListAct
|
||||
import com.xty.common.UmengEventId
|
||||
import com.xty.common.arouter.ARouterUrl
|
||||
import com.xty.common.arouter.RouteManager
|
||||
import com.xty.common.onEventObject
|
||||
import com.xty.network.model.ScienceBean
|
||||
import com.zj365.dc.adapter.ScienceAdapter
|
||||
import com.zj365.dc.vm.HomeVm
|
||||
import com.zj365.health.databinding.ActDataListBinding
|
||||
|
||||
@Route(path = ARouterUrl.SCIENCE_LIST)
|
||||
class HealthScienceAct : BaseListAct<HomeVm> (){
|
||||
|
||||
val binding by lazy { ActDataListBinding.inflate(layoutInflater) }
|
||||
|
||||
val adapterSince by lazy { ScienceAdapter() }
|
||||
|
||||
override fun initView() {
|
||||
super.initView()
|
||||
statusBar(binding.title.mView)
|
||||
binding.title.mTvTitle.text ="健康科普"
|
||||
binding.title.mIvBack.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
override fun initAdapter() {
|
||||
binding.mRecycle.layoutManager = LinearLayoutManager(this)
|
||||
binding.mRecycle.adapter = adapterSince
|
||||
adapterSince.setOnItemClickListener { adapter, view, position ->
|
||||
bundle.clear()
|
||||
var bean = adapter.getItem(position) as ScienceBean
|
||||
bundle.putSerializable("bean", bean)
|
||||
onEventObject(this, UmengEventId.HealthScience, "${bean.name}")
|
||||
RouteManager.goAct(ARouterUrl.SCIENCE_DETAIL, bundle)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun loadData() {
|
||||
|
||||
mViewModel.getScinceList()
|
||||
}
|
||||
|
||||
override fun liveObserver() {
|
||||
mViewModel.scinceLive.observe(this) {
|
||||
adapterSince.setNewInstance(it.data)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setLayout() = binding.root
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.zj365.dc.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.xty.base.adapter.BaseAdapter
|
||||
import com.xty.common.setImage
|
||||
import com.xty.network.model.HomeLayoutBean
|
||||
import com.zj365.dc.R
|
||||
|
||||
class HomeContentLayoutAdapter (context: Context)
|
||||
: BaseAdapter<HomeLayoutBean.HomeChildBean>(R.layout.item_home_content_layout){
|
||||
override fun convert(holder: BaseViewHolder, item: HomeLayoutBean.HomeChildBean) {
|
||||
holder.getView<ImageView>(R.id.img_content).setImage(context,item.imageUrl)
|
||||
holder.setText(R.id.tv_content,item.name)
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.zj365.dc.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.LayoutInflater
|
||||
import android.view.WindowManager
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.xty.base.adapter.BaseAdapter
|
||||
import com.xty.common.LogUtils
|
||||
import com.xty.common.setImage
|
||||
import com.xty.network.model.HomeLayoutBean
|
||||
import com.zj365.dc.R
|
||||
|
||||
class HomeTopLayoutAdapter(var mContext: Context): BaseAdapter<HomeLayoutBean.HomeChildBean>(R.layout.item_home_top_layout){
|
||||
override fun convert(holder: BaseViewHolder, item: HomeLayoutBean.HomeChildBean) {
|
||||
|
||||
var screenWidth = context.resources.displayMetrics.widthPixels
|
||||
val layoutParam = holder.getView<LinearLayout>(R.id.root).layoutParams
|
||||
layoutParam.width = screenWidth /4
|
||||
holder.getView<LinearLayout>(R.id.root).layoutParams = layoutParam
|
||||
|
||||
holder.getView<ImageView>(R.id.img_top).setImage(context,item.imageUrl)
|
||||
holder.setText(R.id.tv_top_name,item.name)
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,211 @@
|
||||
<?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"
|
||||
android:background="@color/col_6f7">
|
||||
|
||||
<include layout="@layout/title_white_bar"
|
||||
android:id="@+id/title"/>
|
||||
|
||||
<RelativeLayout
|
||||
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:gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_12">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:background="@mipmap/icon_calorie_analyze"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:id="@+id/img_calorie"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/img_calorie"
|
||||
android:layout_marginLeft="@dimen/dp_11"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="热卡分析"
|
||||
android:textColor="@color/col_313"
|
||||
android:textSize="@dimen/sp_15"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_9"
|
||||
android:text="肉类 蔬菜 水果 面包"
|
||||
android:textColor="@color/col_6B6"
|
||||
android:textSize="@dimen/sp_13"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
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:gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_12">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:background="@mipmap/icon_healthy_diet"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:id="@+id/img_healthy_diet"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/img_healthy_diet"
|
||||
android:layout_marginLeft="@dimen/dp_11"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="健康食谱"
|
||||
android:textColor="@color/col_313"
|
||||
android:textSize="@dimen/sp_15"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_9"
|
||||
android:text="食疗 增肌 减脂 营养"
|
||||
android:textColor="@color/col_6B6"
|
||||
android:textSize="@dimen/sp_13"/>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
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:gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_12">
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:background="@mipmap/icon_medicine_food"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:id="@+id/img_medicine_food"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/img_medicine_food"
|
||||
android:layout_marginLeft="@dimen/dp_11"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="药食同源"
|
||||
android:textColor="@color/col_313"
|
||||
android:textSize="@dimen/sp_15"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_9"
|
||||
android:text="多吃 少吃 不吃"
|
||||
android:textColor="@color/col_6B6"
|
||||
android:textSize="@dimen/sp_13"/>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
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:gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_12">
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:background="@mipmap/icon_food_diary"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:id="@+id/img_food_diary"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/img_food_diary"
|
||||
android:layout_marginLeft="@dimen/dp_11"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="饮食日记"
|
||||
android:textColor="@color/col_313"
|
||||
android:textSize="@dimen/sp_15"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_9"
|
||||
android:text="早餐 中餐 晚餐"
|
||||
android:textColor="@color/col_6B6"
|
||||
android:textSize="@dimen/sp_13"/>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
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:gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_12">
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:background="@mipmap/icon_diet_more"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:id="@+id/img_more"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/img_more"
|
||||
android:layout_marginLeft="@dimen/dp_11"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="更多功能"
|
||||
android:textColor="@color/col_313"
|
||||
android:textSize="@dimen/sp_15"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_9"
|
||||
android:text="敬请期待"
|
||||
android:textColor="@color/col_6B6"
|
||||
android:textSize="@dimen/sp_13"/>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,33 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_ai_tongue_diagnosis"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:background="@mipmap/bg_home_item"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_content"
|
||||
android:layout_width="@dimen/dp_34"
|
||||
android:layout_height="@dimen/dp_34"
|
||||
tools:background="@mipmap/icon_ai_tongue_diagnosis"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="AI舌诊"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/col_313"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="@dimen/dp_10"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,28 @@
|
||||
<?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="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:id="@+id/root"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_top"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
android:background="@mipmap/icon_daily_benefit"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_top_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="每日福利"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/col_313"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="11dp"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 179 KiB |
@ -0,0 +1,4 @@
|
||||
package com.xty.common.event
|
||||
|
||||
class LoginOrRegisterEvent {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.xty.common.event
|
||||
|
||||
class LoginOutEvent {
|
||||
}
|