Skip to content
This repository has been archived by the owner on Dec 20, 2017. It is now read-only.

Commit

Permalink
Update historical transaction order
Browse files Browse the repository at this point in the history
  • Loading branch information
computationalcore committed Jul 15, 2017
1 parent af48c00 commit 92a8a41
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ private View renderDetails(HistoricalTransferEntry historicalTransfer) {
//accountMessage.setSpan(new StyleSpan(Typeface.BOLD), accountMessageText.length(), accountMessageText.length() + accountNameText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
TextView accountName = (TextView) v.findViewById(R.id.transaction_account);
accountName.setText(accountMessage);
Log.d(TAG,"accountMessage: " + accountMessage);

//Setup Memo
Log.d(TAG,"memo: " + operation.getMemo().getPlaintextMessage());
TextView memoTextView = (TextView) v.findViewById(R.id.memo);
if (!operation.getMemo().getPlaintextMessage().equals("")) {
memoTextView.setText(operation.getMemo().getPlaintextMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ public List<HistoricalTransferEntry> getTransactions(UserAccount userAccount, in
/*if (userMap.get(fromId) == null || userMap.get(toId) == null) {
cursor.moveToNext();
continue;
}
}*/

// Skipping transfer if we are missing timestamp information
long t = cursor.getLong(cursor.getColumnIndex(SCWallDatabaseContract.Transfers.COLUMN_TIMESTAMP));
if (t == 0) {
cursor.moveToNext();
continue;
}*/
}

// Building UserAccount instances
UserAccount from = new UserAccount(fromId, userMap.get(fromId));
Expand Down Expand Up @@ -206,6 +206,11 @@ public List<HistoricalTransferEntry> getTransactions(UserAccount userAccount, in
// Adding equivalent value data
String id = cursor.getString(cursor.getColumnIndex(SCWallDatabaseContract.Transfers.COLUMN_EQUIVALENT_VALUE_ASSET_ID));
long equivalentValue = cursor.getLong(cursor.getColumnIndex(SCWallDatabaseContract.Transfers.COLUMN_EQUIVALENT_VALUE));
// Skipping transfer if we are missing equivalent value
if (equivalentValue == 0) {
cursor.moveToNext();
continue;
}
if (id != null) {
Log.v(TAG, String.format("Eq value asset id: %s, value: %d", id, equivalentValue));
String table = SCWallDatabaseContract.Assets.TABLE_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public class BalancesFragment extends Fragment implements AssetDelegate, ISound,
public final String TAG = this.getClass().getName();
// Debug flags
private final boolean DEBUG_DATE_LOADING = false;
private final boolean DEBUG_EQ_VALUES = true;
private final boolean DEBUG_EQ_VALUES = false;
int accountDetailsId;
String accountId = "";
DecimalFormat df = new DecimalFormat("0.0");
Expand Down Expand Up @@ -238,7 +238,7 @@ public class BalancesFragment extends Fragment implements AssetDelegate, ISound,
private ProgressDialog pdfProgress;

/* Constant used to fix the number of historical transfers to fetch from the network in one batch */
private int HISTORICAL_TRANSFER_BATCH_SIZE = 5;
private int HISTORICAL_TRANSFER_BATCH_SIZE = 20;

/* Parameters to be used as the start and stop arguments in the 'get_relative_account_history' API call */
private int start = 1;
Expand Down Expand Up @@ -776,7 +776,6 @@ private void processNextEquivalentValue() {
// we can check if we have another batch of times and consequently missing equivalent
// values to process.
processNextMissingTime();

Log.d(TAG,"updating table view");
// Updating table view either way
getActivity().runOnUiThread(new Runnable() {
Expand All @@ -785,7 +784,9 @@ public void run() {
updateTableView(false);
}
});

}

}

/**
Expand Down Expand Up @@ -2625,6 +2626,7 @@ private void updateTableView(boolean reset) {
}
found = false;
}
transfersView.setDataAdapter(tableAdapter);

} else {
tableAdapter = new TransfersTableAdapter(getContext(), account, newData.toArray(new HistoricalTransferEntry[newData.size()]));
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/transactionsendamountview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
android:layout_height="wrap_content"
android:layout_gravity="end"
style="AVLoadingIndicatorView.Small"
android:visibility="visible"
android:visibility="gone"
app:indicatorName="BallPulseIndicator"
app:indicatorColor="@color/gray"
/>
Expand All @@ -46,6 +46,6 @@
android:textColor="@color/send_amount_light"
android:layout_gravity="end"
android:textAlignment="textEnd"
android:visibility="gone"
android:visibility="visible"
android:textStyle="bold" />
</LinearLayout>

0 comments on commit 92a8a41

Please sign in to comment.