Improve query to obtain user balances to avoid showing assets with a balance equal to zero.

This commit is contained in:
Severiano Jaramillo 2019-01-03 17:11:58 -06:00
parent 2db74516bb
commit 10014263d7
2 changed files with 2 additions and 2 deletions

View file

@ -7,6 +7,6 @@ import androidx.room.Query
@Dao @Dao
interface BalanceDetailDao { interface BalanceDetailDao {
@Query("SELECT assets.id AS id, balances.asset_amount AS amount, assets.precision, assets.symbol " + @Query("SELECT assets.id AS id, balances.asset_amount AS amount, assets.precision, assets.symbol " +
"FROM balances INNER JOIN assets on balances.asset_id = assets.id") "FROM balances INNER JOIN assets on balances.asset_id = assets.id WHERE balances.asset_amount > 0")
fun getAll(): LiveData<List<BalanceDetail>> fun getAll(): LiveData<List<BalanceDetail>>
} }

View file

@ -68,7 +68,7 @@ class HomeFragment : Fragment() {
// Navigate to the Send Transaction Fragment using Navigation's SafeArgs to activate the camera // Navigate to the Send Transaction Fragment using Navigation's SafeArgs to activate the camera
fabSendTransactionCamera.setOnClickListener { fabSendTransactionCamera.setOnClickListener {
val action = HomeFragmentDirections.sendActionCamera() val action = HomeFragmentDirections.sendActionCamera()
action.setOpenCamera(true) action.openCamera = true
findNavController().navigate(action) findNavController().navigate(action)
} }