Commit 59fb3492 authored by mengcuiguang's avatar mengcuiguang

代码优化

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