|
|
@@ -0,0 +1,996 @@
|
|
|
+package cn.muchinfo.rma.view.base.warehousereceipt
|
|
|
+
|
|
|
+import android.graphics.Color
|
|
|
+import android.os.Build
|
|
|
+import android.os.Bundle
|
|
|
+import android.view.Gravity
|
|
|
+import android.view.View
|
|
|
+import android.view.ViewGroup
|
|
|
+import android.widget.SeekBar
|
|
|
+import android.widget.TextView
|
|
|
+import androidx.annotation.RequiresApi
|
|
|
+import androidx.appcompat.app.AppCompatActivity
|
|
|
+import androidx.lifecycle.MutableLiveData
|
|
|
+import androidx.viewpager.widget.PagerAdapter
|
|
|
+import androidx.viewpager.widget.ViewPager
|
|
|
+import cn.muchinfo.rma.R
|
|
|
+import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
+import cn.muchinfo.rma.global.data.OrderQuoteData
|
|
|
+import cn.muchinfo.rma.global.data.OrderQuoteDetailData
|
|
|
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
|
|
|
+import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
+import cn.muchinfo.rma.view.autoWidget.*
|
|
|
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
|
|
|
+import cn.muchinfo.rma.view.autoWidget.view.MangeNumberEditText2
|
|
|
+import cn.muchinfo.rma.view.base.BaseActivity
|
|
|
+import cn.muchinfo.rma.view.base.app.FutureConstent
|
|
|
+import cn.muchinfo.rma.view.base.future.trade.itemView
|
|
|
+import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
+import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
|
|
|
+import cn.muchinfo.rma.view.base.home.spotmarket.SpotMarketPriceViewHolder
|
|
|
+import com.blankj.utilcode.util.ConvertUtils
|
|
|
+import com.qmuiteam.qmui.util.QMUIDisplayHelper
|
|
|
+import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
|
|
|
+import com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
|
|
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
|
|
|
+import mtp.polymer.com.autowidget.dialog.createCustomDialog
|
|
|
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
|
|
|
+import org.jetbrains.anko.*
|
|
|
+import org.jetbrains.anko.support.v4.viewPager
|
|
|
+
|
|
|
+/**
|
|
|
+ * 华南顺通 买卖大厅
|
|
|
+ */
|
|
|
+class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
|
|
|
+
|
|
|
+ lateinit var segment: QMUITabSegment
|
|
|
+ var selectedTabIndex: Int = 0
|
|
|
+ private lateinit var viewPager: ViewPager
|
|
|
+
|
|
|
+ val data by lazy { intent.getParcelableExtra<OrderQuoteData>("data") as OrderQuoteData }
|
|
|
+
|
|
|
+ //卖大厅
|
|
|
+ private val sellHallUI by lazy { SellHallUI(this,viewModel) }
|
|
|
+
|
|
|
+ //买大厅
|
|
|
+ private val buyHallUI by lazy { BuyHallUI(this,viewModel) }
|
|
|
+
|
|
|
+ /** 一口价摘牌输入框 **/
|
|
|
+ lateinit var priceInputEdittext: MangeNumberEditText2
|
|
|
+
|
|
|
+ /*** 一口价摘牌金额 **/
|
|
|
+ lateinit var one_delisting_amount : TextView
|
|
|
+
|
|
|
+ //viewpager的适配器
|
|
|
+ private var newPagerAdapter : PagerAdapter? = null
|
|
|
+
|
|
|
+ //tabSegment标题
|
|
|
+ private val newTabsArray : ArrayList<String> = arrayListOf()
|
|
|
+
|
|
|
+ //暂存的页面组
|
|
|
+ private val uiList : ArrayList<_FrameLayout> = arrayListOf()
|
|
|
+
|
|
|
+ val selectIndex : MutableLiveData<Int> = MutableLiveData()
|
|
|
+
|
|
|
+ fun initMenuData(){
|
|
|
+
|
|
|
+ newTabsArray.add("卖大厅")
|
|
|
+ uiList.add(sellHallUI.root)
|
|
|
+
|
|
|
+ newTabsArray.add("买大厅")
|
|
|
+ uiList.add(buyHallUI.root)
|
|
|
+
|
|
|
+ newPagerAdapter = object : PagerAdapter() {
|
|
|
+
|
|
|
+ override fun getPageTitle(position: Int): CharSequence? = newTabsArray[position]
|
|
|
+
|
|
|
+ override fun instantiateItem(container: ViewGroup, position: Int): Any {
|
|
|
+ return uiList.get(position).apply {
|
|
|
+ container.addView(
|
|
|
+ this,
|
|
|
+ ViewGroup.LayoutParams(matchParent, matchParent)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
|
|
|
+ (`object` as? View)?.let { container.removeView(it) }
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun isViewFromObject(view: View, `object`: Any): Boolean = view == `object`
|
|
|
+
|
|
|
+ override fun getCount(): Int = newTabsArray.size
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
+ super.onCreate(savedInstanceState)
|
|
|
+ verticalLayout {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ //头部标题
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ imageView {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ finish()
|
|
|
+ }
|
|
|
+ imageResource = R.mipmap.back
|
|
|
+ }.lparams(autoSize(45), autoSize(45)){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ view {
|
|
|
+
|
|
|
+ }.lparams(autoSize(45), autoSize(45)){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ textView {
|
|
|
+ text = data.deliverygoodsname
|
|
|
+ textSizeAuto = 41
|
|
|
+ textColorInt = R.color.white
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = data.warehousename
|
|
|
+ textSizeAuto = 27
|
|
|
+ textColorStr = "#AED6F0"
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ }
|
|
|
+ }.lparams(wrapContent, autoSize(120))
|
|
|
+
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.bussiness_one
|
|
|
+ }.lparams(autoSize(45), autoSize(45)){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.business_two
|
|
|
+ }.lparams(autoSize(45), autoSize(45)){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(120))
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ verticalLayout {
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ textView {
|
|
|
+ text = data.warehousecode
|
|
|
+ textSizeAuto = 42
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(0, autoSize(144),1f)
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "卖价"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = NumberUtils.roundNum(data.sellprice,2)
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(18)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(72))
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "买价"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = NumberUtils.roundNum(data.buyprice,2)
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(18)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(72))
|
|
|
+ }.lparams(0, autoSize(144),1f)
|
|
|
+
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "卖量"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(18)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = data.sellqty
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(72))
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "买量"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(18)
|
|
|
+ }
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = data.buyqty
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(72))
|
|
|
+ }.lparams(0, autoSize(144),1f)
|
|
|
+ }.lparams(matchParent, autoSize(144))
|
|
|
+
|
|
|
+ relativeLayout {
|
|
|
+ linearLayout {
|
|
|
+ linearLayout {
|
|
|
+
|
|
|
+ }.lparams(0, autoSize(100),1f)
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+
|
|
|
+ }.lparams(0, autoSize(100),1f)
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ tabSegment {
|
|
|
+ segment = this
|
|
|
+ background = resources.getDrawable(R.color.segtabment_bg_color)
|
|
|
+ addOnTabSelectedListener(object :
|
|
|
+ QMUITabSegment.OnTabSelectedListener {
|
|
|
+ override fun onDoubleTap(index: Int) {}
|
|
|
+ override fun onTabReselected(index: Int) {}
|
|
|
+ override fun onTabUnselected(index: Int) {}
|
|
|
+ override fun onTabSelected(index: Int) {
|
|
|
+ selectedTabIndex = index
|
|
|
+ selectIndex.postValue(index)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ setIndicator(
|
|
|
+ QMUITabIndicator(
|
|
|
+ QMUIDisplayHelper.dp2px(context, 2),
|
|
|
+ false,
|
|
|
+ true
|
|
|
+ )
|
|
|
+ )
|
|
|
+ setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
+
|
|
|
+ view {
|
|
|
+ background = resources.getDrawable(R.color.main_hit_bg_color)
|
|
|
+ }.lparams(matchParent, autoSize(1)) {
|
|
|
+ marginStart = autoSize(32)
|
|
|
+ marginEnd = autoSize(32)
|
|
|
+ }
|
|
|
+ viewPager {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ viewPager = this
|
|
|
+ adapter = newPagerAdapter
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ segment.setupWithViewPager(viewPager)
|
|
|
+ segment.selectTab(selectedTabIndex)
|
|
|
+ selectIndex.postValue(selectedTabIndex)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //一口价 摘牌
|
|
|
+ @RequiresApi(Build.VERSION_CODES.O)
|
|
|
+ fun creatOneSellOrBuyDialog(data : OrderQuoteDetailData){
|
|
|
+
|
|
|
+ createCustomDialog(cancelable = false) { dialog ->
|
|
|
+
|
|
|
+ backgroundColor = Color.parseColor("#5f000000")
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "交易账户"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "2131242341 周星星"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
+ }.lparams(autoSize(36), autoSize(36))
|
|
|
+
|
|
|
+ }.lparams(matchParent, autoSize(172))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "挂牌方"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = data.username
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "挂牌价格"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = data.fixedprice
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "挂牌数量"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = data.orderqty
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ verticalLayout {
|
|
|
+ textView {
|
|
|
+ text = "摘牌数量"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ topMargin = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "(10吨起)"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), autoSize(290))
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ numberEditText {
|
|
|
+ priceInputEdittext = this
|
|
|
+ setOnTextChangeListener { view, value ->
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }.lparams(0, autoSize(72),1f)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "吨"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ seekBar {
|
|
|
+ min = 10
|
|
|
+ max = 100
|
|
|
+ thumb = resources.getDrawable(R.mipmap.hnxt_seekbar)
|
|
|
+ progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
|
|
|
+ setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
|
|
|
+ override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onStartTrackingTouch(p0: SeekBar?) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onStopTrackingTouch(p0: SeekBar?) {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }.lparams(matchParent, autoSize(46)){
|
|
|
+ marginEnd = autoSize(110)
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ }
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "0"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "80吨"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, wrapContent){
|
|
|
+ marginEnd = autoSize(110)
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ }
|
|
|
+
|
|
|
+ }.lparams(matchParent, autoSize(290))
|
|
|
+ }.lparams(matchParent, autoSize(290))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "摘牌金额"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(autoSize(214), wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ one_delisting_amount = this
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ verticalEmptyView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ onThrottleFirstClick {
|
|
|
+
|
|
|
+ }
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ backgroundResource = R.drawable.qhj_main_blue_bg
|
|
|
+ text = "卖出"
|
|
|
+ textSizeAuto = 38
|
|
|
+ textColorInt = R.color.white
|
|
|
+ }.lparams(autoSize(419), autoSize(119)) {
|
|
|
+ marginStart = autoSize(24)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ dialog.dismiss()
|
|
|
+ }
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ backgroundResource = R.drawable.hnxt_cancel_bg
|
|
|
+ text = "取消"
|
|
|
+ textColorInt = R.color.white
|
|
|
+ textSizeAuto = 38
|
|
|
+ }.lparams(autoSize(419), autoSize(119)) {
|
|
|
+ marginStart = autoSize(13)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(144)) {
|
|
|
+ gravity = Gravity.BOTTOM
|
|
|
+ }
|
|
|
+
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+ }.show()
|
|
|
+ }
|
|
|
+
|
|
|
+ //浮动价 摘牌
|
|
|
+ @RequiresApi(Build.VERSION_CODES.O)
|
|
|
+ fun creatFloatSellOrBuyDialog(data : OrderQuoteDetailData){
|
|
|
+
|
|
|
+ createCustomDialog(cancelable = false) { dialog ->
|
|
|
+
|
|
|
+ backgroundColor = Color.parseColor("#5f000000")
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "交易账户"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "2131242341 周星星"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
+ }.lparams(autoSize(36), autoSize(36))
|
|
|
+
|
|
|
+ }.lparams(matchParent, autoSize(172))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "挂牌方"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = data.username
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "挂牌价格"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = data.fixedprice
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "挂牌数量"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), wrapContent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = data.orderqty
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ verticalLayout {
|
|
|
+ textView {
|
|
|
+ text = "摘牌数量"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ topMargin = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "(10吨起)"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(250), autoSize(290))
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ numberEditText {
|
|
|
+ priceInputEdittext = this
|
|
|
+ setOnTextChangeListener { view, value ->
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }.lparams(0, autoSize(72),1f)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "吨"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ seekBar {
|
|
|
+ min = 10
|
|
|
+ max = 100
|
|
|
+ thumb = resources.getDrawable(R.mipmap.hnxt_seekbar)
|
|
|
+ progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
|
|
|
+ setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
|
|
|
+ override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onStartTrackingTouch(p0: SeekBar?) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onStopTrackingTouch(p0: SeekBar?) {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }.lparams(matchParent, autoSize(46)){
|
|
|
+ marginEnd = autoSize(110)
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ }
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "0"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "80吨"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, wrapContent){
|
|
|
+ marginEnd = autoSize(110)
|
|
|
+ topMargin = autoSize(10)
|
|
|
+ }
|
|
|
+
|
|
|
+ }.lparams(matchParent, autoSize(290))
|
|
|
+ }.lparams(matchParent, autoSize(290))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ text = "摘牌金额"
|
|
|
+ textSizeAuto = 34
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
+ }.lparams(autoSize(214), wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ one_delisting_amount = this
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(matchParent, autoSize(143))
|
|
|
+
|
|
|
+ verticalEmptyView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ onThrottleFirstClick {
|
|
|
+
|
|
|
+ }
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ backgroundResource = R.drawable.qhj_main_blue_bg
|
|
|
+ text = "卖出"
|
|
|
+ textSizeAuto = 38
|
|
|
+ textColorInt = R.color.white
|
|
|
+ }.lparams(autoSize(419), autoSize(119)) {
|
|
|
+ marginStart = autoSize(24)
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ dialog.dismiss()
|
|
|
+ }
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ backgroundResource = R.drawable.hnxt_cancel_bg
|
|
|
+ text = "取消"
|
|
|
+ textColorInt = R.color.white
|
|
|
+ textSizeAuto = 38
|
|
|
+ }.lparams(autoSize(419), autoSize(119)) {
|
|
|
+ marginStart = autoSize(13)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(144)) {
|
|
|
+ gravity = Gravity.BOTTOM
|
|
|
+ }
|
|
|
+
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+ }.show()
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 卖大厅
|
|
|
+ * @property activity AppCompatActivity
|
|
|
+ * @property viewModel BusinessHallViewModel
|
|
|
+ * @constructor
|
|
|
+ */
|
|
|
+class SellHallUI(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel){
|
|
|
+
|
|
|
+ // 下拉刷新
|
|
|
+ private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
+ private lateinit var statusLayout: StatusLayout
|
|
|
+
|
|
|
+ private val businessSellHallAdapter: BaseAdapter<OrderQuoteDetailData, BusinessSellHallViewHolder> =
|
|
|
+ BaseAdapter { _, _ ->
|
|
|
+ BusinessSellHallViewHolder(
|
|
|
+ activity,
|
|
|
+ viewModel
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ val root = _FrameLayout(activity).apply {
|
|
|
+ verticalLayout {
|
|
|
+ linearLayout {
|
|
|
+ background = resources.getDrawable(R.color.hnst_sell_hall_top_bg_color)
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL or Gravity.LEFT
|
|
|
+ textView {
|
|
|
+ text = "价格"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(0, autoSize(74),1f)
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ textView {
|
|
|
+ text = "数量"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(0, autoSize(74),1f)
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL or Gravity.RIGHT
|
|
|
+ textView {
|
|
|
+ text = "挂牌方"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(0, autoSize(74),1f)
|
|
|
+ }.lparams(matchParent, autoSize(74))
|
|
|
+
|
|
|
+ statusLayout(contentBlock = {
|
|
|
+ statusLayout = this
|
|
|
+// bindTaskStatus(viewModule.status)
|
|
|
+ setRetryAction {
|
|
|
+
|
|
|
+ }
|
|
|
+ swipeToLoadLayout {
|
|
|
+ swipeToLayout = this
|
|
|
+ setEnableRefresh(true)
|
|
|
+ setEnableLoadMore(false)
|
|
|
+ setOnRefreshListener {
|
|
|
+
|
|
|
+ }
|
|
|
+ setEnableScrollContentWhenLoaded(false)
|
|
|
+ setEnableLoadMoreWhenContentNotFull(false)
|
|
|
+
|
|
|
+ // 未提交列表
|
|
|
+ recyclerView {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ adapter = businessSellHallAdapter
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+ }
|
|
|
+ }, emptyBlock = {
|
|
|
+ emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
+ }).lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ viewModel.businessSellHallDataList.bindOptional(context) {
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
+ statusLayout.showEmpty()
|
|
|
+ } else {
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
+ swipeToLayout.finishRefresh()
|
|
|
+ }
|
|
|
+ statusLayout.showSuccess()
|
|
|
+ businessSellHallAdapter.setNewData(it)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 买大厅
|
|
|
+ * @property activity AppCompatActivity
|
|
|
+ * @property viewModel BusinessHallViewModel
|
|
|
+ * @constructor
|
|
|
+ */
|
|
|
+class BuyHallUI(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel){
|
|
|
+
|
|
|
+ // 下拉刷新
|
|
|
+ private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
+ private lateinit var statusLayout: StatusLayout
|
|
|
+
|
|
|
+ private val businessBuyHallAdapter: BaseAdapter<OrderQuoteDetailData, BusinessBuyHallViewHolder> =
|
|
|
+ BaseAdapter { _, _ ->
|
|
|
+ BusinessBuyHallViewHolder(
|
|
|
+ activity,
|
|
|
+ viewModel
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ val root = _FrameLayout(activity).apply {
|
|
|
+ verticalLayout {
|
|
|
+ linearLayout {
|
|
|
+ background = resources.getDrawable(R.color.hnst_buy_hall_top_bg_color)
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL or Gravity.LEFT
|
|
|
+ textView {
|
|
|
+ text = "价格"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(0, autoSize(74),1f)
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ textView {
|
|
|
+ text = "数量"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(0, autoSize(74),1f)
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ gravity = Gravity.CENTER_VERTICAL or Gravity.RIGHT
|
|
|
+ textView {
|
|
|
+ text = "摘牌方"
|
|
|
+ textSizeAuto = 29
|
|
|
+ textColorInt = R.color.rma_gray_color
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
+ }.lparams(0, autoSize(74),1f)
|
|
|
+ }.lparams(matchParent, autoSize(74))
|
|
|
+
|
|
|
+ statusLayout(contentBlock = {
|
|
|
+ statusLayout = this
|
|
|
+// bindTaskStatus(viewModule.status)
|
|
|
+ setRetryAction {
|
|
|
+
|
|
|
+ }
|
|
|
+ swipeToLoadLayout {
|
|
|
+ swipeToLayout = this
|
|
|
+ setEnableRefresh(true)
|
|
|
+ setEnableLoadMore(false)
|
|
|
+ setOnRefreshListener {
|
|
|
+
|
|
|
+ }
|
|
|
+ setEnableScrollContentWhenLoaded(false)
|
|
|
+ setEnableLoadMoreWhenContentNotFull(false)
|
|
|
+
|
|
|
+ // 未提交列表
|
|
|
+ recyclerView {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ adapter = businessBuyHallAdapter
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+ }
|
|
|
+ }, emptyBlock = {
|
|
|
+ emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
+ }).lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ viewModel.businessBuyHallDataList.bindOptional(context) {
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
+ statusLayout.showEmpty()
|
|
|
+ } else {
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
+ swipeToLayout.finishRefresh()
|
|
|
+ }
|
|
|
+ statusLayout.showSuccess()
|
|
|
+ businessBuyHallAdapter.setNewData(it)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|