-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2271 from PratyushSingh07/notification-coroutineImp
feat: implemented coroutines in notification viewmodel
- Loading branch information
Showing
9 changed files
with
96 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 0 additions & 57 deletions
57
app/src/main/java/org/mifos/mobile/presenters/NotificationPresenter.kt
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
app/src/main/java/org/mifos/mobile/repositories/NotificationRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package org.mifos.mobile.repositories | ||
|
||
import io.reactivex.Observable | ||
import kotlinx.coroutines.flow.Flow | ||
import org.mifos.mobile.models.notification.MifosNotification | ||
|
||
interface NotificationRepository { | ||
|
||
fun loadNotifications(): Observable<List<MifosNotification?>?> | ||
suspend fun loadNotifications(): Flow<List<MifosNotification?>?> | ||
} |
9 changes: 5 additions & 4 deletions
9
app/src/main/java/org/mifos/mobile/repositories/NotificationRepositoryImp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
package org.mifos.mobile.repositories | ||
|
||
import io.reactivex.Observable | ||
import kotlinx.coroutines.flow.Flow | ||
import org.mifos.mobile.api.DataManager | ||
import org.mifos.mobile.models.notification.MifosNotification | ||
import javax.inject.Inject | ||
|
||
class NotificationRepositoryImp @Inject constructor(private val dataManager: DataManager) : NotificationRepository { | ||
class NotificationRepositoryImp @Inject constructor(private val dataManager: DataManager) : | ||
NotificationRepository { | ||
|
||
override fun loadNotifications(): Observable<List<MifosNotification?>?> { | ||
return dataManager.notifications | ||
override suspend fun loadNotifications(): Flow<List<MifosNotification?>?> { | ||
return dataManager.notifications() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 0 additions & 72 deletions
72
app/src/test/java/org/mifos/mobile/NotificationPresenterTest.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.