Browse Source

期货-持仓、委托列表

ProGo 4 năm trước cách đây
mục cha
commit
9cb53d665e

+ 4 - 10
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/FutureFragment.kt

@@ -1,7 +1,5 @@
 package cn.muchinfo.rma.view.base.future
 
-import android.graphics.Color
-import android.graphics.drawable.ColorDrawable
 import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
@@ -9,18 +7,14 @@ import android.view.ViewGroup
 import androidx.annotation.NonNull
 import androidx.annotation.Nullable
 import androidx.fragment.app.Fragment
-import androidx.fragment.app.FragmentActivity
-import androidx.fragment.app.FragmentManager
 import androidx.fragment.app.FragmentPagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseFragment
+import cn.muchinfo.rma.view.base.future.entrusts.EntrustFragment
+import cn.muchinfo.rma.view.base.future.holds.HoldFragment
 import cn.muchinfo.rma.view.base.future.market.FutureMarket
-import cn.muchinfo.rma.view.base.future.market.MarketFragment
-import com.google.android.material.tabs.TabLayout
-import com.qmuiteam.qmui.util.QMUIDisplayHelper
-import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 
 
@@ -46,8 +40,8 @@ class FutureFragment : BaseFragment<FutureViewModel>() {
     // 页面,和对应的tab对应
     private val tabFragments: Array<Fragment> = arrayOf(
         FutureMarket.getInstance(), // 行情
-        FutureMarket.getInstance(), // 持仓
-        FutureMarket.getInstance(), // 委托
+        HoldFragment.getInstance(), // 持仓
+        EntrustFragment.getInstance(), // 委托
         FutureMarket.getInstance(), // 成交
         FutureMarket.getInstance() // 资金
     )

+ 77 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/entrusts/EntrustData.kt

@@ -0,0 +1,77 @@
+package cn.muchinfo.rma.view.base.future.entrusts
+
+import java.io.Serializable
+
+class EntrustData : Serializable {
+
+    // 商品名称
+    var goodsName = ""
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 商品代码
+    var goodsCode = ""
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 商品id
+    var goodsId: Int = 0
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 最新价格
+    var lastPrice: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 可用
+    var available: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+
+    // 持仓量
+    var totals: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 成本
+    var cost: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+
+    // 持仓价格
+    var holdPrice: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+
+    // 盈亏率
+    var plp: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+
+    // 盈亏
+    var pl: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 方向
+    var direction: Int = 0
+        get() = field
+        set(value) {
+            field = value
+        }
+}

+ 69 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/entrusts/EntrustFragment.kt

@@ -0,0 +1,69 @@
+package cn.muchinfo.rma.view.base.future.entrusts
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.base.BaseFragment
+import cn.muchinfo.rma.view.MyApplication
+
+/**
+ * 委托单
+ */
+class EntrustFragment: BaseFragment<EntrustViewModel>() {
+
+    companion object {
+        fun getInstance() = EntrustFragment()
+    }
+//region 数据
+    private val tabs: Array<String?> = arrayOf(
+        MyApplication.getInstance()?.resources?.getString(R.string.str_can_cancel_today), // 今日可撤
+        MyApplication.getInstance()?.resources?.getString(R.string.str_entrust_today) // 今日委托
+    )
+//endregion
+
+//region views
+    private var _view: View? = null
+    private var idEntrustList: RecyclerView? = null // 委托单列表
+//endregion
+
+    override fun onCreateView(
+        inflater: LayoutInflater,
+        container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        _view = inflater.inflate(R.layout.entrust_fragment, container, false)
+        initViews()
+        return _view
+    }
+
+//region 函数
+
+    private fun initViews() {
+        idEntrustList = _view?.findViewById(R.id.id_entrust_list)
+        val list: ArrayList<EntrustData>? = ArrayList()
+        for (a in 1..5) {
+            val m = EntrustData()
+            m.goodsName = "铁矿石" + (2105 + a)
+            m.goodsCode = "I" + (2105 + a)
+            m.lastPrice = 998.0 + a
+            m.available = 1.0 + a
+            m.totals = 5.0 + a
+            m.cost = 500.0 + a
+            m.pl = 100.0 + a
+            m.plp = (100 + a) * 0.003
+            m.holdPrice = 899.0 + a
+            m.direction = a
+            list?.add(m)
+        }
+        val layoutManager = LinearLayoutManager(context)
+        idEntrustList?.layoutManager = layoutManager
+        viewModel.list = list
+        idEntrustList?.adapter = viewModel.getAdapter()
+    }
+
+//endregion
+}

+ 87 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/entrusts/EntrustViewModel.kt

@@ -0,0 +1,87 @@
+package cn.muchinfo.rma.view.base.future.entrusts
+
+import android.content.Context
+import android.graphics.drawable.Drawable
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.ImageView
+import android.widget.RelativeLayout
+import android.widget.TextView
+import androidx.recyclerview.widget.RecyclerView
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.base.BaseViewModel
+
+/**
+ * 持仓的ViewModel
+ */
+class EntrustViewModel : BaseViewModel() {
+
+    var list: ArrayList<EntrustData>? = null
+
+    /**
+     * 获取配置器。
+     */
+    fun getAdapter(): RecyclerView.Adapter<HoldAdapter.HoldHolder> {
+        return HoldAdapter(context, list)
+    }
+    /**
+     * 通用的适配器。
+     */
+    class HoldAdapter(context: Context?, list: ArrayList<EntrustData>?) : RecyclerView.Adapter<HoldAdapter.HoldHolder>() {
+        private var list: ArrayList<EntrustData>? = null
+        private var inflater: LayoutInflater? = null
+        private var context: Context? = null
+        private var pink: Drawable? = null
+        private var green: Drawable? = null
+        private var priceRed: Int = 0
+        private var priceGreen: Int = 0
+        init {
+            this.list = list
+            this.inflater = LayoutInflater.from(context)
+            this.context = context
+
+            pink = context?.getDrawable(R.drawable.rma_red)
+            green = context?.getDrawable(R.drawable.rma_green)
+            priceGreen = context?.getColor(R.color.p_price_green)!!
+            priceRed = context.getColor(R.color.p_price_red)
+        }
+
+        override fun getItemCount(): Int {
+            return list?.size ?: 0
+        }
+
+        class HoldHolder(itemView: View?) : RecyclerView.ViewHolder(itemView!!) {
+            var idGoodsName = itemView?.findViewById<TextView>(R.id.id_goods_name)
+            var idTransDirection = itemView?.findViewById<TextView>(R.id.id_trans_direction)
+            var idAvailable = itemView?.findViewById<TextView>(R.id.id_available)
+            var idHoldTotal = itemView?.findViewById<TextView>(R.id.id_hold_total)
+            var idLastPrice = itemView?.findViewById<TextView>(R.id.id_last_price)
+            var idCost = itemView?.findViewById<TextView>(R.id.id_cost)
+            var idPl = itemView?.findViewById<TextView>(R.id.id_pl)
+            var idPlp = itemView?.findViewById<TextView>(R.id.id_plp)
+
+        }
+
+        override fun onBindViewHolder(holder: HoldHolder, position: Int) {
+            holder.idGoodsName?.text = list?.get(position)?.goodsName
+            holder.idAvailable?.text = list?.get(position)?.available.toString()
+            holder.idHoldTotal?.text = list?.get(position)?.totals.toString()
+            holder.idLastPrice?.text = list?.get(position)?.lastPrice.toString()
+            holder.idCost?.text = list?.get(position)?.cost.toString()
+            holder.idPl?.text = list?.get(position)?.pl.toString()
+            holder.idPlp?.text = list?.get(position)?.plp.toString()
+            if (list?.get(position)?.direction == 0) {
+                holder.idTransDirection?.text = context?.resources?.getString(R.string.str_buy)
+            } else {
+                holder.idTransDirection?.text = context?.resources?.getString(R.string.str_sell)
+            }
+
+        }
+
+        override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HoldHolder {
+            return HoldHolder(inflater?.inflate(R.layout.hold_item, parent, false))
+        }
+
+    }
+}

+ 80 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/holds/HoldData.kt

@@ -0,0 +1,80 @@
+package cn.muchinfo.rma.view.base.future.holds
+
+import java.io.Serializable
+
+/**
+ * 持仓的item的中间件bo
+ */
+class HoldData: Serializable {
+    // 商品名称
+    var goodsName = ""
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 商品代码
+    var goodsCode = ""
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 商品id
+    var goodsId: Int = 0
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 最新价格
+    var lastPrice: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 可用
+    var available: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+
+    // 持仓量
+    var totals: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 成本
+    var cost: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+
+    // 持仓价格
+    var holdPrice: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+
+    // 盈亏率
+    var plp: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+
+    // 盈亏
+    var pl: Double = 0.0
+        get() = field
+        set(value) {
+            field = value
+        }
+    // 方向
+    var direction: Int = 0
+        get() = field
+        set(value) {
+            field = value
+        }
+
+}

+ 58 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/holds/HoldFragment.kt

@@ -0,0 +1,58 @@
+package cn.muchinfo.rma.view.base.future.holds
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.autoWidget.photopicter.HolderFragment
+import cn.muchinfo.rma.view.base.BaseFragment
+import cn.muchinfo.rma.view.base.future.market.MarketData
+
+/**
+ * 持仓列表界面
+ */
+class HoldFragment : BaseFragment<HoldViewModel>() {
+
+    companion object {
+        fun getInstance() = HoldFragment()
+    }
+//region views
+    private var _view: View? = null
+    private var idHoldList: RecyclerView? = null // 持仓列表
+//endregion
+    override fun onCreateView(
+        inflater: LayoutInflater,
+        container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        _view = inflater.inflate(R.layout.hold_fragment, container, false)
+        initViews()
+        return _view
+    }
+
+    private fun initViews() {
+        idHoldList = _view?.findViewById(R.id.id_hold_list)
+        val list: ArrayList<HoldData>? = ArrayList()
+        for (a in 1..5) {
+            val m = HoldData()
+            m.goodsName = "铁矿石" + (2105 + a)
+            m.goodsCode = "I" + (2105 + a)
+            m.lastPrice = 998.0 + a
+            m.available = 1.0 + a
+            m.totals = 5.0 + a
+            m.cost = 500.0 + a
+            m.pl = 100.0 + a
+            m.plp = (100 + a) * 0.003
+            m.holdPrice = 899.0 + a
+            m.direction = a
+            list?.add(m)
+        }
+        val layoutManager = LinearLayoutManager(context)
+        idHoldList?.layoutManager = layoutManager
+        viewModel.list = list
+        idHoldList?.adapter = viewModel.getAdapter()
+    }
+}

+ 87 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/holds/HoldViewModel.kt

@@ -0,0 +1,87 @@
+package cn.muchinfo.rma.view.base.future.holds
+
+import android.content.Context
+import android.graphics.drawable.Drawable
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.ImageView
+import android.widget.RelativeLayout
+import android.widget.TextView
+import androidx.recyclerview.widget.RecyclerView
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.base.BaseViewModel
+
+/**
+ * 持仓的ViewModel
+ */
+class HoldViewModel : BaseViewModel() {
+
+    var list: ArrayList<HoldData>? = null
+
+    /**
+     * 获取配置器。
+     */
+    fun getAdapter(): RecyclerView.Adapter<HoldAdapter.HoldHolder> {
+        return HoldAdapter(context, list)
+    }
+    /**
+     * 通用的适配器。
+     */
+    class HoldAdapter(context: Context?, list: ArrayList<HoldData>?) : RecyclerView.Adapter<HoldAdapter.HoldHolder>() {
+        private var list: ArrayList<HoldData>? = null
+        private var inflater: LayoutInflater? = null
+        private var context: Context? = null
+        private var pink: Drawable? = null
+        private var green: Drawable? = null
+        private var priceRed: Int = 0
+        private var priceGreen: Int = 0
+        init {
+            this.list = list
+            this.inflater = LayoutInflater.from(context)
+            this.context = context
+
+            pink = context?.getDrawable(R.drawable.rma_red)
+            green = context?.getDrawable(R.drawable.rma_green)
+            priceGreen = context?.getColor(R.color.p_price_green)!!
+            priceRed = context.getColor(R.color.p_price_red)
+        }
+
+        override fun getItemCount(): Int {
+            return list?.size ?: 0
+        }
+
+        class HoldHolder(itemView: View?) : RecyclerView.ViewHolder(itemView!!) {
+            var idGoodsName = itemView?.findViewById<TextView>(R.id.id_goods_name)
+            var idTransDirection = itemView?.findViewById<TextView>(R.id.id_trans_direction)
+            var idAvailable = itemView?.findViewById<TextView>(R.id.id_available)
+            var idHoldTotal = itemView?.findViewById<TextView>(R.id.id_hold_total)
+            var idLastPrice = itemView?.findViewById<TextView>(R.id.id_last_price)
+            var idCost = itemView?.findViewById<TextView>(R.id.id_cost)
+            var idPl = itemView?.findViewById<TextView>(R.id.id_pl)
+            var idPlp = itemView?.findViewById<TextView>(R.id.id_plp)
+
+        }
+
+        override fun onBindViewHolder(holder: HoldHolder, position: Int) {
+            holder.idGoodsName?.text = list?.get(position)?.goodsName
+            holder.idAvailable?.text = list?.get(position)?.available.toString()
+            holder.idHoldTotal?.text = list?.get(position)?.totals.toString()
+            holder.idLastPrice?.text = list?.get(position)?.lastPrice.toString()
+            holder.idCost?.text = list?.get(position)?.cost.toString()
+            holder.idPl?.text = list?.get(position)?.pl.toString()
+            holder.idPlp?.text = list?.get(position)?.plp.toString()
+            if (list?.get(position)?.direction == 0) {
+                holder.idTransDirection?.text = context?.resources?.getString(R.string.str_buy)
+            } else {
+                holder.idTransDirection?.text = context?.resources?.getString(R.string.str_sell)
+            }
+
+        }
+
+        override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HoldHolder {
+            return HoldHolder(inflater?.inflate(R.layout.hold_item, parent, false))
+        }
+
+    }
+}

+ 28 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/market/MarketBaseModel.kt

@@ -1,6 +1,7 @@
 package cn.muchinfo.rma.view.base.future.market
 
 import android.content.Context
+import android.graphics.drawable.ColorDrawable
 import android.graphics.drawable.Drawable
 import android.view.LayoutInflater
 import android.view.View
@@ -11,6 +12,7 @@ import android.widget.TextView
 import androidx.recyclerview.widget.RecyclerView
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.view.base.BaseViewModel
+import com.blankj.utilcode.util.ToastUtils
 
 class MarketBaseModel : BaseViewModel() {
     var list: ArrayList<MarketData>? = null
@@ -27,12 +29,15 @@ class MarketBaseModel : BaseViewModel() {
      * 通用的适配器。
      */
     class MyAdapter(context: Context?, list: ArrayList<MarketData>?) : RecyclerView.Adapter<MyAdapter.MarketHolder>() {
-        var list: ArrayList<MarketData>? = null
-        var inflater: LayoutInflater? = null
-        var context: Context? = null
-        var choose: Drawable? = null
-        var unChoose: Drawable? = null
-        var pink: Drawable? = null
+        private var list: ArrayList<MarketData>? = null
+        private var inflater: LayoutInflater? = null
+        private var context: Context? = null
+        private var choose: Drawable? = null
+        private var unChoose: Drawable? = null
+        private var pink: Drawable? = null
+        private var green: Drawable? = null
+        private var priceRed: Int = 0
+        private var priceGreen: Int = 0
         init {
             this.list = list
             this.inflater = LayoutInflater.from(context)
@@ -41,6 +46,9 @@ class MarketBaseModel : BaseViewModel() {
             choose = context?.getDrawable(R.mipmap.rma_choose)
             unChoose = context?.getDrawable(R.mipmap.rma_un_choose)
             pink = context?.getDrawable(R.drawable.rma_red)
+            green = context?.getDrawable(R.drawable.rma_green)
+            priceGreen = context?.getColor(R.color.p_price_green)!!
+            priceRed = context.getColor(R.color.p_price_red)
         }
 
         override fun getItemCount(): Int {
@@ -64,7 +72,17 @@ class MarketBaseModel : BaseViewModel() {
             holder.idUpDown?.text = list?.get(position)?.upDown.toString()
             holder.idPrice?.text = list?.get(position)?.lastPrice.toString()
 
-            holder.idPrice?.background = pink
+            if (position % 2 == 0) {
+                holder.idUpDown?.background = green
+                holder.idUpDown?.setTextColor(priceGreen)
+                holder.idPrice?.background = green
+                holder.idPrice?.setTextColor(priceGreen)
+            } else {
+                holder.idUpDown?.background = pink
+                holder.idUpDown?.setTextColor(priceRed)
+                holder.idPrice?.background = pink
+                holder.idPrice?.setTextColor(priceRed)
+            }
 
             // 是否自选的
             if (list?.get(position)?.isChoose == true) {
@@ -72,6 +90,9 @@ class MarketBaseModel : BaseViewModel() {
             } else {
                 holder.idIsChoose?.setImageDrawable(unChoose)
             }
+            holder.idChoose?.setOnClickListener {
+                ToastUtils.showShort(list?.get(position)?.goodsName)
+            }
         }
 
         override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MarketHolder {

+ 5 - 0
RMA/app/src/main/res/drawable/rma_green.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <corners android:radius="2.5dp"/>
+    <solid android:color="@color/p_green_color"/>
+</shape>

+ 1 - 1
RMA/app/src/main/res/drawable/rma_red.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
     <corners android:radius="2.5dp"/>
-    <solid android:color="@color/p_pink_color"/>
+    <solid android:color="@color/p_red_color"/>
 </shape>

+ 79 - 0
RMA/app/src/main/res/layout/entrust_fragment.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+<!--tabs-->
+    <com.google.android.material.tabs.TabLayout
+        android:layout_width="match_parent"
+        android:id="@+id/id_entrust_tab"
+        app:layout_constraintTop_toTopOf="parent"
+        android:layout_height="40dp"/>
+
+    <include
+        layout="@layout/line_view"
+        android:id="@+id/line1"
+        android:layout_width="match_parent"
+        android:layout_height="0.1dp"
+        app:layout_constraintTop_toBottomOf="@+id/id_entrust_tab"/>
+
+    <TextView
+        android:id="@+id/id_name_direction"
+        android:layout_width="0dp"
+        style="@style/HoldHeadTextStyle"
+        android:text="@string/str_status_date"
+        app:layout_constraintTop_toBottomOf="@+id/id_entrust_tab"
+        app:layout_constraintEnd_toStartOf="@+id/id_available_hold"
+        app:layout_constraintStart_toStartOf="parent"
+        android:paddingStart="15dp"
+        android:layout_height="wrap_content"/>
+    <TextView
+        android:id="@+id/id_available_hold"
+        android:layout_width="0dp"
+        android:gravity="end"
+        android:paddingEnd="20dp"
+        style="@style/HoldHeadTextStyle"
+        android:text="@string/str_name_type"
+        app:layout_constraintTop_toBottomOf="@+id/id_entrust_tab"
+        app:layout_constraintStart_toEndOf="@+id/id_name_direction"
+        app:layout_constraintEnd_toStartOf="@+id/id_last_cost"
+        android:layout_height="wrap_content"/>
+    <TextView
+        android:id="@+id/id_last_cost"
+        android:layout_width="0dp"
+        android:text="@string/str_entrust_num"
+        android:gravity="end"
+        android:paddingEnd="20dp"
+        style="@style/HoldHeadTextStyle"
+        app:layout_constraintStart_toEndOf="@+id/id_available_hold"
+        app:layout_constraintEnd_toStartOf="@+id/id_pl_plp"
+        app:layout_constraintTop_toBottomOf="@+id/id_entrust_tab"
+        android:layout_height="wrap_content"/>
+    <TextView
+        android:id="@+id/id_pl_plp"
+        android:layout_width="0dp"
+        android:text="@string/str_pl"
+        android:gravity="end"
+        style="@style/HoldHeadTextStyle"
+        android:paddingEnd="15dp"
+        app:layout_constraintTop_toTopOf="@+id/id_name_direction"
+        app:layout_constraintBottom_toBottomOf="@+id/id_name_direction"
+        app:layout_constraintStart_toEndOf="@+id/id_last_cost"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_height="wrap_content"/>
+    <include
+        layout="@layout/line_view"
+        android:id="@+id/line2"
+        app:layout_constraintTop_toBottomOf="@+id/id_name_direction"
+        android:layout_width="match_parent"
+        android:layout_height="0.1dp"/>
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:layout_width="match_parent"
+        android:id="@+id/id_entrust_list"
+        app:layout_constraintTop_toBottomOf="@+id/line2"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:layout_height="0dp"/>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 35 - 0
RMA/app/src/main/res/layout/entrust_item.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:padding="15dp"
+    android:layout_height="match_parent">
+
+<!--状态-->
+    <TextView
+        android:layout_width="wrap_content"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        android:id="@+id/id_status"
+        android:text="已报"
+        style="@style/ListTextStyle"
+        android:layout_height="wrap_content"/>
+<!--    时间-->
+    <TextView
+        app:layout_constraintTop_toBottomOf="@+id/id_status"
+        android:layout_width="wrap_content"
+        android:id="@+id/id_date"
+        android:text="10:10:10"
+        style="@style/ListSummaryTextStyle"
+        app:layout_constraintStart_toStartOf="parent"
+        android:layout_height="wrap_content"/>
+
+<!--    盈亏-->
+    <TextView
+        android:layout_width="wrap_content"
+        android:text="100.00"
+        style="@style/ListTextStyle"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        android:layout_height="wrap_content"/>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 67 - 0
RMA/app/src/main/res/layout/hold_fragment.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+    <TextView
+        android:id="@+id/id_name_direction"
+        android:layout_width="0dp"
+        style="@style/HoldHeadTextStyle"
+        android:text="@string/str_name_direction"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintEnd_toStartOf="@+id/id_available_hold"
+        app:layout_constraintStart_toStartOf="parent"
+        android:paddingStart="15dp"
+        app:layout_constraintBottom_toBottomOf="@+id/id_pl_plp"
+        android:layout_height="wrap_content"/>
+    <TextView
+        android:id="@+id/id_available_hold"
+        android:layout_width="0dp"
+        android:gravity="end"
+        android:paddingEnd="20dp"
+        style="@style/HoldHeadTextStyle"
+        app:layout_constraintBottom_toBottomOf="@+id/id_pl_plp"
+        android:text="@string/str_available_hold"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/id_name_direction"
+        app:layout_constraintEnd_toStartOf="@+id/id_last_cost"
+        android:layout_height="wrap_content"/>
+    <TextView
+        android:id="@+id/id_last_cost"
+        android:layout_width="0dp"
+        app:layout_constraintBottom_toBottomOf="@+id/id_pl_plp"
+        android:text="@string/str_last_cost"
+        android:gravity="end"
+        android:paddingEnd="20dp"
+        style="@style/HoldHeadTextStyle"
+        app:layout_constraintStart_toEndOf="@+id/id_available_hold"
+        app:layout_constraintEnd_toStartOf="@+id/id_pl_plp"
+        app:layout_constraintTop_toTopOf="parent"
+        android:layout_height="wrap_content"/>
+    <TextView
+        android:id="@+id/id_pl_plp"
+        android:layout_width="0dp"
+        android:text="@string/str_pl_plp"
+        android:gravity="end"
+        style="@style/HoldHeadTextStyle"
+        android:paddingEnd="15dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/id_last_cost"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_height="wrap_content"/>
+
+    <include
+        layout="@layout/line_view"
+        android:id="@+id/line"
+        android:layout_width="match_parent"
+        android:layout_height="0.1dp"
+        app:layout_constraintTop_toBottomOf="@+id/id_pl_plp"/>
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:id="@+id/id_hold_list"
+        app:layout_constraintTop_toBottomOf="@+id/line"
+        app:layout_constraintBottom_toBottomOf="parent"
+        />
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 89 - 0
RMA/app/src/main/res/layout/hold_item.xml

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:padding="15dp"
+    android:layout_height="wrap_content">
+    <TextView
+        android:layout_width="0dp"
+        android:text="PTA1907"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        style="@style/ListTextStyle"
+        app:layout_constraintEnd_toStartOf="@+id/id_available"
+        android:id="@+id/id_goods_name"
+        android:layout_height="wrap_content"/>
+    <TextView
+        android:layout_width="wrap_content"
+        app:layout_constraintTop_toBottomOf="@+id/id_goods_name"
+        app:layout_constraintStart_toStartOf="parent"
+        android:id="@+id/id_trans_direction"
+        android:text="买"
+        style="@style/ListSummaryTextStyle"
+        android:layout_height="wrap_content"/>
+<!--可用-->
+    <TextView
+        android:layout_width="0dp"
+        android:id="@+id/id_available"
+        android:text="40"
+        android:gravity="end"
+        style="@style/ListTextStyle"
+        android:paddingEnd="20dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/id_goods_name"
+        app:layout_constraintEnd_toStartOf="@+id/id_last_price"
+        android:layout_height="wrap_content"/>
+<!--    持仓-->
+    <TextView
+        android:layout_width="wrap_content"
+        android:id="@+id/id_hold_total"
+        app:layout_constraintEnd_toEndOf="@+id/id_available"
+        android:paddingEnd="20dp"
+        android:text="50"
+        style="@style/ListSummaryTextStyle"
+        app:layout_constraintTop_toBottomOf="@+id/id_available"
+        android:layout_height="wrap_content"/>
+
+<!--    现价-->
+    <TextView
+        android:layout_width="0dp"
+        android:id="@+id/id_last_price"
+        android:paddingEnd="20dp"
+        style="@style/ListTextStyle"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/id_available"
+        app:layout_constraintEnd_toStartOf="@+id/id_pl"
+        android:text="5460"
+        android:gravity="end"
+        android:layout_height="wrap_content"/>
+<!--成本-->
+    <TextView
+        android:layout_width="wrap_content"
+        android:id="@+id/id_cost"
+        android:paddingEnd="20dp"
+        style="@style/ListSummaryTextStyle"
+        android:text="5400"
+        app:layout_constraintEnd_toEndOf="@+id/id_last_price"
+        app:layout_constraintTop_toBottomOf="@+id/id_last_price"
+        android:layout_height="wrap_content"/>
+<!--    pl-->
+    <TextView
+        android:layout_width="0dp"
+        app:layout_constraintTop_toTopOf="parent"
+        android:id="@+id/id_pl"
+        android:text="100.00"
+        android:gravity="end"
+        app:layout_constraintStart_toEndOf="@+id/id_last_price"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_height="wrap_content"/>
+    <TextView
+        android:layout_width="wrap_content"
+        android:gravity="end"
+        android:id="@+id/id_plp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/id_pl"
+        android:text="10.3%"
+        style="@style/ListSummaryTextStyle"
+        android:layout_height="wrap_content"/>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 2 - 1
RMA/app/src/main/res/layout/market_item.xml

@@ -66,9 +66,9 @@
             style="@style/ListTextStyle"
             android:gravity="end"
             android:text="价格"
-            android:textColor="#FF5C6F"
             android:paddingEnd="8dp"
             android:paddingStart="0dp"
+            android:layout_marginStart="10dp"
             android:paddingTop="3dp"
             android:paddingBottom="3dp"
             app:layout_constraintEnd_toStartOf="@+id/id_up_down"
@@ -82,6 +82,7 @@
             android:gravity="end"
             android:text="涨跌"
             android:paddingEnd="8dp"
+            android:layout_marginStart="10dp"
             android:paddingStart="0dp"
             android:paddingTop="3dp"
             android:paddingBottom="3dp"

+ 4 - 1
RMA/app/src/main/res/values/colors.xml

@@ -74,5 +74,8 @@
     <!--全局配置-分割线的颜色-->
     <color name="p_line_color">#e9e7e7</color>
     <color name="p_global_bg_color">#f3f3f3</color>
-    <color name="p_pink_color">#FFEAEC</color>
+    <color name="p_red_color">#FFEAEC</color>
+    <color name="p_green_color">#DDFFF4</color>
+    <color name="p_price_green">#1DC089</color>
+    <color name="p_price_red">#FF5C6F</color>
 </resources>

+ 13 - 0
RMA/app/src/main/res/values/strings.xml

@@ -72,4 +72,17 @@
     <string name="str_list_head_price">价格</string>
     <string name="str_list_head_up_down">涨跌</string>
     <string name="str_list_head_hold_total">持仓量</string>
+    <string name="str_name_direction">名称\n方向</string>
+    <string name="str_available_hold">可用\n持仓</string>
+    <string name="str_last_cost">现价\n成本</string>
+    <string name="str_pl_plp">持仓盈亏\n盈亏比</string>
+    <string name="str_buy">买</string>
+    <string name="str_sell">卖</string>
+    <string name="str_pl">持仓盈亏</string>
+    <string name="str_status_date">状态\n时间</string>
+    <string name="str_name_type">名称\n类型</string>
+    <string name="str_entrust_num">委托数量\n价格</string>
+    <string name="str_can_cancel_today">今日可撤</string>
+    <string name="str_entrust_today">今日委托</string>
+
 </resources>

+ 11 - 0
RMA/app/src/main/res/values/styles.xml

@@ -92,6 +92,17 @@
         <item name="android:textColor">@color/rma_black_33</item>
         <item name="android:textSize">14sp</item>
     </style>
+    <!--期货报价牌界面列表的文字的样式-->
+    <style name="ListSummaryTextStyle" parent="@android:style/Widget.TextView">
+        <item name="android:textColor">@color/hint_text_color</item>
+        <item name="android:textSize">12sp</item>
+    </style>
+    <!--期货报价牌界面列表的文字的样式-->
+    <style name="HoldHeadTextStyle" parent="@style/ListSummaryTextStyle">
+        <item name="android:textSize">10sp</item>
+        <item name="android:paddingTop">5dp</item>
+        <item name="android:paddingBottom">5dp</item>
+    </style>
 
     <style name="style_dialog" parent="android:style/Theme.Dialog">
         <item name="android:windowFrame">@null</item>