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

master
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
interface BalanceDetailDao {
@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>>
}

View File

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