Skip to content

Commit 07dc956

Browse files
committed
Merge branch 'release/v2.1.5'
2 parents 5a644f0 + 3192638 commit 07dc956

File tree

137 files changed

+4607
-1470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+4607
-1470
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
language: android
2-
jdk: oraclejdk7
2+
jdk: oraclejdk8
33
android:
44
components:
55
- platform-tools
66
- tools
7-
- build-tools-23.0.3
7+
- tools #not a typo. Needed for SDK update
8+
- build-tools-24.0.3
89

910
# The SDK version used to compile your project
10-
- android-23
11+
- android-24
1112

1213
# Additional components
1314
- extra-android-support
1415
- extra-google-google_play_services
1516
- extra-google-m2repository
1617
- extra-android-m2repository
17-
- addon-google_apis-google-23
18+
- addon-google_apis-google-24
1819

1920
# Specify at least one system image,
2021
# if you need to run emulator(s) during your tests

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
Change Log
22
===============================================================================
3+
Version 2.1.5 *(2017-04-04)*
4+
----------------------------
5+
* Fixed: Widget button for placeholder accounts tries to create transactions
6+
* Fixed: App crashes when screen orientation changes while viewing reports (#633)
7+
* Fixed: OFX exporter creates file even when there are no transactions to export
8+
* Fixed: Constant app crashes after creating accounts with BYN currency (#663)
9+
* Fixed: Choosing manual account creation during setup closes wizard but doesn't open accounts view (#644)
10+
* Improved: Upgrade to Dropbox API v2 (v1 will be deprecated soon) (#552)
11+
* Improved: Use FileProvider for sharing files with other applications (#568)
12+
* Improved: Tell user when there are no transactions to export
13+
* Improved: Added option to hide account balance in widget (#600)
14+
* Improved: List transfer accounts starting with favorites first (#622)
15+
* Improved: Management of preferences for widgets and support for multibook widgets
16+
* Improved: Updated translations and added generic default account files for broad locales (e.g. de, fr, pt)
17+
18+
319
Version 2.1.4 *(2017-01-30)*
420
----------------------------
521
* Fixed: Bugs in execution of some scheduled actions (#604, #609)

app/build.gradle

Lines changed: 68 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import org.apache.tools.ant.taskdefs.condition.Os
2-
31
import java.text.SimpleDateFormat
42

53
apply plugin: 'com.android.application'
64
apply plugin: 'io.fabric'
5+
apply plugin: 'android-apt'
76

87
def versionMajor = 2
98
def versionMinor = 1
10-
def versionPatch = 4
11-
def versionBuild = 2
9+
def versionPatch = 5
10+
def versionBuild = 4
1211

1312
def buildTime() {
1413
def df = new SimpleDateFormat("yyyyMMdd HH:mm 'UTC'")
@@ -22,8 +21,8 @@ def gitSha() {
2221

2322

2423
android {
25-
compileSdkVersion 23
26-
buildToolsVersion '23.0.3'
24+
compileSdkVersion 24
25+
buildToolsVersion '24.0.3'
2726
defaultConfig {
2827
applicationId "org.gnucash.android"
2928
testApplicationId 'org.gnucash.android.test'
@@ -36,15 +35,7 @@ android {
3635
buildConfigField "boolean", "CAN_REQUEST_RATING", "false"
3736
buildConfigField "String", "BUILD_TIME", "\"${buildTime()}\""
3837

39-
if (project.hasProperty("RELEASE_DROPBOX_APP_KEY")){
40-
resValue "string", "dropbox_app_key", RELEASE_DROPBOX_APP_KEY
41-
resValue "string", "dropbox_app_secret", RELEASE_DROPBOX_APP_SECRET
42-
resValue "string", "manifest_dropbox_app_key", "db-${RELEASE_DROPBOX_APP_KEY}"
43-
} else {
44-
resValue "string", "dropbox_app_key", "dhjh8ke9wf05948"
45-
resValue "string", "dropbox_app_secret", "h2t9fphj3nr4wkw"
46-
resValue "string", "manifest_dropbox_app_key", "db-dhjh8ke9wf05948"
47-
}
38+
multiDexEnabled true
4839
testInstrumentationRunner "org.gnucash.android.test.ui.util.GnucashAndroidTestRunner"
4940

5041
}
@@ -109,17 +100,41 @@ android {
109100
resValue "string", "app_name", "GnuCash-devel"
110101
versionName "${versionMajor}.${versionMinor}.${versionPatch}-dev${versionBuild}_r${gitSha()}"
111102
resValue "string", "app_version_name", "${versionName}"
103+
104+
resValue "string", "dropbox_app_key", "dhjh8ke9wf05948"
105+
resValue "string", "dropbox_app_secret", "h2t9fphj3nr4wkw"
106+
resValue "string", "manifest_dropbox_app_key", "db-dhjh8ke9wf05948"
112107
}
113108

114109
beta {
115110
resValue "string", "app_name", "GnuCash - beta"
116111
versionName "${versionMajor}.${versionMinor}.${versionPatch}-beta${versionBuild}"
117112
resValue "string", "app_version_name", "${versionName}"
113+
114+
if (project.hasProperty("RELEASE_DROPBOX_APP_KEY")){
115+
resValue "string", "dropbox_app_key", RELEASE_DROPBOX_APP_KEY
116+
resValue "string", "dropbox_app_secret", RELEASE_DROPBOX_APP_SECRET
117+
resValue "string", "manifest_dropbox_app_key", "db-${RELEASE_DROPBOX_APP_KEY}"
118+
} else {
119+
resValue "string", "dropbox_app_key", "dhjh8ke9wf05948"
120+
resValue "string", "dropbox_app_secret", "h2t9fphj3nr4wkw"
121+
resValue "string", "manifest_dropbox_app_key", "db-dhjh8ke9wf05948"
122+
}
118123
}
119124

120125
production {
121126
resValue "string", "app_name", "GnuCash"
122127
buildConfigField "boolean", "CAN_REQUEST_RATING", "true"
128+
129+
if (project.hasProperty("RELEASE_DROPBOX_APP_KEY")){
130+
resValue "string", "dropbox_app_key", RELEASE_DROPBOX_APP_KEY
131+
resValue "string", "dropbox_app_secret", RELEASE_DROPBOX_APP_SECRET
132+
resValue "string", "manifest_dropbox_app_key", "db-${RELEASE_DROPBOX_APP_KEY}"
133+
} else {
134+
resValue "string", "dropbox_app_key", "dhjh8ke9wf05948"
135+
resValue "string", "dropbox_app_secret", "h2t9fphj3nr4wkw"
136+
resValue "string", "manifest_dropbox_app_key", "db-dhjh8ke9wf05948"
137+
}
123138
}
124139

125140
}
@@ -147,46 +162,35 @@ def initCrashlyticsPropertiesIfNeeded() {
147162
}
148163
}
149164

150-
def adb = Os.isFamily(Os.FAMILY_WINDOWS) ? "..\\scripts\\adb_all.bat" : "../scripts/adb_all.sh"
151-
//def adb = android.getAdbExe().toString()
152-
153165
afterEvaluate {
166+
apply plugin: 'spoon'
167+
spoon {
168+
debug = true
169+
grantAllPermissions = true
170+
}
154171
initCrashlyticsPropertiesIfNeeded()
172+
}
155173

156-
task grantTestPermissionsDevel(type: Exec, dependsOn: 'installDevelopmentDebug') { // or install{productFlavour}{buildType}
157-
if (Os.isFamily(Os.FAMILY_WINDOWS)){
158-
commandLine "cmd", "/c", "$adb", "shell pm grant $android.productFlavors.development.applicationId android.permission.SET_ANIMATION_SCALE"
159-
// commandLine "cmd", "/c", "$adb", "shell pm grant $android.productFlavors.development.applicationId android.permission.WRITE_EXTERNAL_STORAGE"
160-
} else {
161-
commandLine "$adb shell pm grant $android.productFlavors.development.applicationId android.permission.SET_ANIMATION_SCALE".split(' ')
162-
// commandLine "$adb shell pm grant $android.productFlavors.development.applicationId android.permission.WRITE_EXTERNAL_STORAGE".split(' ')
163-
}
164-
}
174+
android.productFlavors.all { flavour ->
175+
def applicationId = flavour.applicationId
176+
def adb = android.getAdbExe().toString()
165177

166-
task grantTestPermissionsProduction(type: Exec, dependsOn: 'installProductionDebug'){
167-
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
168-
commandLine "cmd", "/c", "$adb", "shell pm grant $android.productFlavors.development.applicationId android.permission.SET_ANIMATION_SCALE"
169-
commandLine "cmd", "/c", "$adb", "shell pm grant $android.productFlavors.development.applicationId android.permission.WRITE_EXTERNAL_STORAGE"
170-
} else {
171-
commandLine "$adb shell pm grant $android.defaultConfig.applicationId android.permission.SET_ANIMATION_SCALE".split(' ')
172-
commandLine "$adb shell pm grant $android.defaultConfig.applicationId android.permission.WRITE_EXTERNAL_STORAGE".split(' ')
173-
}
178+
def grantPermissionsTask = tasks.create("grant${flavour.name.capitalize()}Permissions") << {
179+
"${adb} shell pm grant ${applicationId} android.permission.WRITE_EXTERNAL_STORAGE".execute()
180+
"${adb} shell pm grant ${applicationId} android.permission.SET_ANIMATION_SCALE".execute()
174181
}
182+
grantPermissionsTask.description = "Grants permissions for Marshmallow"
175183

176-
// When launching individual tests from Android Studio, it seems that only the assemble tasks
177-
// get called directly, not the install* versions
178-
tasks.each { task ->
179-
if (task.name.startsWith('assembleDevelopmentDebugAndroidTest')){
180-
task.dependsOn grantTestPermissionsDevel
181-
} else if (task.name.startsWith('assembleBetaDebugAndroidTest')){
182-
task.dependsOn grantTestPermissionsProduction
183-
} else if (task.name.startsWith('assembleProductionDebugAndroidTest')){
184-
task.dependsOn grantTestPermissionsProduction
184+
tasks.whenTaskAdded { theTask ->
185+
def assemblePattern = ~"assemble${flavour.name.capitalize()}DebugAndroidTest"
186+
if (assemblePattern.matcher(theTask.name).matches()) {
187+
theTask.dependsOn grantPermissionsTask.name
185188
}
186189
}
187190
}
188191

189-
def androidSupportVersion = "23.3.0"
192+
193+
def androidSupportVersion = "24.2.1"
190194
def androidEspressoVersion = "2.2.2"
191195
def androidSupportTestVersion = "0.5"
192196

@@ -205,21 +209,25 @@ dependencies {
205209
'com.android.support:cardview-v7:' + androidSupportVersion,
206210
'com.android.support:preference-v7:' + androidSupportVersion,
207211
'com.android.support:recyclerview-v7:' + androidSupportVersion,
208-
'com.viewpagerindicator:library:2.4.1@aar',
209-
'com.code-troopers.betterpickers:library:2.5.5',
212+
'com.code-troopers.betterpickers:library:3.0.1',
210213
'org.jraf:android-switch-backport:2.0.1@aar',
211214
'com.github.PhilJay:MPAndroidChart:v2.1.3',
212-
'joda-time:joda-time:2.7',
213-
'com.google.android.gms:play-services-drive:8.3.0',
214-
'com.jakewharton:butterknife:7.0.1',
215-
'io.github.kobakei:ratethisapp:1.0.3',
215+
'joda-time:joda-time:2.9.4',
216+
'com.google.android.gms:play-services-drive:9.6.1',
217+
'io.github.kobakei:ratethisapp:1.1.0',
216218
'com.squareup:android-times-square:1.6.5@aar',
217219
'com.github.techfreak:wizardpager:1.0.3',
218-
'net.objecthunter:exp4j:0.4.5',
219-
'org.apache.jackrabbit:jackrabbit-webdav:2.11.1'
220+
'net.objecthunter:exp4j:0.4.7',
221+
'org.apache.jackrabbit:jackrabbit-webdav:2.13.3',
222+
'com.dropbox.core:dropbox-core-sdk:2.1.2',
223+
'com.facebook.stetho:stetho:1.4.1',
224+
'com.android.support:multidex:1.0.1'
220225
)
221226

222-
compile ('com.uservoice:uservoice-android-sdk:1.2.+') {
227+
compile 'com.jakewharton:butterknife:8.4.0'
228+
apt 'com.jakewharton:butterknife-compiler:8.4.0'
229+
230+
compile ('com.uservoice:uservoice-android-sdk:1.2.5') {
223231
exclude module: 'commons-logging'
224232
exclude module: 'httpcore'
225233
exclude module: 'httpclient'
@@ -229,13 +237,14 @@ dependencies {
229237
transitive = true;
230238
}
231239

232-
compile 'com.facebook.stetho:stetho:1.3.1'
233240

234-
testCompile('org.robolectric:robolectric:3.1',
241+
testCompile('org.robolectric:robolectric:3.1.2',
235242
'junit:junit:4.12',
236-
'joda-time:joda-time:2.7',
243+
'joda-time:joda-time:2.9.4',
237244
'org.assertj:assertj-core:1.7.1'
238245
)
246+
testCompile 'org.robolectric:shadows-multidex:3.0'
247+
239248
androidTestCompile ('com.android.support:support-annotations:' + androidSupportVersion,
240249
'com.android.support.test:runner:' + androidSupportTestVersion,
241250
'com.android.support.test:rules:' + androidSupportTestVersion,
@@ -252,4 +261,6 @@ dependencies {
252261
androidTestCompile('com.squareup.assertj:assertj-android:1.1.1'){
253262
exclude group: 'com.android.support', module:'support-annotations'
254263
}
264+
265+
androidTestCompile 'com.squareup.spoon:spoon-client:1.6.4'
255266
}
-413 KB
Binary file not shown.

app/proguard-rules.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
}
1313

1414
-keep class org.gnucash.android.** {*;}
15-
-keep class com.dropbox.** {*;}
15+
-keep class com.dropbox.** {*;}
16+
-keep class android.support.v7.widget.SearchView { *; }

app/src/androidTest/java/org/gnucash/android/test/ui/AccountsActivityTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public void editingAccountShouldNotDeleteTransactions(){
328328
Account account = new Account("Transfer Account");
329329
account.setCommodity(Commodity.getInstance(ACCOUNTS_CURRENCY.getCurrencyCode()));
330330
Transaction transaction = new Transaction("Simple transaction");
331-
transaction.setCurrencyCode(ACCOUNTS_CURRENCY.getCurrencyCode());
331+
transaction.setCommodity(ACCOUNTS_CURRENCY);
332332
Split split = new Split(new Money(BigDecimal.TEN, ACCOUNTS_CURRENCY), account.getUID());
333333
transaction.addSplit(split);
334334
transaction.addSplit(split.createPair(SIMPLE_ACCOUNT_UID));

app/src/androidTest/java/org/gnucash/android/test/ui/ExportTransactionsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
import org.junit.runners.MethodSorters;
6262

6363
import java.io.File;
64-
import java.util.Currency;
6564
import java.util.List;
6665

6766
import static android.support.test.espresso.Espresso.onView;
@@ -133,7 +132,8 @@ public void setUp() throws Exception {
133132
Split split = new Split(new Money("8.99", currencyCode), account.getUID());
134133
split.setMemo("Hawaii is the best!");
135134
transaction.addSplit(split);
136-
transaction.addSplit(split.createPair(mAccountsDbAdapter.getOrCreateImbalanceAccountUID(Currency.getInstance(currencyCode))));
135+
transaction.addSplit(split.createPair(
136+
mAccountsDbAdapter.getOrCreateImbalanceAccountUID(Commodity.DEFAULT_COMMODITY)));
137137
account.addTransaction(transaction);
138138

139139
mAccountsDbAdapter.addRecord(account, DatabaseAdapter.UpdateMethod.insert);

app/src/androidTest/java/org/gnucash/android/test/ui/OwnCloudExportTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
import org.junit.runner.RunWith;
5050
import org.junit.runners.MethodSorters;
5151

52-
import java.util.Currency;
53-
5452
import static android.support.test.InstrumentationRegistry.getInstrumentation;
5553
import static android.support.test.espresso.Espresso.onView;
5654
import static android.support.test.espresso.action.ViewActions.clearText;
@@ -132,7 +130,7 @@ public void setUp() throws Exception {
132130
Split split = new Split(new Money("11.11", currencyCode), account.getUID());
133131
transaction.addSplit(split);
134132
transaction.addSplit(split.createPair(
135-
mAccountsDbAdapter.getOrCreateImbalanceAccountUID(Currency.getInstance(currencyCode))));
133+
mAccountsDbAdapter.getOrCreateImbalanceAccountUID(Commodity.DEFAULT_COMMODITY)));
136134
account.addTransaction(transaction);
137135

138136
mAccountsDbAdapter.addRecord(account, DatabaseAdapter.UpdateMethod.insert);

app/src/androidTest/java/org/gnucash/android/test/ui/TransactionsActivityTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ public void testAddTransaction(){
254254
onView(withId(R.id.fab_create_transaction)).perform(click());
255255

256256
onView(withId(R.id.input_transaction_name)).perform(typeText("Lunch"));
257+
Espresso.closeSoftKeyboard();
257258
onView(withId(R.id.input_transaction_amount)).perform(typeText("899"));
259+
Espresso.closeSoftKeyboard();
258260
onView(withId(R.id.input_transaction_type))
259261
.check(matches(allOf(isDisplayed(), withText(R.string.label_receive))))
260262
.perform(click())
@@ -409,7 +411,7 @@ public void testSplitEditor(){
409411

410412
onView(withId(R.id.input_transaction_name)).perform(typeText("Autobalance"));
411413
onView(withId(R.id.input_transaction_amount)).perform(typeText("499"));
412-
414+
Espresso.closeSoftKeyboard();
413415
onView(withId(R.id.btn_split_editor)).perform(click());
414416

415417
onView(withId(R.id.split_list_layout)).check(matches(allOf(isDisplayed(), hasDescendant(withId(R.id.input_split_amount)))));

app/src/androidTest/java/org/gnucash/android/test/ui/util/GnucashAndroidTestRunner.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import android.content.pm.PackageManager;
2020
import android.os.Bundle;
2121
import android.os.IBinder;
22+
import android.support.multidex.MultiDex;
2223
import android.support.test.runner.AndroidJUnitRunner;
2324
import android.util.Log;
2425

0 commit comments

Comments
 (0)