1.2.5 release
parent
d2818be8d2
commit
dafb154022
@ -0,0 +1,46 @@
|
||||
package com.rehome.dywoa.adapter
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import com.rehome.dywoa.base.BaseViewBindingAdapter
|
||||
import com.rehome.dywoa.bean.SisBaseBean
|
||||
import com.rehome.dywoa.bean.XjZhTjBean
|
||||
import com.rehome.dywoa.databinding.AdapterSisRealDataBinding
|
||||
|
||||
class SisRealDataAdapter(var context: Context,
|
||||
var data: MutableList<SisBaseBean>) : BaseViewBindingAdapter<AdapterSisRealDataBinding>(context) {
|
||||
override fun getCount(): Int {
|
||||
return data.count()
|
||||
}
|
||||
|
||||
override fun getItem(position: Int): Any {
|
||||
return data[position]
|
||||
}
|
||||
|
||||
override fun getItemId(position: Int): Long {
|
||||
return position.toLong()
|
||||
}
|
||||
|
||||
override fun getBinding(
|
||||
inflater: LayoutInflater,
|
||||
parent: ViewGroup?
|
||||
) = AdapterSisRealDataBinding.inflate(inflater, parent, false)
|
||||
|
||||
override fun handleData(position: Int, binding: AdapterSisRealDataBinding) {
|
||||
val item: SisBaseBean = data[position]
|
||||
binding.tvSisBh.text = item.sisno
|
||||
|
||||
binding.tvSisMc.text = item.sisDesc
|
||||
if(TextUtils.isEmpty(item.dw)){
|
||||
binding.tvSisRealValue.text = item.sisValue
|
||||
}else{
|
||||
binding.tvSisRealValue.text = buildString {
|
||||
append(item.sisValue)
|
||||
append(item.dw)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.rehome.dywoa.bean;
|
||||
|
||||
public class SisBaseBean {
|
||||
private String sisno;
|
||||
private String sisDesc;
|
||||
private String sisValue;
|
||||
private String dw;
|
||||
|
||||
public String getSisno() {
|
||||
return sisno;
|
||||
}
|
||||
|
||||
public void setSisno(String sisno) {
|
||||
this.sisno = sisno;
|
||||
}
|
||||
|
||||
public String getSisDesc() {
|
||||
return sisDesc;
|
||||
}
|
||||
|
||||
public void setSisDesc(String sisDesc) {
|
||||
this.sisDesc = sisDesc;
|
||||
}
|
||||
|
||||
public String getSisValue() {
|
||||
return sisValue;
|
||||
}
|
||||
|
||||
public void setSisValue(String sisValue) {
|
||||
this.sisValue = sisValue;
|
||||
}
|
||||
|
||||
public String getDw() {
|
||||
return dw;
|
||||
}
|
||||
|
||||
public void setDw(String dw) {
|
||||
this.dw = dw;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
<?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:id="@+id/ll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ffffff"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
style="@style/dagerDetailLeftStyleFirst"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="SIS编号:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sis_bh"
|
||||
style="@style/dagerDetailRightStyleFirst"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
style="@style/dagerDetailLeftStyleFirst"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="SIS名称:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sis_mc"
|
||||
style="@style/dagerDetailRightStyleFirst"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
style="@style/dagerListMarginTopStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
style="@style/dagerDetailLeftStyleFirst"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="SIS实时数据:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sis_real_value"
|
||||
style="@style/dagerDetailRightStyleFirst"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
Loading…
Reference in New Issue