Advertisement
Guest User

Untitled

a guest
May 8th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.75 KB | None | 0 0
  1. private fun countCarsFavorited(userEmail: String, listing_id: String): Disposable =
  2.         carsRepository.countCarsFavorited(userEmail)
  3.             .subscribeOn(backgroundScheduler)
  4.             .observeOn(mainScheduler)
  5.             .subscribe({ rowsCount ->
  6.                 Timber.d("Rows counted - $rowsCount")
  7.                 if (rowsCount == 3) {
  8.                     view.triggerRateAppDialog()
  9.                     wipeFavoritesTable()
  10.                 }
  11.             })
  12.  
  13.  
  14. override fun countCarsFavorited(userEmail: String): Flowable<Int> =
  15.         database.carsFavoritedDao().countCarsFavorited(userEmail)
  16.  
  17. @Query("SELECT COUNT(*) FROM $DB_CARS_FAVORITED WHERE user_email == :userEmail")
  18.     fun countCarsFavorited(userEmail: String): Flowable<Int>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement