|
|
@@ -21,112 +21,116 @@ import org.jetbrains.anko.*
|
|
|
* @property itemSize IntArray
|
|
|
* @constructor
|
|
|
*/
|
|
|
-class SpotReportViewHolder(private val activity: AppCompatActivity,private val viewModel: ReportQueryViewModel):BaseViewHolder<SpotReportData>(activity){
|
|
|
+class SpotReportViewHolder(
|
|
|
+ private val activity: AppCompatActivity,
|
|
|
+ private val viewModel: ReportQueryViewModel
|
|
|
+) : BaseViewHolder<SpotReportData>(activity) {
|
|
|
override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
|
|
|
|
|
|
@SuppressLint("SetTextI18n")
|
|
|
override fun _FrameLayout.createContentView() {
|
|
|
- onThrottleFirstClick {
|
|
|
- viewModel.resetDataList(index = dataIndex)
|
|
|
- }
|
|
|
- data.bindOptional(context) {
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ viewModel.resetDataList(index = dataIndex)
|
|
|
+ }
|
|
|
+ data.bindOptional(context) {
|
|
|
if (it?.indexSelect == 0) {
|
|
|
backgroundResource = R.color.white
|
|
|
} else if (it?.indexSelect == 1) {
|
|
|
backgroundResource = R.color.rma_list_select_color
|
|
|
}
|
|
|
}
|
|
|
- verticalLayout {
|
|
|
- linearLayout {
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.START
|
|
|
- textView {
|
|
|
- data.bindOptional(context){
|
|
|
- text = it?.wrstandardname
|
|
|
- }
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
- marginStart = autoSize(36)
|
|
|
- topMargin = autoSize(15)
|
|
|
- }
|
|
|
- }.lparams(autoSize(225), autoSize(100))
|
|
|
+ linearLayout {
|
|
|
+ verticalLayout {
|
|
|
+ gravity = Gravity.START
|
|
|
+ textView {
|
|
|
+ data.bindOptional(context) {
|
|
|
+ text = it?.wrstandardname
|
|
|
+ }
|
|
|
+ textSizeAuto = 24
|
|
|
+ textColorInt = R.color.hint_text_color
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ topMargin = autoSize(15)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(225), autoSize(100))
|
|
|
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.CENTER
|
|
|
- textView {
|
|
|
- data.bindOptional(context){
|
|
|
- text = it?.totalbuypricedqty + it?.enumdicname
|
|
|
- }
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ verticalLayout {
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ textView {
|
|
|
+ data.bindOptional(context) {
|
|
|
+ text = it?.totalbuypricedqty + it?.enumdicname
|
|
|
+ }
|
|
|
+ textSizeAuto = 24
|
|
|
+ textColorInt = R.color.hint_text_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
|
- textView {
|
|
|
- data.bindOptional(context){
|
|
|
- text = it?.totalsellpricedqty + it?.enumdicname
|
|
|
- }
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(autoSize(225), autoSize(100))
|
|
|
+ textView {
|
|
|
+ data.bindOptional(context) {
|
|
|
+ text = it?.totalsellpricedqty + it?.enumdicname
|
|
|
+ }
|
|
|
+ textSizeAuto = 24
|
|
|
+ textColorInt = R.color.hint_text_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(autoSize(225), autoSize(100))
|
|
|
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.CENTER
|
|
|
- textView {
|
|
|
- data.bindOptional(context){
|
|
|
- text = it?.todaybuyreckonqty + it?.enumdicname
|
|
|
- }
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ verticalLayout {
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ textView {
|
|
|
+ data.bindOptional(context) {
|
|
|
+ text = it?.todaybuyreckonqty + it?.enumdicname
|
|
|
+ }
|
|
|
+ textSizeAuto = 24
|
|
|
+ textColorInt = R.color.hint_text_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
|
- textView {
|
|
|
- data.bindOptional(context){
|
|
|
- text = it?.todaysellreckonqty + it?.enumdicname
|
|
|
- }
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- }.lparams(autoSize(225), autoSize(97))
|
|
|
+ textView {
|
|
|
+ data.bindOptional(context) {
|
|
|
+ text = it?.todaysellreckonqty + it?.enumdicname
|
|
|
+ }
|
|
|
+ textSizeAuto = 24
|
|
|
+ textColorInt = R.color.hint_text_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(autoSize(225), autoSize(97))
|
|
|
|
|
|
- verticalLayout {
|
|
|
- gravity = Gravity.END
|
|
|
- textView {
|
|
|
- text = "--"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
- marginEnd = autoSize(36)
|
|
|
- topMargin = autoSize(15)
|
|
|
- }
|
|
|
+ verticalLayout {
|
|
|
+ gravity = Gravity.END
|
|
|
+ textView {
|
|
|
+ text = "--"
|
|
|
+ textSizeAuto = 24
|
|
|
+ textColorInt = R.color.hint_text_color
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ topMargin = autoSize(15)
|
|
|
+ }
|
|
|
|
|
|
- textView {
|
|
|
- text = "--"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent){
|
|
|
- marginEnd = autoSize(36)
|
|
|
- }
|
|
|
- }.lparams(autoSize(225), autoSize(97))
|
|
|
- }.lparams(matchParent, autoSize(100))
|
|
|
- linearLayout {
|
|
|
- emptyView()
|
|
|
+ textView {
|
|
|
+ text = "--"
|
|
|
+ textSizeAuto = 24
|
|
|
+ textColorInt = R.color.hint_text_color
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(225), autoSize(97))
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+ linearLayout {
|
|
|
+ emptyView()
|
|
|
|
|
|
- textView {
|
|
|
- onThrottleFirstClick {
|
|
|
+ textView {
|
|
|
+ onThrottleFirstClick {
|
|
|
|
|
|
- }
|
|
|
- backgroundResource = R.drawable.rma_item_click_bg
|
|
|
- gravity = Gravity.CENTER
|
|
|
- textResource = R.string.details
|
|
|
- textColorInt = R.color.rma_item_click_color
|
|
|
- textSizeAuto = 26
|
|
|
- }.lparams(autoSize(120), autoSize(48)) {
|
|
|
- marginEnd = autoSize(36)
|
|
|
- }
|
|
|
- }.lparams(matchParent, autoSize(72))
|
|
|
- }.lparams(matchParent, wrapContent)
|
|
|
+ }
|
|
|
+ backgroundResource = R.drawable.rma_item_click_bg
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ textResource = R.string.details
|
|
|
+ textColorInt = R.color.rma_item_click_color
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(autoSize(120), autoSize(48)) {
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(72))
|
|
|
+ }.lparams(matchParent, wrapContent)
|
|
|
}
|
|
|
|
|
|
}
|