forked from GitHub-Mirror/riotX-android
Fix some stupid issues
This commit is contained in:
@ -19,7 +19,7 @@ class Matrix(matrixOptions: MatrixOptions) : KoinComponent {
|
||||
private val authenticator by inject<Authenticator>()
|
||||
private val backgroundDetectionObserver by inject<BackgroundDetectionObserver>()
|
||||
|
||||
var currentSession: Session? = null
|
||||
lateinit var currentSession: Session
|
||||
|
||||
init {
|
||||
Monarchy.init(matrixOptions.context)
|
||||
@ -28,6 +28,11 @@ class Matrix(matrixOptions: MatrixOptions) : KoinComponent {
|
||||
val authModule = AuthModule()
|
||||
loadKoinModules(listOf(matrixModule, networkModule, authModule))
|
||||
ProcessLifecycleOwner.get().lifecycle.addObserver(backgroundDetectionObserver)
|
||||
val lastActiveSession = authenticator.getLastActiveSession()
|
||||
if (lastActiveSession != null) {
|
||||
currentSession = lastActiveSession
|
||||
currentSession.open()
|
||||
}
|
||||
}
|
||||
|
||||
fun authenticator(): Authenticator {
|
||||
|
@ -54,6 +54,7 @@ class DefaultTimelineHolder(private val roomId: String,
|
||||
val pagedListConfig = PagedList.Config.Builder()
|
||||
.setEnablePlaceholders(false)
|
||||
.setPageSize(PAGE_SIZE)
|
||||
.setInitialLoadSizeHint(PAGE_SIZE)
|
||||
.setPrefetchDistance(10)
|
||||
.build()
|
||||
|
||||
|
Reference in New Issue
Block a user