Skip to content

Commit e286df6

Browse files
committed
Merge branch 'hotfix/patches' into develop
# Conflicts: # app/src/main/java/org/gnucash/android/ui/transaction/TransactionFormFragment.java
2 parents 7ccf350 + 8ff1c75 commit e286df6

21 files changed

Lines changed: 793 additions & 730 deletions

File tree

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
Change Log
22
===============================================================================
3+
Version 2.3.0 *(2017-09-xx)*
4+
----------------------------
5+
* Improved #696: QIF files are now always zipped regardless of the export destination
6+
7+
Version 2.2.1 *(2017-09-01)*
8+
----------------------------
9+
* Fixed #343: Transaction notes are not exported in QIF exports
10+
* Fixed #649: Commas in the account name cause errors in report generation
11+
* Fixed #689: Long press on the transaction amount brings up QWERTY keyboard
12+
* Fixed #695: Long list of splits not fully visible in transaction detail view
13+
* Fixed #699: Transaction detail screen footer disappears after editing transaction
14+
* Fixed #701: Split memos disappear after transaction edit
15+
* Fixed: Imported weekly scheduled actions no having the days of the week set
16+
* Updated translations - new language Turkish
17+
318
Version 2.2.0 *(2017-05-05)*
419
----------------------------
520
* Feature #646: Option to select backup file using Storage Access Framework

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ apply plugin: 'android-apt'
66

77
def versionMajor = 2
88
def versionMinor = 2
9-
def versionPatch = 0
10-
def versionBuild = 4
9+
def versionPatch = 1
10+
def versionBuild = 1
1111

