|
|
@@ -5,10 +5,7 @@ import android.content.Intent
|
|
|
import android.graphics.Rect
|
|
|
import android.net.Uri
|
|
|
import android.os.Bundle
|
|
|
-import android.view.Gravity
|
|
|
-import android.view.LayoutInflater
|
|
|
-import android.view.View
|
|
|
-import android.view.ViewGroup
|
|
|
+import android.view.*
|
|
|
import android.widget.ImageView
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
import androidx.cardview.widget.CardView
|
|
|
@@ -70,6 +67,8 @@ class HomeFragment : BaseFragment<HomeViewModel>() {
|
|
|
private val researchReportUI: ResearchReportUI by lazy { ResearchReportUI(this, viewModel) }//研报
|
|
|
private val informationUI: InformationUI by lazy { InformationUI(this, viewModel) }//咨讯
|
|
|
|
|
|
+ var isScrollIndexX = 0.0//记录首页导航菜单滚动的位置
|
|
|
+
|
|
|
/**
|
|
|
* 用户未读标识
|
|
|
*/
|
|
|
@@ -258,354 +257,418 @@ class HomeFragment : BaseFragment<HomeViewModel>() {
|
|
|
|
|
|
}.lparams(matchParent, autoSize(400))
|
|
|
|
|
|
- linearLayout {
|
|
|
- relativeLayout {
|
|
|
-
|
|
|
- verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- val intent = Intent()
|
|
|
- intent.setClass(
|
|
|
- context,
|
|
|
- CustomerDataActivity::class.java
|
|
|
- )
|
|
|
- ActivityUtils.startActivity(intent)
|
|
|
- }
|
|
|
- imageView {
|
|
|
-// userImage = this
|
|
|
-// userqBadgeView.bindTarget(userImage).setBadgeBackground(resources.getDrawable(R.drawable.hn_main_cercle_red_bg)).setBadgeGravity(Gravity.TOP or Gravity.END).setGravityOffset(80f,0f,false).setBadgeText("10")
|
|
|
- imageResource = R.mipmap.main_business_1
|
|
|
- }.lparams(autoSize(72), autoSize(72)) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
- }
|
|
|
-
|
|
|
- textView {
|
|
|
- text = "客户资料"
|
|
|
- textColorInt = R.color.black
|
|
|
- textSizeAuto = 26
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- topMargin = autoSize(20)
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
- }
|
|
|
- }.lparams(matchParent, matchParent)
|
|
|
-
|
|
|
- textView {
|
|
|
- visibility = View.GONE
|
|
|
- viewModel.pendingAudit.bindOptional(context) {
|
|
|
- if (it?.userqty?.toInt() ?: 0 > 99){
|
|
|
- text = "99+"
|
|
|
- }else{
|
|
|
- text = it?.userqty.toString()
|
|
|
- }
|
|
|
- if (it?.userqty?.toInt() == 0) {
|
|
|
- visibility = View.GONE
|
|
|
- } else {
|
|
|
- visibility = View.VISIBLE
|
|
|
- }
|
|
|
- }
|
|
|
- textColorInt = R.color.p_global_write_color
|
|
|
- textSizeAuto = 15
|
|
|
- setPadding(
|
|
|
- autoSize(10),
|
|
|
- autoSize(6),
|
|
|
- autoSize(10),
|
|
|
- autoSize(6)
|
|
|
- )
|
|
|
- backgroundDrawable = createRoundRectDrawable("#fe671a", 45)
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(130)
|
|
|
- }
|
|
|
- }.lparams(0, matchParent, 1f)
|
|
|
-
|
|
|
-
|
|
|
- verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- val intent = Intent()
|
|
|
- intent.setClass(
|
|
|
- context,
|
|
|
- CommodityInformationActivity::class.java
|
|
|
- )
|
|
|
- ActivityUtils.startActivity(intent)
|
|
|
- }
|
|
|
- imageView {
|
|
|
- imageResource = R.mipmap.main_business_2
|
|
|
- }.lparams(autoSize(72), autoSize(72)) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
- }
|
|
|
+ var startX = 0f
|
|
|
+ var endX = 0f
|
|
|
+
|
|
|
+ horizontalScrollView {
|
|
|
+ setOnScrollChangeListener(object : View.OnScrollChangeListener {
|
|
|
+ override fun onScrollChange(
|
|
|
+ p0: View?,
|
|
|
+ p1: Int,
|
|
|
+ p2: Int,
|
|
|
+ p3: Int,
|
|
|
+ p4: Int
|
|
|
+ ) {
|
|
|
+ val scrollRect = Rect()
|
|
|
+ getHitRect(scrollRect)
|
|
|
+ LogUtils.eTag("adakhsfkjahsfa11111111", "x = " + p1 + "y = " + p2)
|
|
|
|
|
|
- textView {
|
|
|
- text = "商品信息"
|
|
|
- textColorInt = R.color.black
|
|
|
- textSizeAuto = 26
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- topMargin = autoSize(20)
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
}
|
|
|
- }.lparams(0, matchParent, 1f)
|
|
|
+ })
|
|
|
|
|
|
- relativeLayout {
|
|
|
- verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- val intent = Intent()
|
|
|
- intent.setClass(context, ContractActivity::class.java)
|
|
|
- ActivityUtils.startActivity(intent)
|
|
|
- }
|
|
|
- imageView {
|
|
|
- imageResource = R.mipmap.main_business_3
|
|
|
- }.lparams(autoSize(72), autoSize(72)) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ setOnTouchListener(object : View.OnTouchListener{
|
|
|
+ override fun onTouch(p0: View?, p1: MotionEvent?): Boolean {
|
|
|
+ if (p1?.action == MotionEvent.ACTION_DOWN){
|
|
|
+ startX = p1.x
|
|
|
+ }else if (p1?.action == MotionEvent.ACTION_UP){
|
|
|
+ endX = p1.x
|
|
|
}
|
|
|
|
|
|
- textView {
|
|
|
- text = "现货合同"
|
|
|
- textColorInt = R.color.black
|
|
|
- textSizeAuto = 26
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
- topMargin = autoSize(20)
|
|
|
- }
|
|
|
- }.lparams(matchParent, matchParent)
|
|
|
-
|
|
|
- textView {
|
|
|
- visibility = View.GONE
|
|
|
- viewModel.pendingAudit.bindOptional(context) {
|
|
|
- if (it?.spotcontractqty?.toInt() ?: 0 > 99){
|
|
|
- text = "99+"
|
|
|
- }else{
|
|
|
- text = it?.spotcontractqty.toString()
|
|
|
- }
|
|
|
-
|
|
|
- if (it?.spotcontractqty?.toInt() == 0) {
|
|
|
- visibility = View.GONE
|
|
|
- } else {
|
|
|
- visibility = View.VISIBLE
|
|
|
- }
|
|
|
- }
|
|
|
- textColorInt = R.color.p_global_write_color
|
|
|
- textSizeAuto = 15
|
|
|
- setPadding(
|
|
|
- autoSize(10),
|
|
|
- autoSize(6),
|
|
|
- autoSize(10),
|
|
|
- autoSize(6)
|
|
|
- )
|
|
|
- backgroundDrawable = createRoundRectDrawable("#fe671a", 45)
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
-
|
|
|
- marginStart = autoSize(130)
|
|
|
- }
|
|
|
- }.lparams(0, matchParent, 1f)
|
|
|
-
|
|
|
- relativeLayout {
|
|
|
- verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- val intent = Intent()
|
|
|
- intent.setClass(context, HedgePlanActivity::class.java)
|
|
|
- ActivityUtils.startActivity(intent)
|
|
|
- }
|
|
|
- imageView {
|
|
|
- imageResource = R.mipmap.main_business_4
|
|
|
- }.lparams(autoSize(72), autoSize(72)) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ if (startX.minus(endX) > 50){
|
|
|
+ LogUtils.eTag("asdhakjhfskjahsdjkas","右滑动" )
|
|
|
+ }else if (startX.minus(endX) < -50){
|
|
|
+ LogUtils.eTag("asdhakjhfskjahsdjkas","左滑动" )
|
|
|
}
|
|
|
|
|
|
- textView {
|
|
|
- text = "套保计划"
|
|
|
- textColorInt = R.color.black
|
|
|
- textSizeAuto = 26
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
- topMargin = autoSize(20)
|
|
|
- }
|
|
|
- }.lparams(matchParent, matchParent)
|
|
|
-
|
|
|
- textView {
|
|
|
- visibility = View.GONE
|
|
|
- viewModel.pendingAudit.bindOptional(context) {
|
|
|
-
|
|
|
- if (it?.hedgeplanqty?.toInt() ?: 0 > 99){
|
|
|
- text = "99+"
|
|
|
- }else{
|
|
|
- text = it?.hedgeplanqty.toString()
|
|
|
- }
|
|
|
- if (it?.hedgeplanqty?.toInt() == 0) {
|
|
|
- visibility = View.GONE
|
|
|
- } else {
|
|
|
- visibility = View.VISIBLE
|
|
|
- }
|
|
|
- }
|
|
|
- textColorInt = R.color.p_global_write_color
|
|
|
- textSizeAuto = 15
|
|
|
- setPadding(
|
|
|
- autoSize(10),
|
|
|
- autoSize(6),
|
|
|
- autoSize(10),
|
|
|
- autoSize(6)
|
|
|
- )
|
|
|
- backgroundDrawable = createRoundRectDrawable("#fe671a", 45)
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(130)
|
|
|
+ return false
|
|
|
}
|
|
|
- }.lparams(0, matchParent, 1f)
|
|
|
-
|
|
|
- }.lparams(matchParent, autoSize(140)) {
|
|
|
- topMargin = autoSize(40)
|
|
|
- }
|
|
|
-
|
|
|
- linearLayout {
|
|
|
- relativeLayout {
|
|
|
+ })
|
|
|
+ linearLayout {
|
|
|
verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- val intent = Intent()
|
|
|
- intent.setClass(
|
|
|
- context,
|
|
|
- BusinessManagementActivity::class.java
|
|
|
- )
|
|
|
- ActivityUtils.startActivity(intent)
|
|
|
- }
|
|
|
- imageView {
|
|
|
- imageResource = R.mipmap.main_business_5
|
|
|
- }.lparams(autoSize(72), autoSize(72)) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ linearLayout {
|
|
|
+ relativeLayout {
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ CustomerDataActivity::class.java
|
|
|
+ )
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.main_business_1
|
|
|
+ }.lparams(autoSize(72), autoSize(72)) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "客户资料"
|
|
|
+ textColorInt = R.color.black
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ visibility = View.GONE
|
|
|
+ viewModel.pendingAudit.bindOptional(context) {
|
|
|
+ if (it?.userqty?.toInt() ?: 0 > 99) {
|
|
|
+ text = "99+"
|
|
|
+ } else {
|
|
|
+ text = it?.userqty.toString()
|
|
|
+ }
|
|
|
+ if (it?.userqty?.toInt() == 0) {
|
|
|
+ visibility = View.GONE
|
|
|
+ } else {
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+ }
|
|
|
+ textColorInt = R.color.p_global_write_color
|
|
|
+ textSizeAuto = 15
|
|
|
+ setPadding(
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6),
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6)
|
|
|
+ )
|
|
|
+ backgroundDrawable =
|
|
|
+ createRoundRectDrawable("#fe671a", 45)
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(130)
|
|
|
+ }
|
|
|
+ }.lparams(0, matchParent, 1f)
|
|
|
+
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ CommodityInformationActivity::class.java
|
|
|
+ )
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.main_business_2
|
|
|
+ }.lparams(autoSize(72), autoSize(72)) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "商品信息"
|
|
|
+ textColorInt = R.color.black
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+ }.lparams(0, matchParent, 1f)
|
|
|
+
|
|
|
+ relativeLayout {
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ ContractActivity::class.java
|
|
|
+ )
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.main_business_3
|
|
|
+ }.lparams(autoSize(72), autoSize(72)) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "现货合同"
|
|
|
+ textColorInt = R.color.black
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ visibility = View.GONE
|
|
|
+ viewModel.pendingAudit.bindOptional(context) {
|
|
|
+ if (it?.spotcontractqty?.toInt() ?: 0 > 99) {
|
|
|
+ text = "99+"
|
|
|
+ } else {
|
|
|
+ text = it?.spotcontractqty.toString()
|
|
|
+ }
|
|
|
+
|
|
|
+ if (it?.spotcontractqty?.toInt() == 0) {
|
|
|
+ visibility = View.GONE
|
|
|
+ } else {
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+ }
|
|
|
+ textColorInt = R.color.p_global_write_color
|
|
|
+ textSizeAuto = 15
|
|
|
+ setPadding(
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6),
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6)
|
|
|
+ )
|
|
|
+ backgroundDrawable =
|
|
|
+ createRoundRectDrawable("#fe671a", 45)
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+
|
|
|
+ marginStart = autoSize(130)
|
|
|
+ }
|
|
|
+ }.lparams(0, matchParent, 1f)
|
|
|
+
|
|
|
+ relativeLayout {
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ HedgePlanActivity::class.java
|
|
|
+ )
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.main_business_4
|
|
|
+ }.lparams(autoSize(72), autoSize(72)) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "套保计划"
|
|
|
+ textColorInt = R.color.black
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ visibility = View.GONE
|
|
|
+ viewModel.pendingAudit.bindOptional(context) {
|
|
|
+
|
|
|
+ if (it?.hedgeplanqty?.toInt() ?: 0 > 99) {
|
|
|
+ text = "99+"
|
|
|
+ } else {
|
|
|
+ text = it?.hedgeplanqty.toString()
|
|
|
+ }
|
|
|
+ if (it?.hedgeplanqty?.toInt() == 0) {
|
|
|
+ visibility = View.GONE
|
|
|
+ } else {
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+ }
|
|
|
+ textColorInt = R.color.p_global_write_color
|
|
|
+ textSizeAuto = 15
|
|
|
+ setPadding(
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6),
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6)
|
|
|
+ )
|
|
|
+ backgroundDrawable =
|
|
|
+ createRoundRectDrawable("#fe671a", 45)
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(130)
|
|
|
+ }
|
|
|
+ }.lparams(0, matchParent, 1f)
|
|
|
+
|
|
|
+ }.lparams(matchParent, autoSize(140)) {
|
|
|
+ topMargin = autoSize(40)
|
|
|
}
|
|
|
|
|
|
- textView {
|
|
|
- text = "业务审核"
|
|
|
- textColorInt = R.color.black
|
|
|
- textSizeAuto = 26
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
+ linearLayout {
|
|
|
+ relativeLayout {
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ BusinessManagementActivity::class.java
|
|
|
+ )
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.main_business_5
|
|
|
+ }.lparams(autoSize(72), autoSize(72)) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "业务审核"
|
|
|
+ textColorInt = R.color.black
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ visibility = View.GONE
|
|
|
+ viewModel.pendingAudit.bindOptional(context) {
|
|
|
+ val pty = it?.businessdjqty?.toInt()
|
|
|
+ ?.plus(it.businessjsqty.toInt())
|
|
|
+ if (pty ?: 0 > 99) {
|
|
|
+ text = "99+"
|
|
|
+ } else {
|
|
|
+ text = pty.toString()
|
|
|
+ }
|
|
|
+ if (pty == 0) {
|
|
|
+ visibility = View.GONE
|
|
|
+ } else {
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+ }
|
|
|
+ textColorInt = R.color.p_global_write_color
|
|
|
+ textSizeAuto = 15
|
|
|
+ setPadding(
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6),
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6)
|
|
|
+ )
|
|
|
+ backgroundDrawable =
|
|
|
+ createRoundRectDrawable("#fe671a", 45)
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(130)
|
|
|
+ }
|
|
|
+ }.lparams(0, matchParent, 1f)
|
|
|
+
|
|
|
+ relativeLayout {
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ FinancialActivity::class.java
|
|
|
+ )
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.main_business_6
|
|
|
+ }.lparams(autoSize(72), autoSize(72)) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "财务审核"
|
|
|
+ textColorInt = R.color.black
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ textView {
|
|
|
+ visibility = View.GONE
|
|
|
+ viewModel.pendingAudit.bindOptional(context) {
|
|
|
+ val pty = it?.businessfpqty?.toInt()
|
|
|
+ ?.plus(it.businesskxqty.toInt())
|
|
|
+ if (pty ?: 0 > 99) {
|
|
|
+ text = "99+"
|
|
|
+ } else {
|
|
|
+ text = pty.toString()
|
|
|
+ }
|
|
|
+ if (pty == 0) {
|
|
|
+ visibility = View.GONE
|
|
|
+ } else {
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ }
|
|
|
+ }
|
|
|
+ textColorInt = R.color.p_global_write_color
|
|
|
+ textSizeAuto = 15
|
|
|
+ setPadding(
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6),
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6)
|
|
|
+ )
|
|
|
+ backgroundDrawable =
|
|
|
+ createRoundRectDrawable("#fe671a", 45)
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(130)
|
|
|
+ }
|
|
|
+ }.lparams(0, matchParent, 1f)
|
|
|
+
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ TradingQueryActivity::class.java
|
|
|
+ )
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.main_business_7
|
|
|
+ }.lparams(autoSize(72), autoSize(72)) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "交易查询"
|
|
|
+ textColorInt = R.color.black
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ }
|
|
|
+ }.lparams(0, matchParent, 1f)
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ ReportQueryActivity::class.java
|
|
|
+ )
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.main_business_8
|
|
|
+ }.lparams(autoSize(72), autoSize(72)) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+
|
|
|
+ textView {
|
|
|
+ text = "报表查询"
|
|
|
+ textColorInt = R.color.black
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ }
|
|
|
+ }.lparams(0, matchParent, 1f)
|
|
|
+ }.lparams(matchParent, autoSize(140)) {
|
|
|
topMargin = autoSize(20)
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
}
|
|
|
- }.lparams(matchParent, matchParent)
|
|
|
-
|
|
|
- textView {
|
|
|
- visibility = View.GONE
|
|
|
- viewModel.pendingAudit.bindOptional(context) {
|
|
|
- val pty = it?.businessdjqty?.toInt()
|
|
|
- ?.plus(it.businessjsqty.toInt())
|
|
|
- if (pty ?: 0 > 99){
|
|
|
- text = "99+"
|
|
|
- }else{
|
|
|
- text = pty.toString()
|
|
|
- }
|
|
|
- if (pty == 0) {
|
|
|
- visibility = View.GONE
|
|
|
- } else {
|
|
|
- visibility = View.VISIBLE
|
|
|
- }
|
|
|
- }
|
|
|
- textColorInt = R.color.p_global_write_color
|
|
|
- textSizeAuto = 15
|
|
|
- setPadding(
|
|
|
- autoSize(10),
|
|
|
- autoSize(6),
|
|
|
- autoSize(10),
|
|
|
- autoSize(6)
|
|
|
- )
|
|
|
- backgroundDrawable = createRoundRectDrawable("#fe671a", 45)
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(130)
|
|
|
- }
|
|
|
- }.lparams(0, matchParent, 1f)
|
|
|
-
|
|
|
- relativeLayout {
|
|
|
+ }.lparams(autoSize(900), autoSize(340))
|
|
|
verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- val intent = Intent()
|
|
|
- intent.setClass(context, FinancialActivity::class.java)
|
|
|
- ActivityUtils.startActivity(intent)
|
|
|
- }
|
|
|
- imageView {
|
|
|
- imageResource = R.mipmap.main_business_6
|
|
|
- }.lparams(autoSize(72), autoSize(72)) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
- }
|
|
|
|
|
|
- textView {
|
|
|
- text = "财务审核"
|
|
|
- textColorInt = R.color.black
|
|
|
- textSizeAuto = 26
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- topMargin = autoSize(20)
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
- }
|
|
|
- }.lparams(matchParent, matchParent)
|
|
|
-
|
|
|
- textView {
|
|
|
- visibility = View.GONE
|
|
|
- viewModel.pendingAudit.bindOptional(context) {
|
|
|
- val pty = it?.businessfpqty?.toInt()
|
|
|
- ?.plus(it.businesskxqty.toInt())
|
|
|
- if (pty ?: 0 > 99){
|
|
|
- text = "99+"
|
|
|
- }else{
|
|
|
- text = pty.toString()
|
|
|
- }
|
|
|
- if (pty == 0) {
|
|
|
- visibility = View.GONE
|
|
|
- } else {
|
|
|
- visibility = View.VISIBLE
|
|
|
- }
|
|
|
- }
|
|
|
- textColorInt = R.color.p_global_write_color
|
|
|
- textSizeAuto = 15
|
|
|
- setPadding(
|
|
|
- autoSize(10),
|
|
|
- autoSize(6),
|
|
|
- autoSize(10),
|
|
|
- autoSize(6)
|
|
|
- )
|
|
|
- backgroundDrawable = createRoundRectDrawable("#fe671a", 45)
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(130)
|
|
|
- }
|
|
|
- }.lparams(0, matchParent, 1f)
|
|
|
-
|
|
|
- verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- val intent = Intent()
|
|
|
- intent.setClass(context, TradingQueryActivity::class.java)
|
|
|
- ActivityUtils.startActivity(intent)
|
|
|
- }
|
|
|
- imageView {
|
|
|
- imageResource = R.mipmap.main_business_7
|
|
|
- }.lparams(autoSize(72), autoSize(72)) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
- }
|
|
|
+ }.lparams(autoSize(900), autoSize(340))
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(340))
|
|
|
|
|
|
- textView {
|
|
|
- text = "交易查询"
|
|
|
- textColorInt = R.color.black
|
|
|
- textSizeAuto = 26
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
- topMargin = autoSize(20)
|
|
|
- }
|
|
|
- }.lparams(0, matchParent, 1f)
|
|
|
- verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- val intent = Intent()
|
|
|
- intent.setClass(context, ReportQueryActivity::class.java)
|
|
|
- ActivityUtils.startActivity(intent)
|
|
|
- }
|
|
|
- imageView {
|
|
|
- imageResource = R.mipmap.main_business_8
|
|
|
- }.lparams(autoSize(72), autoSize(72)) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
- }
|
|
|
|
|
|
- textView {
|
|
|
- text = "报表查询"
|
|
|
- textColorInt = R.color.black
|
|
|
- textSizeAuto = 26
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- gravity = Gravity.CENTER_HORIZONTAL
|
|
|
- topMargin = autoSize(20)
|
|
|
- }
|
|
|
- }.lparams(0, matchParent, 1f)
|
|
|
- }.lparams(matchParent, autoSize(140)) {
|
|
|
- topMargin = autoSize(20)
|
|
|
- }
|
|
|
|
|
|
view {
|
|
|
background = resources.getDrawable(R.color.main_hit_bg_color)
|