Commit 1813237e authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent fe10f7fb
......@@ -12,8 +12,8 @@ import com.yilan.sdk.ui.configs.YLUIConfig
*/
object YlVideoManager {
private const val ACCESSKEY = "ylxgszgwjrr8"
private const val ACCESSTOKEN = "lmnzhm9yjdlc86xiy74cjgixnqpxe4o2"
private const val ACCESSKEY = "yl1q5rcjsb05"
private const val ACCESSTOKEN = "9qitn62coocwcjjwhs95re24poaf9q7j"
fun init(application: Application) {
YLUIInit.getInstance()
......
......@@ -175,15 +175,15 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
}
fun selectBook() {
moneyFragment?.let {
(it as MoneyFragment).selectBook()
}
// moneyFragment?.let {
// (it as MoneyFragment).selectBook()
// }
}
fun selectXmly() {
moneyFragment?.let {
(it as MoneyFragment).selectXmly()
}
// moneyFragment?.let {
// (it as MoneyFragment).selectXmly()
// }
}
fun turnDayTask() {
......
......@@ -48,8 +48,6 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
if (AppConfig.showAdFlag) {
if (curPosition == 0) {
mainFragment?.onHiddenChanged(hidden)
} else if (curPosition == 4) {
liebaoGameFragment?.onHiddenChanged(hidden)
}
}
......@@ -75,16 +73,10 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
currentFragment = mainFragment
}
xtFragmentMoney.setxTabDisplayNum(3)
xtFragmentMoney.setxTabDisplayNum(1)
val newTab1 = xtFragmentMoney.newTab()
newTab1.text = "视频"
val newTab5 = xtFragmentMoney.newTab()
newTab5.text = "游戏"
val newTab6 = xtFragmentMoney.newTab()
newTab6.text = "来电秀"
xtFragmentMoney.addTab(newTab1)
xtFragmentMoney.addTab(newTab5)
xtFragmentMoney.addTab(newTab6)
xtFragmentMoney.addOnTabSelectedListener(this)
} else {
......@@ -137,19 +129,9 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
}
fun selectBook() {
xtFragmentMoney.getTabAt(1)?.select()
if (bookStoreFragment == null) {
bookStoreFragment = ReaderFragment()
}
addOrShowFragment(childFragmentManager, bookStoreFragment!!, FRAGMENT_TAG_BOOKSTORE)
}
fun selectXmly() {
xtFragmentMoney.getTabAt(2)?.select()
if (xmlyGameFragment == null) {
xmlyGameFragment = XmlyFragment()
}
addOrShowFragment(childFragmentManager, xmlyGameFragment!!, FRAGMENT_TAG_XMLY)
}
override fun onTabReselected(tab: XTabLayout.Tab) {
......@@ -174,18 +156,6 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
}
}
1 -> {
if (liebaoGameFragment == null) {
liebaoGameFragment = LiebaoGameFragment()
}
addOrShowFragment(childFragmentManager, liebaoGameFragment!!, FRAGMENT_TAG_GAME)
}
2 -> {
if (kuYinyueFragment == null) {
kuYinyueFragment = KuYinYueFragment()
}
addOrShowFragment(childFragmentManager, kuYinyueFragment!!, FRAGMENT_TAG_KYL)
}
}
curPosition = tab.position
}
......
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