Commit 59fb3492 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 970fe8f0
......@@ -47,19 +47,20 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override fun initViewsAndEvents() {
// ZhangyueManager.onCreateIreader(baseApplication)
showShortVedioLayout()
// showShortVedioLayout()
AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_FIVE
if (moneyFragment == null) {
moneyFragment = MoneyFragment()
if (myFragment == null) {
myFragment = MyFragment()
}
if (!moneyFragment!!.isAdded) {
if (!myFragment!!.isAdded) {
// 提交事务
supportFragmentManager.beginTransaction()
.add(R.id.content_layout, moneyFragment!!).commitAllowingStateLoss()
.add(R.id.content_layout, myFragment!!).commitAllowingStateLoss()
// 记录当前Fragment
currentFragment = moneyFragment
currentFragment = myFragment
}
if (AppConfig.isMainShowWz) {
......@@ -72,8 +73,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
isMainShowWz = false
}
tab_iv_one.isSelected = true
tab_tv_one.isSelected = true
tab_iv_five.isSelected = true
tab_tv_five.isSelected = true
tab_rl_one.setOnClickListener(this)
tab_rl_three.setOnClickListener(this)
......
......@@ -8,6 +8,6 @@
<item android:bottom="20dp">
<bitmap
android:gravity="bottom|center_horizontal"
android:src="@drawable/bg_splash" />
android:src="@drawable/ic_launcher_main" />
</item>
</layer-list>
......@@ -27,6 +27,7 @@
android:orientation="horizontal">
<LinearLayout
android:visibility="gone"
android:id="@+id/tab_rl_one"
android:layout_width="0dp"
android:layout_height="match_parent"
......@@ -50,6 +51,7 @@
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="@+id/tab_rl_two"
android:layout_width="0dp"
android:layout_height="match_parent"
......
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