|
|
@@ -62,7 +62,7 @@ import org.jetbrains.anko.support.v4.viewPager
|
|
|
/**
|
|
|
* 云融大宗的首页
|
|
|
*/
|
|
|
-class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
|
|
|
+class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>() {
|
|
|
|
|
|
companion object {
|
|
|
fun newInstance() = YrdzHomeFragment()
|
|
|
@@ -76,9 +76,13 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
|
|
|
lateinit var segment1: QMUITabSegment
|
|
|
var selectedTabIndex: Int = 0
|
|
|
private lateinit var viewPager: ViewPager
|
|
|
- lateinit var noticeViewFlipper : ViewFlipper
|
|
|
+ lateinit var noticeViewFlipper: ViewFlipper
|
|
|
|
|
|
- private val yrdzIndexUI : YrdzIndexUI by lazy { YrdzIndexUI(this,viewModel) }
|
|
|
+ //分类
|
|
|
+ private val classificationUI: ClassificationUI by lazy { ClassificationUI(this, viewModel) }
|
|
|
+
|
|
|
+ //指数
|
|
|
+ private val yrdzIndexUI: YrdzIndexUI by lazy { YrdzIndexUI(this, viewModel) }
|
|
|
|
|
|
private val yrAnnouncementUI: YrAnnouncementUI by lazy {
|
|
|
YrAnnouncementUI(
|
|
|
@@ -101,27 +105,27 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
|
|
|
}//消息
|
|
|
|
|
|
|
|
|
-
|
|
|
//viewpager的适配器
|
|
|
- private var pagerAdapter : PagerAdapter? = null
|
|
|
+ private var pagerAdapter: PagerAdapter? = null
|
|
|
|
|
|
//tabSegment标题
|
|
|
- private val tabsArray : ArrayList<String> = arrayListOf()
|
|
|
+ private val tabsArray: ArrayList<String> = arrayListOf()
|
|
|
|
|
|
//暂存的页面组
|
|
|
- private val uiMessageList : ArrayList<_FrameLayout> = arrayListOf()
|
|
|
-
|
|
|
+ private val uiMessageList: ArrayList<_FrameLayout> = arrayListOf()
|
|
|
|
|
|
|
|
|
- fun initMessageMenuData(){
|
|
|
+ fun initMessageMenuData() {
|
|
|
tabsArray.add("资讯")
|
|
|
uiMessageList.add(yrdzInformationUI.root)
|
|
|
tabsArray.add("公告")
|
|
|
uiMessageList.add(yrAnnouncementUI.root)
|
|
|
tabsArray.add("消息")
|
|
|
uiMessageList.add(yrMessageUI.root)
|
|
|
- tabsArray.add("消息")
|
|
|
+ tabsArray.add("指数")
|
|
|
uiMessageList.add(yrdzIndexUI.root)
|
|
|
+ tabsArray.add("分类")
|
|
|
+ uiMessageList.add(classificationUI.root)
|
|
|
|
|
|
pagerAdapter = object : PagerAdapter() {
|
|
|
|
|
|
@@ -165,7 +169,7 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
|
|
|
view.textSize = 12f
|
|
|
view.setOnClickListener(View.OnClickListener {
|
|
|
val intent = Intent()
|
|
|
- intent.putExtra("data",notice.get(i))
|
|
|
+ intent.putExtra("data", notice.get(i))
|
|
|
intent.setClass(context!!, MessageDetailsActivity::class.java)
|
|
|
ActivityUtils.startActivity(intent)
|
|
|
})
|
|
|
@@ -197,7 +201,7 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
|
|
|
linearLayout {
|
|
|
background = resources.getDrawable(R.color.main_title_bg_color)
|
|
|
verticalLayout {
|
|
|
- gravity = Gravity.CENTER
|
|
|
+ gravity = Gravity.CENTER
|
|
|
textView {
|
|
|
text = "云融"
|
|
|
textColorInt = R.color.white
|
|
|
@@ -225,45 +229,25 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
|
|
|
|
|
|
}.lparams(matchParent, autoSize(120))
|
|
|
|
|
|
- relativeLayout {
|
|
|
- nestedScrollView{
|
|
|
- setOnScrollChangeListener(object : View.OnScrollChangeListener {
|
|
|
- override fun onScrollChange(
|
|
|
- p0: View?,
|
|
|
- p1: Int,
|
|
|
- p2: Int,
|
|
|
- p3: Int,
|
|
|
- p4: Int
|
|
|
- ) {
|
|
|
- val scrollRect = Rect()
|
|
|
- getHitRect(scrollRect)
|
|
|
- LogUtils.eTag("adakhsfkjahsfa", "x = " + p1 + "y = " + p2)
|
|
|
- if (p2 > 1000) {
|
|
|
- segment1.visibility = View.VISIBLE
|
|
|
- } else {
|
|
|
- segment1.visibility = View.INVISIBLE
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- verticalLayout {
|
|
|
- background = resources.getDrawable(R.color.white)
|
|
|
- inflateLayout<BGABanner>(R.layout.banner) {
|
|
|
- // TODO 目前没有banner
|
|
|
- viewModel.bannerList.bindOptional(context) {
|
|
|
- setData(
|
|
|
- R.layout.item_fresco,
|
|
|
- it,
|
|
|
- null
|
|
|
- )
|
|
|
- }
|
|
|
- setDelegate { banner, itemView, model, position ->
|
|
|
- val data = model as BannerData
|
|
|
- val intent = Intent()
|
|
|
- intent.putExtra("url",data.url)
|
|
|
- intent.putExtra("title",data.title)
|
|
|
- intent.setClass(context, WebActivity::class.java)
|
|
|
- ActivityUtils.startActivity(intent)
|
|
|
- }
|
|
|
+ verticalLayout {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ inflateLayout<BGABanner>(R.layout.banner) {
|
|
|
+ // TODO 目前没有banner
|
|
|
+ viewModel.bannerList.bindOptional(context) {
|
|
|
+ setData(
|
|
|
+ R.layout.item_fresco,
|
|
|
+ it,
|
|
|
+ null
|
|
|
+ )
|
|
|
+ }
|
|
|
+ setDelegate { banner, itemView, model, position ->
|
|
|
+ val data = model as BannerData
|
|
|
+ val intent = Intent()
|
|
|
+ intent.putExtra("url", data.url)
|
|
|
+ intent.putExtra("title", data.title)
|
|
|
+ intent.setClass(context, WebActivity::class.java)
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
// setDelegate(new BGABanner.Delegate() {
|
|
|
// @Override
|
|
|
// public void onBannerItemClick(BGABanner banner, View itemView, @Nullable Object model, int position) {
|
|
|
@@ -272,271 +256,230 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
|
|
|
// });
|
|
|
|
|
|
|
|
|
- setAdapter(object : BGABanner.Adapter<CardView, BannerData> {
|
|
|
- override fun fillBannerItem(
|
|
|
- banner: BGABanner?,
|
|
|
- itemView: CardView?,
|
|
|
- model: BannerData?,
|
|
|
- position: Int
|
|
|
- ) {
|
|
|
- val simpleDraweeView: SimpleDraweeView =
|
|
|
- itemView!!.findViewById(R.id.sdv_item_fresco_content)
|
|
|
- simpleDraweeView.setImageURI(
|
|
|
- Uri.parse(
|
|
|
- SPUtils.getInstance().getString(
|
|
|
- Constant.openApiUrl) + model?.imagepath?.substring(1)))
|
|
|
- }
|
|
|
- })
|
|
|
+ setAdapter(object : BGABanner.Adapter<CardView, BannerData> {
|
|
|
+ override fun fillBannerItem(
|
|
|
+ banner: BGABanner?,
|
|
|
+ itemView: CardView?,
|
|
|
+ model: BannerData?,
|
|
|
+ position: Int
|
|
|
+ ) {
|
|
|
+ val simpleDraweeView: SimpleDraweeView =
|
|
|
+ itemView!!.findViewById(R.id.sdv_item_fresco_content)
|
|
|
+ simpleDraweeView.setImageURI(
|
|
|
+ Uri.parse(
|
|
|
+ SPUtils.getInstance().getString(
|
|
|
+ Constant.openApiUrl
|
|
|
+ ) + model?.imagepath?.substring(1)
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }.lparams(matchParent, autoSize(400))
|
|
|
+
|
|
|
+ itemView()
|
|
|
+
|
|
|
+ linearLayout {
|
|
|
+ visibility = View.GONE
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.yrdz_nctice_icon
|
|
|
+ }.lparams(autoSize(36), autoSize(36)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ viewFlipper {
|
|
|
+ noticeViewFlipper = this
|
|
|
+ viewModel.noticeDataList.bindOptional(context) {
|
|
|
+ initViewFlipper(it ?: arrayListOf())
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(72)) {
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
+
|
|
|
+ }.lparams(matchParent, autoSize(72))
|
|
|
+
|
|
|
+ itemView()
|
|
|
|
|
|
- }.lparams(matchParent, autoSize(400))
|
|
|
+ linearLayout {
|
|
|
+ //参考行情
|
|
|
+ relativeLayout {
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ ReferenceActivity::class.java
|
|
|
+ )
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.yrdz_reference_prices
|
|
|
+ }.lparams(autoSize(72), autoSize(72)) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
|
|
|
- itemView()
|
|
|
+ textView {
|
|
|
+ text = "参考行情"
|
|
|
+ textColorInt = R.color.black
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
|
|
|
- linearLayout {
|
|
|
+ textView {
|
|
|
visibility = View.GONE
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
+ 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(autoSize(225), matchParent)
|
|
|
+
|
|
|
+ relativeLayout {
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ EventBus.getDefault()
|
|
|
+ .post(MainTabSelectMessageEvent(1))// 黄老板说的要跳去仓单贸易
|
|
|
+ }
|
|
|
imageView {
|
|
|
- imageResource = R.mipmap.yrdz_nctice_icon
|
|
|
- }.lparams(autoSize(36), autoSize(36)){
|
|
|
- marginStart = autoSize(36)
|
|
|
+ imageResource = R.mipmap.yrdz_home_wymh_icon
|
|
|
+ }.lparams(autoSize(72), autoSize(72)) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
}
|
|
|
|
|
|
- viewFlipper {
|
|
|
- noticeViewFlipper = this
|
|
|
- viewModel.noticeDataList.bindOptional(context){
|
|
|
- initViewFlipper(it ?: arrayListOf())
|
|
|
- }
|
|
|
- }.lparams(matchParent, autoSize(72)){
|
|
|
- marginStart = autoSize(36)
|
|
|
+ textView {
|
|
|
+ text = "我要买货"
|
|
|
+ textColorInt = R.color.black
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
}
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
|
|
|
- }.lparams(matchParent, autoSize(72))
|
|
|
-
|
|
|
- itemView()
|
|
|
-
|
|
|
- linearLayout {
|
|
|
- //参考行情
|
|
|
- relativeLayout {
|
|
|
- verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- val intent = Intent()
|
|
|
- intent.setClass(
|
|
|
- context,
|
|
|
- ReferenceActivity::class.java
|
|
|
- )
|
|
|
- ActivityUtils.startActivity(intent)
|
|
|
- }
|
|
|
- imageView {
|
|
|
- imageResource = R.mipmap.yrdz_reference_prices
|
|
|
- }.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
|
|
|
- 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(autoSize(225), matchParent)
|
|
|
-
|
|
|
- relativeLayout {
|
|
|
- verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- EventBus.getDefault().post(MainTabSelectMessageEvent(1))// 黄老板说的要跳去仓单贸易
|
|
|
- }
|
|
|
- imageView {
|
|
|
- imageResource = R.mipmap.yrdz_home_wymh_icon
|
|
|
- }.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
|
|
|
- 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(autoSize(225), matchParent)
|
|
|
-
|
|
|
- relativeLayout {
|
|
|
- verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- val intent = Intent()
|
|
|
- intent.setClass(
|
|
|
- context,
|
|
|
- BookingWarehouseActivity::class.java
|
|
|
- )
|
|
|
- ActivityUtils.startActivity(intent)
|
|
|
- }
|
|
|
- imageView {
|
|
|
- imageResource = R.mipmap.yrdz_home_wyys_icon
|
|
|
- }.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
|
|
|
- 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(autoSize(225), matchParent)
|
|
|
-
|
|
|
- relativeLayout {
|
|
|
- verticalLayout {
|
|
|
- onThrottleFirstClick {
|
|
|
- val intent = Intent()
|
|
|
- intent.setClass(
|
|
|
- context,
|
|
|
- PerformanceInformationActivity::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
|
|
|
- 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(autoSize(225), matchParent)
|
|
|
-
|
|
|
- }.lparams(matchParent, autoSize(140)) {
|
|
|
- topMargin = autoSize(40)
|
|
|
+ textView {
|
|
|
+ visibility = View.GONE
|
|
|
+ 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(autoSize(225), matchParent)
|
|
|
|
|
|
- tabSegment {
|
|
|
- segment = this
|
|
|
- background = resources.getDrawable(R.color.white)
|
|
|
- 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
|
|
|
- }
|
|
|
- })
|
|
|
- mode = QMUITabSegment.MODE_FIXED
|
|
|
- setIndicator(
|
|
|
- QMUITabIndicator(
|
|
|
- QMUIDisplayHelper.dp2px(context, 2),
|
|
|
- false,
|
|
|
- true
|
|
|
+ relativeLayout {
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ BookingWarehouseActivity::class.java
|
|
|
)
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.yrdz_home_wyys_icon
|
|
|
+ }.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
|
|
|
+ textColorInt = R.color.p_global_write_color
|
|
|
+ textSizeAuto = 15
|
|
|
+ setPadding(
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6),
|
|
|
+ autoSize(10),
|
|
|
+ autoSize(6)
|
|
|
)
|
|
|
- setDefaultTextSize(
|
|
|
- ConvertUtils.sp2px(16f),
|
|
|
- ConvertUtils.sp2px(18f)
|
|
|
- )
|
|
|
+ backgroundDrawable =
|
|
|
+ createRoundRectDrawable("#fe671a", 45)
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(130)
|
|
|
+ }
|
|
|
+ }.lparams(autoSize(225), matchParent)
|
|
|
+
|
|
|
+ relativeLayout {
|
|
|
+ verticalLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ val intent = Intent()
|
|
|
+ intent.setClass(
|
|
|
+ context,
|
|
|
+ PerformanceInformationActivity::class.java
|
|
|
+ )
|
|
|
+ ActivityUtils.startActivity(intent)
|
|
|
+ }
|
|
|
+ imageView {
|
|
|
+ imageResource = R.mipmap.main_business_5
|
|
|
+ }.lparams(autoSize(72), autoSize(72)) {
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
|
|
|
- }.lparams(matchParent, autoSize(100))
|
|
|
+ textView {
|
|
|
+ text = "履约管理"
|
|
|
+ textColorInt = R.color.black
|
|
|
+ textSizeAuto = 26
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ gravity = Gravity.CENTER_HORIZONTAL
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
|
|
|
- view {
|
|
|
- background = resources.getDrawable(R.color.main_hit_bg_color)
|
|
|
- }.lparams(matchParent, autoSize(1)) {
|
|
|
- marginStart = autoSize(32)
|
|
|
- marginEnd = autoSize(32)
|
|
|
+ textView {
|
|
|
+ visibility = View.GONE
|
|
|
+ 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)
|
|
|
}
|
|
|
- viewPager {
|
|
|
- background = resources.getDrawable(R.color.white)
|
|
|
- viewPager = this
|
|
|
- adapter = pagerAdapter
|
|
|
- }.lparams(matchParent, autoSize(800))
|
|
|
-
|
|
|
- segment.setupWithViewPager(viewPager)
|
|
|
- segment.selectTab(selectedTabIndex)
|
|
|
- }
|
|
|
- }.lparams(matchParent, matchParent)
|
|
|
+ }.lparams(autoSize(225), matchParent)
|
|
|
+
|
|
|
+ }.lparams(matchParent, autoSize(140)) {
|
|
|
+ topMargin = autoSize(40)
|
|
|
+ }
|
|
|
|
|
|
tabSegment {
|
|
|
- visibility = View.GONE
|
|
|
- segment1 = this
|
|
|
- visibility = View.INVISIBLE
|
|
|
+ segment = this
|
|
|
background = resources.getDrawable(R.color.white)
|
|
|
- addOnTabSelectedListener(object : QMUITabSegment.OnTabSelectedListener {
|
|
|
+ addOnTabSelectedListener(object :
|
|
|
+ QMUITabSegment.OnTabSelectedListener {
|
|
|
override fun onDoubleTap(index: Int) {}
|
|
|
override fun onTabReselected(index: Int) {}
|
|
|
override fun onTabUnselected(index: Int) {}
|
|
|
@@ -544,6 +487,7 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
|
|
|
selectedTabIndex = index
|
|
|
}
|
|
|
})
|
|
|
+ mode = QMUITabSegment.MODE_FIXED
|
|
|
setIndicator(
|
|
|
QMUITabIndicator(
|
|
|
QMUIDisplayHelper.dp2px(context, 2),
|
|
|
@@ -551,16 +495,29 @@ class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
|
|
|
true
|
|
|
)
|
|
|
)
|
|
|
- setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
|
|
|
-// setHasIndicator(true)
|
|
|
-// setDefaultNormalColor(Color.parseColor("#000000"))
|
|
|
-// setDefaultSelectedColor(Color.parseColor("#60a1e3"))
|
|
|
-// setTabTextSize(ConvertUtils.sp2px(16f))
|
|
|
+ setDefaultTextSize(
|
|
|
+ ConvertUtils.sp2px(16f),
|
|
|
+ ConvertUtils.sp2px(18f)
|
|
|
+ )
|
|
|
+
|
|
|
}.lparams(matchParent, autoSize(100))
|
|
|
|
|
|
- segment1.setupWithViewPager(viewPager)
|
|
|
- segment1.selectTab(selectedTabIndex)
|
|
|
+ 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 = pagerAdapter
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ segment.setupWithViewPager(viewPager)
|
|
|
+ segment.selectTab(selectedTabIndex)
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}.view
|
|
|
}
|