- Remove the LiveData from transactions in BitsharesAccountManager

This commit is contained in:
Javier Varona 2017-10-22 21:00:51 -04:00
parent d3b7d7ce1c
commit efb6820b9e
2 changed files with 6 additions and 3 deletions

View file

@ -24,7 +24,10 @@ public interface TransactionDao {
LivePagedListProvider<Integer, CryptoCoinTransaction> transactionsByDate();
@Query("SELECT * FROM crypto_coin_transaction WHERE account_id = :idAccount ORDER BY date ASC")
LiveData<List<CryptoCoinTransaction>> getByIdAccount(long idAccount);
LiveData<List<CryptoCoinTransaction>> getByIdAccountLiveData(long idAccount);
@Query("SELECT * FROM crypto_coin_transaction WHERE account_id = :idAccount ORDER BY date ASC")
List<CryptoCoinTransaction> getByIdAccount(long idAccount);
@Insert(onConflict = OnConflictStrategy.REPLACE)
public long[] insertTransaction(CryptoCoinTransaction... transactions);

View file

@ -269,7 +269,7 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
public static void refreshAccountTransactions(long idAccount, Context context){
CrystalDatabase db = CrystalDatabase.getAppDatabase(context);
LiveData<List<CryptoCoinTransaction>> transactions = db.transactionDao().getByIdAccount(idAccount);
List<CryptoCoinTransaction> transactions = db.transactionDao().getByIdAccount(idAccount);
CryptoNetAccount account = db.cryptoNetAccountDao().getById(idAccount);
if(account.getCryptoNet() == CryptoNet.BITSHARES) {
@ -278,7 +278,7 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI
grapheneAccount.loadInfo(db.grapheneAccountInfoDao().getByAccountId(idAccount));
int start = transactions.getValue().size();
int start = transactions.size();
int limit = 50;
int stop = start + limit;