|
@@ -0,0 +1,425 @@
|
|
|
|
|
+package cn.muchinfo.rma.view.base.main
|
|
|
|
|
+
|
|
|
|
|
+import android.content.Intent
|
|
|
|
|
+import android.os.Bundle
|
|
|
|
|
+import android.view.Gravity
|
|
|
|
|
+import android.view.LayoutInflater
|
|
|
|
|
+import android.view.View
|
|
|
|
|
+import android.view.ViewGroup
|
|
|
|
|
+import cn.muchinfo.rma.R
|
|
|
|
|
+import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
|
|
+import cn.muchinfo.rma.view.autoWidget.autoSize
|
|
|
|
|
+import cn.muchinfo.rma.view.autoWidget.createRoundRectDrawable
|
|
|
|
|
+
|
|
|
|
|
+import cn.muchinfo.rma.view.autoWidget.textColorInt
|
|
|
|
|
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
|
|
|
|
|
+import cn.muchinfo.rma.view.base.BaseFragment
|
|
|
|
|
+import cn.muchinfo.rma.view.base.future.trade.itemView
|
|
|
|
|
+import cn.muchinfo.rma.view.base.home.contract.emptyView
|
|
|
|
|
+
|
|
|
|
|
+import com.qmuiteam.qmui.kotlin.matchParent
|
|
|
|
|
+import org.jetbrains.anko.*
|
|
|
|
|
+import org.jetbrains.anko.support.v4.UI
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 千海金我的fragment
|
|
|
|
|
+ */
|
|
|
|
|
+class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>(){
|
|
|
|
|
+
|
|
|
|
|
+ override fun onCreateView(
|
|
|
|
|
+ inflater: LayoutInflater,
|
|
|
|
|
+ container: ViewGroup?,
|
|
|
|
|
+ savedInstanceState: Bundle?
|
|
|
|
|
+ ): View? {
|
|
|
|
|
+ return UI {
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+
|
|
|
|
|
+ scrollView {
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ backgroundResource = R.mipmap.qhj_main_bg
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "我的"
|
|
|
|
|
+ textColorInt = R.color.white
|
|
|
|
|
+ textSizeAuto = 43
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(120))
|
|
|
|
|
+
|
|
|
|
|
+ view {
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(org.jetbrains.anko.matchParent,0,1f)
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ backgroundResource = R.drawable.qhj_main_top_white_bg
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ view {
|
|
|
|
|
+ backgroundResource = R.mipmap.qhj_main_portrait
|
|
|
|
|
+ }.lparams(autoSize(96), autoSize(96)){
|
|
|
|
|
+ marginStart = autoSize(43)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "周星星"
|
|
|
|
|
+ textSizeAuto = 36
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ topMargin = autoSize(15)
|
|
|
|
|
+ marginStart = autoSize(32)
|
|
|
|
|
+ }
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "142141241"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ topMargin = autoSize(5)
|
|
|
|
|
+ marginStart = autoSize(32)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(0, autoSize(100),1f)
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ backgroundResource = R.drawable.qhj_main_recommended_bg
|
|
|
|
|
+ gravity = Gravity.CENTER
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "申请推广码"
|
|
|
|
|
+ textSizeAuto = 29
|
|
|
|
|
+ textColorInt = R.color.white
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(autoSize(200), autoSize(60))
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(matchParent, autoSize(100))
|
|
|
|
|
+ }.lparams(matchParent, autoSize(213))
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(matchParent, autoSize(360))
|
|
|
|
|
+
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "总资产(元)"
|
|
|
|
|
+ textSizeAuto = 29
|
|
|
|
|
+ textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(78)
|
|
|
|
|
+ }
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.qhj_open_eye
|
|
|
|
|
+ }.lparams(autoSize(38), autoSize(38)){
|
|
|
|
|
+ marginStart = autoSize(32)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(matchParent, autoSize(60))
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "1231241"
|
|
|
|
|
+ textSizeAuto = 60
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(78)
|
|
|
|
|
+ topMargin = autoSize(15)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ //余额
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "余额(元)"
|
|
|
|
|
+ textSizeAuto = 29
|
|
|
|
|
+ textColorInt =R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(78)
|
|
|
|
|
+ }
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "35000.44"
|
|
|
|
|
+ textSizeAuto = 36
|
|
|
|
|
+ textColorInt = R.color.rma_green_color
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(78)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(0, autoSize(110),1f)
|
|
|
|
|
+
|
|
|
|
|
+ //持仓
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "持仓(元)"
|
|
|
|
|
+ textSizeAuto = 29
|
|
|
|
|
+ textColorInt =R.color.rma_hint_text_color_ccc
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "35000.44"
|
|
|
|
|
+ textSizeAuto = 36
|
|
|
|
|
+ textColorInt = R.color.rma_red_color
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(0, autoSize(110),1f)
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(matchParent, autoSize(110)){
|
|
|
|
|
+ topMargin = autoSize(40)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ backgroundResource = R.drawable.qhj_withdraw_bg
|
|
|
|
|
+ gravity = Gravity.CENTER
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "提现"
|
|
|
|
|
+ textColorInt = R.color.qhj_withdraw_color
|
|
|
|
|
+ textSizeAuto = 36
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(0, autoSize(100),1f){
|
|
|
|
|
+ marginStart = autoSize(78)
|
|
|
|
|
+ marginEnd = autoSize(36)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ backgroundResource = R.drawable.qhj_main_blue_bg
|
|
|
|
|
+ gravity = Gravity.CENTER
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "充值"
|
|
|
|
|
+ textColorInt = R.color.white
|
|
|
|
|
+ textSizeAuto = 36
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent)
|
|
|
|
|
+ }.lparams(0, autoSize(100),1f){
|
|
|
|
|
+ marginStart = autoSize(36)
|
|
|
|
|
+ marginEnd = autoSize(78)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(matchParent, autoSize(100)){
|
|
|
|
|
+ topMargin = autoSize(45)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(matchParent, autoSize(440))
|
|
|
|
|
+
|
|
|
|
|
+ view {
|
|
|
|
|
+ background = resources.getDrawable(R.color.rma_hint_text_color_ccc)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(20))
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+
|
|
|
|
|
+ //交易撤单
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.qhj_trading_cancellations
|
|
|
|
|
+ }.lparams(autoSize(60), autoSize(60)){
|
|
|
|
|
+ topMargin = autoSize(45)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "交易撤单"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ topMargin = autoSize(10)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(0, autoSize(200),1f)
|
|
|
|
|
+
|
|
|
|
|
+ //成交记录
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.qhj_deal_the_record
|
|
|
|
|
+ }.lparams(autoSize(60), autoSize(60)){
|
|
|
|
|
+ topMargin = autoSize(45)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "成交记录"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ topMargin = autoSize(10)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(0, autoSize(200),1f)
|
|
|
|
|
+
|
|
|
|
|
+ //资金流水
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.qhj_money_flowing_water
|
|
|
|
|
+ }.lparams(autoSize(60), autoSize(60)){
|
|
|
|
|
+ topMargin = autoSize(45)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "资金流水"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ topMargin = autoSize(10)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(0, autoSize(200),1f)
|
|
|
|
|
+
|
|
|
|
|
+ //提货查询
|
|
|
|
|
+ verticalLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.qhj_goods_query
|
|
|
|
|
+ }.lparams(autoSize(60), autoSize(60)){
|
|
|
|
|
+ topMargin = autoSize(45)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "提货查询"
|
|
|
|
|
+ textSizeAuto = 31
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ topMargin = autoSize(10)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(0, autoSize(200),1f)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(200))
|
|
|
|
|
+
|
|
|
|
|
+ view {
|
|
|
|
|
+ background = resources.getDrawable(R.color.rma_hint_text_color_ccc)
|
|
|
|
|
+ }.lparams(matchParent, autoSize(20))
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.qhj_cast_surely_management
|
|
|
|
|
+ }.lparams(autoSize(50), autoSize(50)){
|
|
|
|
|
+ marginStart = autoSize(60)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "定投管理"
|
|
|
|
|
+ textSizeAuto = 36
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(29)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ emptyView()
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ visibility = View.GONE
|
|
|
|
|
+ text = "99"
|
|
|
|
|
+ textColorInt = R.color.p_global_write_color
|
|
|
|
|
+ textSizeAuto = 15
|
|
|
|
|
+ setPadding(
|
|
|
|
|
+ autoSize(10),
|
|
|
|
|
+ autoSize(6),
|
|
|
|
|
+ autoSize(10),
|
|
|
|
|
+ autoSize(6)
|
|
|
|
|
+ )
|
|
|
|
|
+ backgroundDrawable =
|
|
|
|
|
+ createRoundRectDrawable("#FFA127", 45)
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
+ marginEnd = autoSize(20)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
|
|
+ }.lparams(autoSize(40), autoSize(40)){
|
|
|
|
|
+ marginEnd = autoSize(49)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(matchParent, autoSize(140))
|
|
|
|
|
+
|
|
|
|
|
+ itemView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.qhj_account_manager
|
|
|
|
|
+ }.lparams(autoSize(50), autoSize(50)){
|
|
|
|
|
+ marginStart = autoSize(60)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "提现账户管理"
|
|
|
|
|
+ textSizeAuto = 36
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(29)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ emptyView()
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ visibility = View.GONE
|
|
|
|
|
+ text = "99"
|
|
|
|
|
+ textColorInt = R.color.p_global_write_color
|
|
|
|
|
+ textSizeAuto = 15
|
|
|
|
|
+ setPadding(
|
|
|
|
|
+ autoSize(10),
|
|
|
|
|
+ autoSize(6),
|
|
|
|
|
+ autoSize(10),
|
|
|
|
|
+ autoSize(6)
|
|
|
|
|
+ )
|
|
|
|
|
+ backgroundDrawable =
|
|
|
|
|
+ createRoundRectDrawable("#FFA127", 45)
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
+ marginEnd = autoSize(20)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
|
|
+ }.lparams(autoSize(40), autoSize(40)){
|
|
|
|
|
+ marginEnd = autoSize(49)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(matchParent, autoSize(140))
|
|
|
|
|
+
|
|
|
|
|
+ itemView()
|
|
|
|
|
+
|
|
|
|
|
+ linearLayout {
|
|
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.qhj_good_address
|
|
|
|
|
+ }.lparams(autoSize(50), autoSize(50)){
|
|
|
|
|
+ marginStart = autoSize(60)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ text = "收货地址管理"
|
|
|
|
|
+ textSizeAuto = 36
|
|
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
|
|
+ marginStart = autoSize(29)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ emptyView()
|
|
|
|
|
+
|
|
|
|
|
+ textView {
|
|
|
|
|
+ visibility = View.GONE
|
|
|
|
|
+ text = "99"
|
|
|
|
|
+ textColorInt = R.color.p_global_write_color
|
|
|
|
|
+ textSizeAuto = 15
|
|
|
|
|
+ setPadding(
|
|
|
|
|
+ autoSize(10),
|
|
|
|
|
+ autoSize(6),
|
|
|
|
|
+ autoSize(10),
|
|
|
|
|
+ autoSize(6)
|
|
|
|
|
+ )
|
|
|
|
|
+ backgroundDrawable =
|
|
|
|
|
+ createRoundRectDrawable("#FFA127", 45)
|
|
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
|
|
+ marginEnd = autoSize(20)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ imageView {
|
|
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
|
|
+ }.lparams(autoSize(40), autoSize(40)){
|
|
|
|
|
+ marginEnd = autoSize(49)
|
|
|
|
|
+ }
|
|
|
|
|
+ }.lparams(matchParent, autoSize(140))
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }.view
|
|
|
|
|
+ }
|
|
|
|
|
+}
|