move syncmanager to conversationviewmodel using DI, use swipe to refresh instead of menu for syncing conversations

This commit is contained in:
Moez Bhatti
2017-08-28 13:18:36 -07:00
parent 79ec62324e
commit 7996048658
9 changed files with 37 additions and 58 deletions
@@ -10,10 +10,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import io.realm.Realm
internal object SyncManager {
class SyncManager(val context: Context) {
private val TAG = "SyncManager"
fun copyToRealm(context: Context, completionListener: () -> Unit) {
fun copyToRealm(completionListener: () -> Unit) {
val contentResolver = context.contentResolver
val conversationsCursor = contentResolver.query(ConversationColumns.URI, ConversationColumns.PROJECTION, null, null, "date desc")