1212
def buildTime() {
1313
def df = new SimpleDateFormat("yyyyMMdd HH:mm 'UTC'")

app/src/main/java/org/gnucash/android/export/qif/QifExporter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public List<String> generateExport() throws ExporterException {
8686
TransactionEntry.TABLE_NAME + "_" + TransactionEntry.COLUMN_UID + " AS trans_uid",
8787
TransactionEntry.TABLE_NAME + "_" + TransactionEntry.COLUMN_TIMESTAMP + " AS trans_time",
8888
TransactionEntry.TABLE_NAME + "_" + TransactionEntry.COLUMN_DESCRIPTION + " AS trans_desc",
89+
TransactionEntry.TABLE_NAME + "_" + TransactionEntry.COLUMN_NOTES + " AS trans_notes",
8990
SplitEntry.TABLE_NAME + "_" + SplitEntry.COLUMN_QUANTITY_NUM + " AS split_quantity_num",
9091
SplitEntry.TABLE_NAME + "_" + SplitEntry.COLUMN_QUANTITY_DENOM + " AS split_quantity_denom",
9192
SplitEntry.TABLE_NAME + "_" + SplitEntry.COLUMN_TYPE + " AS split_type",
@@ -155,9 +156,14 @@ public List<String> generateExport() throws ExporterException {
155156
writer.append(QifHelper.DATE_PREFIX)
156157
.append(QifHelper.formatDate(cursor.getLong(cursor.getColumnIndexOrThrow("trans_time"))))
157158
.append(newLine);
158-
writer.append(QifHelper.MEMO_PREFIX)
159+
// Payee / description
160+
writer.append(QifHelper.PAYEE_PREFIX)
159161
.append(cursor.getString(cursor.getColumnIndexOrThrow("trans_desc")))
160162
.append(newLine);
163+
// Notes, memo
164+
writer.append(QifHelper.MEMO_PREFIX)
165+
.append(cursor.getString(cursor.getColumnIndexOrThrow("trans_notes")))
166+
.append(newLine);
161167
// deal with imbalance first
162168
double imbalance = cursor.getDouble(cursor.getColumnIndexOrThrow("trans_acct_balance"));
163169
BigDecimal decimalImbalance = BigDecimal.valueOf(imbalance).setScale(2, BigDecimal.ROUND_HALF_UP);

app/src/main/java/org/gnucash/android/export/qif/QifHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class QifHelper {
2929
/*
3030
Prefixes for the QIF file
3131
*/
32+
public static final String PAYEE_PREFIX = "P";
3233
public static final String DATE_PREFIX = "D";
3334
public static final String AMOUNT_PREFIX = "T";
3435
public static final String MEMO_PREFIX = "M";

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
}

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,24 @@ private List<Split> extractSplitsFromView(){
719719
}
720720
}
721721

722-
Split split1 = new Split(value, mAccountUID);
722+
Split split1;
723+
Split split2;
724+
// Try to preserve the other split attributes.
725+
if (mSplitsList.size() >= 2) {
726+
split1 = mSplitsList.get(0);
727+
split1.setValue(value);
728+
split1.setQuantity(value);
729+
split1.setAccountUID(mAccountUID);
730+
731+
split2 = mSplitsList.get(1);
732+
split2.setValue(value);
733+
split2.setQuantity(quantity);
734+
split2.setAccountUID(transferAcctUID);
735+
} else {
736+
split1 = new Split(value, mAccountUID);
737+
split2 = new Split(value, quantity, transferAcctUID);
738+
}
723739
split1.setType(mTransactionTypeSwitch.getTransactionType());
724-
Split split2 = new Split(value, quantity, transferAcctUID);
725740
split2.setType(mTransactionTypeSwitch.getTransactionType().invert());
726741

727742
List<Split> splitList = new ArrayList<>();

app/src/main/java/org/gnucash/android/ui/util/widget/CalculatorEditText.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616
package org.gnucash.android.ui.util.widget;
1717

18-
import android.app.Activity;
1918
import android.content.Context;
2019
import android.content.res.TypedArray;
2120
import android.inputmethodservice.KeyboardView;
21+
import android.os.Build;
2222
import android.support.annotation.Nullable;
2323
import android.support.annotation.XmlRes;
2424
import android.support.v7.widget.AppCompatEditText;
@@ -29,15 +29,13 @@
2929
import android.util.Log;
3030
import android.view.MotionEvent;
3131
import android.view.View;
32-
import android.view.inputmethod.InputMethodManager;
3332

3433
import com.crashlytics.android.Crashlytics;
3534

3635
import net.objecthunter.exp4j.Expression;
3736
import net.objecthunter.exp4j.ExpressionBuilder;
3837

3938
import org.gnucash.android.R;
40-
import org.gnucash.android.app.GnuCashApplication;
4139
import org.gnucash.android.model.Commodity;
4240
import org.gnucash.android.ui.common.FormActivity;
4341
import org.gnucash.android.util.AmountParser;
@@ -148,18 +146,12 @@ public void onClick(View v) {
148146
// Disable spell check (hex strings look like words to Android)
149147
setInputType(getInputType() | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
150148

151-
// FIXME: for some reason, this prevents the text selection from working
152-
setOnLongClickListener(new View.OnLongClickListener() {
153-
@Override
154-
public boolean onLongClick(View v) {
155-
if (v != null && !isInEditMode())
156-
((InputMethodManager) GnuCashApplication.getAppContext()
157-
.getSystemService(Activity.INPUT_METHOD_SERVICE))
158-
.hideSoftInputFromWindow(v.getWindowToken(), 0);
159-
160-
return false;
161-
}
162-
});
149+
// Disable system keyboard appearing on long-press, but for some reason, this prevents the text selection from working.
150+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
151+
setShowSoftInputOnFocus(false);
152+
} else {
153+
setRawInputType(InputType.TYPE_CLASS_NUMBER);
154+
}
163155

164156
// Although this handler doesn't make sense, if removed, the standard keyboard
165157
// shows up in addition to the calculator one when the EditText gets a touch event.

app/src/main/res/layout/activity_transaction_detail.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@
1818
xmlns:android="http://schemas.android.com/apk/res/android"
1919
xmlns:app="http://schemas.android.com/apk/res-auto"
2020
xmlns:tools="http://schemas.android.com/tools"
21-
android:orientation="vertical"
2221
android:layout_width="match_parent"
2322
android:layout_height="match_parent">
2423

25-
26-
2724
<LinearLayout
2825
android:orientation="vertical"
2926
android:layout_width="match_parent"
@@ -65,6 +62,9 @@
6562
</LinearLayout>
6663
</android.support.v7.widget.Toolbar>
6764

65+
<ScrollView
66+
android:layout_width="match_parent"
67+
android:layout_height="match_parent">
6868
<TableLayout android:id="@+id/fragment_transaction_details"
6969
android:layout_width="match_parent"
7070
android:layout_height="wrap_content"
@@ -146,6 +146,7 @@
146146
</TableRow>
147147

148148
</TableLayout>
149+
</ScrollView>
149150
</LinearLayout>
150151
<android.support.design.widget.FloatingActionButton
151152
android:id="@+id/fab_edit_transaction"

app/src/main/res/layout/fragment_transaction_form.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
android:background="@android:color/transparent"
7373
android:textColor="@color/debit_red"
7474
android:textSize="20sp"
75+
android:textIsSelectable="true"
7576
gnucash:keyboardKeysLayout="@xml/calculator_keyboard"/>
7677

7778
<ImageView android:id="@+id/btn_split_editor"

app/src/main/res/values-af-rZA/strings.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
limitations under the License.
1717
-->
1818
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
19-
<string name="title_create_account">Create Account</string>
20-
<string name="title_edit_account">Edit Account</string>
21-
<string name="description_add_transaction_icon">Add a new transaction to an account</string>
22-
<string name="description_view_account_icon">View account details</string>
23-
<string name="label_no_accounts">No accounts to display</string>
24-
<string name="label_account_name">Account name</string>
25-
<string name="btn_cancel">Cancel</string>
26-
<string name="btn_save">Save</string>
27-
<string name="btn_test">Test</string>
28-
<string name="label_passcode">Enter Passcode</string>
29-
<string name="toast_wrong_passcode">Wrong passcode, please try again</string>
30-
<string name="toast_passcode_set">Passcode set</string>
31-
<string name="label_confirm_passcode">Please confirm your passcode</string>
19+
<string name="title_create_account">Skep Rekening</string>
20+
<string name="title_edit_account">Wysig Rekening</string>
21+
<string name="description_add_transaction_icon">Voeg \'n nuwe transaksie by \'n rekening</string>
22+
<string name="description_view_account_icon">Bekyk rekening besonderhede</string>
23+
<string name="label_no_accounts">Geen rekeninge om te wys</string>
24+
<string name="label_account_name">Rekeningnaam</string>
25+
<string name="btn_cancel">Kanselleer</string>
26+
<string name="btn_save">Stoor</string>
27+
<string name="btn_test">Toets</string>
28+
<string name="label_passcode">Voer Wagwoord in</string>
29+
<string name="toast_wrong_passcode">Verkeerde wagwoord, probeer asseblief weer</string>
30+
<string name="toast_passcode_set">Wagwoord ingestel</string>
31+
<string name="label_confirm_passcode">Bevestig asseblief jou wagwoord</string>
3232
<string name="toast_invalid_passcode_confirmation">Invalid passcode confirmation. Please try again</string>
3333
<string name="label_transaction_name">Description</string>
3434
<string name="label_transaction_amount">Amount</string>

0 commit comments

Comments
 (0)