forked from GitHub-Mirror/riotX-android
Clean some files
This commit is contained in:
@ -13,9 +13,4 @@ interface Session : RoomService {
|
||||
@MainThread
|
||||
fun close()
|
||||
|
||||
fun syncThread(): SyncThread
|
||||
|
||||
// Visible for testing request directly. Will be deleted
|
||||
fun realmHolder(): SessionRealmHolder
|
||||
|
||||
}
|
@ -4,4 +4,6 @@ interface Room {
|
||||
|
||||
val roomId: String
|
||||
|
||||
|
||||
|
||||
}
|
@ -8,6 +8,6 @@ interface RoomService {
|
||||
|
||||
fun getAllRooms(): List<Room>
|
||||
|
||||
fun observeAllRooms(): LiveData<List<Room>>
|
||||
fun rooms(): LiveData<List<Room>>
|
||||
|
||||
}
|
@ -47,15 +47,6 @@ class DefaultSession(private val sessionParams: SessionParams
|
||||
syncThread.start()
|
||||
}
|
||||
|
||||
override fun realmHolder(): SessionRealmHolder {
|
||||
assert(isOpen)
|
||||
return realmInstanceHolder
|
||||
}
|
||||
|
||||
override fun syncThread(): SyncThread {
|
||||
assert(isOpen)
|
||||
return syncThread
|
||||
}
|
||||
|
||||
@MainThread
|
||||
override fun close() {
|
||||
@ -78,8 +69,8 @@ class DefaultSession(private val sessionParams: SessionParams
|
||||
return roomService.getAllRooms()
|
||||
}
|
||||
|
||||
override fun observeAllRooms(): LiveData<List<Room>> {
|
||||
return roomService.observeAllRooms()
|
||||
override fun rooms(): LiveData<List<Room>> {
|
||||
return roomService.rooms()
|
||||
}
|
||||
|
||||
// Private methods *****************************************************************************
|
||||
|
@ -29,7 +29,7 @@ class DefaultRoomService(private val realmConfiguration: RealmConfiguration,
|
||||
return room
|
||||
}
|
||||
|
||||
override fun observeAllRooms(): LiveData<List<Room>> {
|
||||
override fun rooms(): LiveData<List<Room>> {
|
||||
val roomResults = RoomEntity.getAll(mainThreadRealm.instance).findAllAsync()
|
||||
return RealmLiveData(roomResults) { DefaultRoom(it.roomId) }
|
||||
}
|
||||
|
Reference in New Issue
Block a user