| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -48,14 +48,19 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    override val binding by viewBinding(ActivityMainBinding::inflate) | 
					 | 
					 | 
					 | 
					    override val binding by viewBinding(ActivityMainBinding::inflate) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    override val viewModel by viewModels<MainViewModel>() | 
					 | 
					 | 
					 | 
					    override val viewModel by viewModels<MainViewModel>() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    private val idBookshelf = 0 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    private val idBookshelf1 = 11 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    private val idBookshelf2 = 12 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    private val idExplore = 1 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    private val idRss = 2 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    private val idMy = 3 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private var exitTime: Long = 0 | 
					 | 
					 | 
					 | 
					    private var exitTime: Long = 0 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private var bookshelfReselected: Long = 0 | 
					 | 
					 | 
					 | 
					    private var bookshelfReselected: Long = 0 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private var exploreReselected: Long = 0 | 
					 | 
					 | 
					 | 
					    private var exploreReselected: Long = 0 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private var pagePosition = 0 | 
					 | 
					 | 
					 | 
					    private var pagePosition = 0 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private val fragmentMap = hashMapOf<Int, Fragment>() | 
					 | 
					 | 
					 | 
					    private val fragmentMap = hashMapOf<Int, Fragment>() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private var bottomMenuCount = 4 | 
					 | 
					 | 
					 | 
					    private var bottomMenuCount = 4 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private val realPositions = | 
					 | 
					 | 
					 | 
					    private val realPositions = arrayOf(idBookshelf, idExplore, idRss, idMy) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        arrayOf(BaseBookshelfFragment.id, ExploreFragment.id, RssFragment.id, MyFragment.id) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    override fun onActivityCreated(savedInstanceState: Bundle?) { | 
					 | 
					 | 
					 | 
					    override fun onActivityCreated(savedInstanceState: Bundle?) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        upBottomMenu() | 
					 | 
					 | 
					 | 
					        upBottomMenu() | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -88,8 +93,8 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        when (item.itemId) { | 
					 | 
					 | 
					 | 
					        when (item.itemId) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            R.id.menu_bookshelf -> viewPagerMain.setCurrentItem(0, false) | 
					 | 
					 | 
					 | 
					            R.id.menu_bookshelf -> viewPagerMain.setCurrentItem(0, false) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            R.id.menu_discovery -> viewPagerMain.setCurrentItem(1, false) | 
					 | 
					 | 
					 | 
					            R.id.menu_discovery -> viewPagerMain.setCurrentItem(1, false) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            R.id.menu_rss -> openPage(RssFragment.id) | 
					 | 
					 | 
					 | 
					            R.id.menu_rss -> openPage(idRss) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            R.id.menu_my_config -> openPage(MyFragment.id) | 
					 | 
					 | 
					 | 
					            R.id.menu_my_config -> openPage(idMy) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return false | 
					 | 
					 | 
					 | 
					        return false | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -204,21 +209,21 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        bottomMenuCount = 1 | 
					 | 
					 | 
					 | 
					        bottomMenuCount = 1 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (showDiscovery) { | 
					 | 
					 | 
					 | 
					        if (showDiscovery) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            realPositions[bottomMenuCount] = ExploreFragment.id | 
					 | 
					 | 
					 | 
					            realPositions[bottomMenuCount] = idExplore | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            bottomMenuCount++ | 
					 | 
					 | 
					 | 
					            bottomMenuCount++ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (showRss) { | 
					 | 
					 | 
					 | 
					        if (showRss) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            realPositions[bottomMenuCount] = RssFragment.id | 
					 | 
					 | 
					 | 
					            realPositions[bottomMenuCount] = idRss | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            bottomMenuCount++ | 
					 | 
					 | 
					 | 
					            bottomMenuCount++ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        realPositions[bottomMenuCount] = MyFragment.id | 
					 | 
					 | 
					 | 
					        realPositions[bottomMenuCount] = idMy | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        bottomMenuCount++ | 
					 | 
					 | 
					 | 
					        bottomMenuCount++ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private fun getFragmentId(position: Int): Int { | 
					 | 
					 | 
					 | 
					    private fun getFragmentId(position: Int): Int { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        val id = realPositions[position] | 
					 | 
					 | 
					 | 
					        val id = realPositions[position] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (id == BaseBookshelfFragment.id) { | 
					 | 
					 | 
					 | 
					        if (id == idBookshelf) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            return if (AppConfig.bookGroupStyle == 1) BookshelfFragment2.id else BookshelfFragment1.id | 
					 | 
					 | 
					 | 
					            return if (AppConfig.bookGroupStyle == 1) idBookshelf2 else idBookshelf1 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return id | 
					 | 
					 | 
					 | 
					        return id | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -247,10 +252,10 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        override fun getItem(position: Int): Fragment { | 
					 | 
					 | 
					 | 
					        override fun getItem(position: Int): Fragment { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            return when (getId(position)) { | 
					 | 
					 | 
					 | 
					            return when (getId(position)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                BookshelfFragment1.id -> BookshelfFragment1() | 
					 | 
					 | 
					 | 
					                idBookshelf1 -> BookshelfFragment1() | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                BookshelfFragment2.id -> BookshelfFragment2() | 
					 | 
					 | 
					 | 
					                idBookshelf2 -> BookshelfFragment2() | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                ExploreFragment.id -> ExploreFragment() | 
					 | 
					 | 
					 | 
					                idExplore -> ExploreFragment() | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                RssFragment.id -> RssFragment() | 
					 | 
					 | 
					 | 
					                idRss -> RssFragment() | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                else -> MyFragment() | 
					 | 
					 | 
					 | 
					                else -> MyFragment() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |