1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-10 04:52:38 +01:00

Set page limit based on tab count

This commit is contained in:
Allan Wang 2019-03-07 18:18:10 -05:00
parent adf9f2f6f2
commit 7b5df27ea3
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56

View File

@ -71,7 +71,6 @@ import com.pitchedapps.frost.contracts.MainActivityContract
import com.pitchedapps.frost.contracts.VideoViewHolder
import com.pitchedapps.frost.db.CookieDao
import com.pitchedapps.frost.db.FbTabDao
import com.pitchedapps.frost.db.TAB_COUNT
import com.pitchedapps.frost.db.currentCookie
import com.pitchedapps.frost.db.selectAll
import com.pitchedapps.frost.enums.MainActivityLayout
@ -162,12 +161,13 @@ abstract class BaseMainActivity : BaseActivity(), MainActivityContract,
}
setSupportActionBar(toolbar)
viewPager.adapter = adapter
viewPager.offscreenPageLimit = TAB_COUNT
tabs.setBackgroundColor(Prefs.mainActivityLayout.backgroundColor())
onNestedCreate(savedInstanceState)
L.i { "Main finished loading UI in ${System.currentTimeMillis() - start} ms" }
launch {
adapter.setPages(tabDao.selectAll())
val tabs = tabDao.selectAll()
adapter.setPages(tabs)
viewPager.offscreenPageLimit = tabs.size
}
controlWebview = WebView(this)
if (BuildConfig.VERSION_CODE > Prefs.versionCode) {