Skip to content

Commit c18b040

Browse files
committed
Merge branch 'pr/700' into hotfix/patches
Fixes #699
2 parents 85c13a1 + a29d556 commit c18b040

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/src/main/java/org/gnucash/android/ui/transaction/TransactionDetailActivity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class TransactionDetailActivity extends PasscodeLockActivity {
5454

5555
private String mTransactionUID;
5656
private String mAccountUID;
57+
private int mDetailTableRows;
5758

5859
public static final int REQUEST_EDIT_TRANSACTION = 0x10;
5960

@@ -126,6 +127,7 @@ private void bindViews(){
126127
TextView balanceTextView = accountBalance.isNegative() ? mDebitBalance : mCreditBalance;
127128
TransactionsActivity.displayBalance(balanceTextView, accountBalance);
128129

130+
mDetailTableRows = mDetailTableLayout.getChildCount();
129131
boolean useDoubleEntry = GnuCashApplication.isDoubleEntryEnabled();
130132
LayoutInflater inflater = LayoutInflater.from(this);
131133
int index = 0;
@@ -175,8 +177,8 @@ private void refresh(){
175177
* Remove the split item views from the transaction detail prior to refreshing them
176178
*/
177179
private void removeSplitItemViews(){
178-
long splitCount = TransactionsDbAdapter.getInstance().getSplitCount(mTransactionUID);
179-
mDetailTableLayout.removeViews(0, (int)splitCount);
180+
// Remove all rows that are not special.
181+
mDetailTableLayout.removeViews(0, mDetailTableLayout.getChildCount() - mDetailTableRows);
180182
mDebitBalance.setText("");
181183
mCreditBalance.setText("");
182184
}

0 commit comments

Comments
 (0)