Commit f9017629 authored by mengcuiguang's avatar mengcuiguang

代码tab显示问题

parent 7406fb00
......@@ -252,6 +252,7 @@ dependencies {
implementation 'com.just.agentweb:agentweb:4.1.2'
// 喜马拉雅 已集成
// testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
......
......@@ -660,8 +660,8 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
readyGo(EraseActivity::class.java)
}
Constant.HOT_ACTIVITY_LIEBAO -> {
// readyGo(LiebaoGameActivity::class.java)
readyGo(XmlyActivity::class.java)
readyGo(LiebaoGameActivity::class.java)
// readyGo(XmlyActivity::class.java)
// readyGo(XmlyAwardActivity::class.java)
}
Constant.HOT_ACTIVITY_MORNINGCLOCK -> {
......
package com.mints.goodmoney.ui.fragment
import android.view.View
import androidx.fragment.app.Fragment
import androidx.viewpager.widget.ViewPager
import com.fly.scenemodule.util.GsonUtils
......@@ -53,11 +54,13 @@ class XmlyFragment : LazyLoadBaseFragment() {
}
private fun initViewAndData(categoryList: CategoryList?) {
// hideLoading()
categoryList?.let {
val tabs: MutableList<String> = ArrayList()
val fragments: MutableList<Fragment> = ArrayList()
var tempPageSize = 8
if (it.categories.size < 8) {
var tempPageSize = 18
if (it.categories.size < 18) {
tempPageSize = it.categories.size
}
......@@ -66,17 +69,20 @@ class XmlyFragment : LazyLoadBaseFragment() {
fragments.add(XmlyPageFragment(it.categories[i].id))
}
Timer().schedule(600){
hideLoading()
Timer().schedule(1000) {
activity?.runOnUiThread {
hideLoading()
xtFragmentXmly.visibility = View.VISIBLE
}
}
//去除两侧应阴影
xtFragmentXmly.overScrollMode = ViewPager.OVER_SCROLL_NEVER
vpFragmentXmly.offscreenPageLimit = tabs.size + 3
val adapter = MessageFragAdapter(childFragmentManager, fragments, tabs)
vpFragmentXmly.adapter = adapter
xtFragmentXmly.setxTabDisplayNum(tabs.size)
xtFragmentXmly.setupWithViewPager(vpFragmentXmly)
}
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@
<com.androidkun.xtablayout.XTabLayout
android:id="@+id/xtFragmentXmly"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:xTabIndicatorColor="#F28335"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment