Skip to content

Commit ca55b49

Browse files
authored
Merge pull request #87 from mattvb91/v1.3.x
V1.3.x
2 parents 318ec5e + 788ede4 commit ca55b49

Some content is hidden

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

77 files changed

+833
-1107
lines changed

.travis.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
language: android
2+
jdk: oraclejdk8
3+
sudo: required
4+
5+
before_cache:
6+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
7+
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
8+
9+
cache:
10+
directories:
11+
- $HOME/.gradle/caches/
12+
- $HOME/.gradle/wrapper/
13+
14+
android:
15+
components:
16+
# Uncomment the lines below if you want to
17+
# use the latest revision of Android SDK Tools
18+
- platform-tools
19+
- tools
20+
21+
# The BuildTools version used by your project
22+
- build-tools-25.0.3
23+
24+
# The SDK version used to compile your project
25+
- android-19
26+
- android-25
27+
28+
# Additional components
29+
- extra-google-m2repository
30+
- extra-android-support
31+
- extra-android-m2repository
32+
33+
# Specify at least one system image,
34+
# if you need to run emulator(s) during your tests
35+
- sys-img-armeabi-v7a-android-19
36+
37+
licenses:
38+
- 'android-sdk-preview-license-.+'
39+
- 'android-sdk-license-.+'
40+
- 'intel-android-extra-license.+'
41+
- 'android-support-.+'
42+
43+
before_script:
44+
- mv app/src/debug/google-services.json app/google-services.json
45+
- mv app/src/debug/res/values/keys.xml app/src/main/res/values/keys.xml
46+
- echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a
47+
- emulator -avd test -no-audio -no-window &
48+
- android-wait-for-emulator
49+
- adb shell input keyevent 82 &
50+
51+
script:
52+
- ./gradlew test --stacktrace
53+
- ./gradlew connectedAndroidTest -i

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Subterminal
2+
Android B.A.S.E jumping logbook app
3+
<p>
4+
<img src="https://travis-ci.org/mattvb91/Subterminal.svg?branch=master">
5+
</p>
6+
7+
## Contributing
8+
9+
- Coming soon

app/.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/build
22
/src/main/res/values/keys.xml
3-
/src/main/res/raw/subterminal.crt
4-
google-services.json
3+
/google-services.json

app/build.gradle

Lines changed: 50 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ repositories {
66
}
77

88
android {
9-
compileSdkVersion 24
10-
buildToolsVersion '25.0.0'
9+
compileSdkVersion 25
10+
buildToolsVersion '25.0.3'
1111
defaultConfig {
1212
applicationId "mavonie.subterminal"
1313
minSdkVersion 19
14-
targetSdkVersion 24
15-
versionCode 33
16-
versionName "1.2.5"
14+
targetSdkVersion 25
15+
versionCode 34
16+
versionName "1.3.0"
1717
multiDexEnabled true
1818
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1919
}
@@ -31,6 +31,8 @@ android {
3131
}
3232
}
3333

34+
def supportLibraryVersion = '25.3.1'
35+
3436
dependencies {
3537
compile 'com.android.support:multidex:1.0.1'
3638

@@ -47,53 +49,70 @@ dependencies {
4749
compile('com.facebook.fresco:fresco:1.3.0') {
4850
exclude group: 'com.parse.bolts', module: 'bolts-tasks';
4951
}
50-
compile 'com.google.firebase:firebase-core:10.2.1'
51-
compile 'com.google.firebase:firebase-crash:10.2.1'
52-
compile 'com.google.firebase:firebase-messaging:10.2.1'
53-
compile 'com.google.firebase:firebase-ads:10.2.1'
52+
compile 'com.google.firebase:firebase-core:10.2.6'
53+
compile 'com.google.firebase:firebase-crash:10.2.6'
54+
compile 'com.google.firebase:firebase-messaging:10.2.6'
55+
compile 'com.google.firebase:firebase-ads:10.2.6'
56+
57+
compile 'com.google.android.gms:play-services-maps:10.2.6'
5458

55-
compile 'com.jakewharton:butterknife:8.5.1'
56-
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
59+
compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
60+
compile "com.android.support:support-v4:${supportLibraryVersion}"
61+
compile "com.android.support:cardview-v7:${supportLibraryVersion}"
62+
compile "com.android.support:recyclerview-v7:${supportLibraryVersion}"
63+
compile "com.android.support:design:${supportLibraryVersion}"
64+
compile "com.android.support:recyclerview-v7:${supportLibraryVersion}"
65+
compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
66+
compile "com.android.support:design:${supportLibraryVersion}"
5767

58-
compile 'co.lujun:androidtagview:1.0.5'
68+
compile 'com.jakewharton:butterknife:8.6.0'
69+
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
70+
71+
compile 'co.lujun:androidtagview:1.1.3'
5972
compile 'com.github.developer-shivam:crescento:1.1.0'
6073
compile 'com.flaviofaria:kenburnsview:1.0.7'
61-
compile 'com.android.support:appcompat-v7:24.2.1'
62-
compile 'com.android.support:design:24.2.1'
6374
compile 'me.relex:photodraweeview:1.1.2'
64-
compile 'com.facebook.android:facebook-android-sdk:4.3.0'
65-
compile 'com.android.support:support-v4:24.2.1'
66-
compile 'com.android.support:recyclerview-v7:24.2.1'
67-
compile 'com.google.android.gms:play-services-maps:10.2.1'
68-
compile 'com.android.support:cardview-v7:24.2.1'
75+
compile 'com.facebook.android:facebook-android-sdk:4.22.1'
6976
compile 'de.cketti.library.changelog:ckchangelog:1.2.2'
70-
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
71-
compile 'com.kbeanie:multipicker:1.1.2@aar'
72-
compile 'com.squareup.retrofit2:retrofit:2.2.0'
73-
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
77+
compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
78+
compile 'com.kbeanie:multipicker:1.1.31@aar'
79+
compile 'com.squareup.retrofit2:retrofit:2.3.0'
80+
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
7481
compile 'com.sa90.materialarcmenu:library:1.4.1'
75-
compile 'com.tomer:fadingtextview:1.2'
76-
compile 'com.android.support:design:24+'
77-
compile 'com.android.support:appcompat-v7:24.2.0'
78-
compile 'com.github.gcacace:signature-pad:1.2.0'
82+
compile 'com.tomer:fadingtextview:1.8.1'
83+
compile 'com.github.gcacace:signature-pad:1.2.1'
7984
compile('com.github.orangegangsters:lollipin:2.0.0@aar') {
8085
transitive = true
8186
}
8287
compile 'uk.me.lewisdeane.ldialogs:ldialogs:1.2.0@aar'
8388
compile 'com.pixplicity.easyprefs:library:1.8.1@aar'
84-
compile 'com.jonathanfinerty.once:once:1.2.1'
89+
compile 'com.jonathanfinerty.once:once:1.2.2'
8590
compile 'com.stripe:stripe-android:1.1.1'
86-
compile 'io.card:android-sdk:5.4.2'
91+
compile 'io.card:android-sdk:5.5.1'
8792
compile 'com.birbit:android-priority-jobqueue:2.0.1'
8893
compile 'com.github.AhmadNemati:WindView:1.1.1'
8994
compile 'com.github.zurche:open-weather-map-android-wrapper:v0.1'
9095
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
91-
testCompile 'org.robolectric:robolectric:3.1.2'
96+
testCompile 'org.robolectric:robolectric:3.3.2'
97+
testCompile "org.robolectric:shadows-multidex:3.3.2"
9298
testCompile 'junit:junit:4.12'
9399
testCompile 'org.xerial:sqlite-jdbc:3.8.11.2'
94100
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
95101
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
96102
}
97103

98104

99-
apply plugin: 'com.google.gms.google-services'
105+
apply plugin: 'com.google.gms.google-services'
106+
107+
android.applicationVariants.all { variant ->
108+
def productFlavor = variant.productFlavors[0] != null ? "${variant.productFlavors[0].name.capitalize()}" : ""
109+
def buildType = "${variant.buildType.name.capitalize()}"
110+
tasks["compile${productFlavor}${buildType}UnitTestSources"].dependsOn(tasks["merge${productFlavor}${buildType}Assets"])
111+
}
112+
113+
// Test Logging
114+
tasks.withType(Test) {
115+
testLogging {
116+
events "passed", "skipped", "failed"
117+
}
118+
}

app/src/androidTest/java/mavonie/subterminal/BaseTest.java

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
import android.support.test.espresso.NoMatchingViewException;
55
import android.support.test.espresso.ViewInteraction;
66
import android.support.test.espresso.contrib.DrawerActions;
7+
import android.support.test.filters.LargeTest;
78
import android.support.test.rule.ActivityTestRule;
89
import android.support.test.runner.AndroidJUnit4;
910
import android.support.v7.widget.RecyclerView;
10-
import android.test.suitebuilder.annotation.LargeTest;
11+
import android.view.WindowManager;
1112

1213
import org.junit.Before;
1314
import org.junit.Rule;
@@ -16,6 +17,10 @@
1617

1718
import java.util.Random;
1819

20+
import mavonie.subterminal.Models.Skydive.Aircraft;
21+
import mavonie.subterminal.Models.Skydive.Dropzone;
22+
import mavonie.subterminal.Models.Skydive.Tunnel;
23+
1924
import static android.support.test.espresso.Espresso.onView;
2025
import static android.support.test.espresso.action.ViewActions.click;
2126
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
@@ -32,9 +37,66 @@ public class BaseTest {
3237
@Rule
3338
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
3439

40+
private boolean unlocked = false;
41+
3542
@Before
3643
public void setUp() {
44+
this.unlockScreen();
3745
this.okChangelog();
46+
47+
if(new Aircraft().count() == 0) {
48+
//Some data for tests
49+
Aircraft aircraft = new Aircraft();
50+
aircraft.setName(randomString(4));
51+
aircraft.save();
52+
}
53+
54+
if(new Dropzone().count() == 0) {
55+
Dropzone dropzone = new Dropzone();
56+
57+
dropzone.setCountry("Ireland");
58+
dropzone.setName("Irish Parachute Club");
59+
dropzone.setDescription("Description");
60+
dropzone.setGlobalId("irish_parachute_club");
61+
dropzone.setEmail("info@skydive.ie");
62+
dropzone.setPhone("00353 938 35663");
63+
dropzone.setWebsite("http://skydive.ie");
64+
dropzone.setLatitude(53.2506);
65+
dropzone.setLongtitude(-7.1174);
66+
67+
dropzone.save();
68+
}
69+
70+
if(new Tunnel().count() == 0) {
71+
Tunnel tunnel = new Tunnel();
72+
73+
tunnel.setCountry("Ireland");
74+
tunnel.setName("Wind Tunnel");
75+
tunnel.setDescription("Description");
76+
tunnel.setEmail("info@tunnel.com");
77+
tunnel.setPhone("0023466423");
78+
tunnel.setWebsite("http://tunnel.com");
79+
tunnel.setLatitude(53.2506);
80+
tunnel.setLongtitude(-7.1174);
81+
tunnel.setTunnelHeight(10.04);
82+
tunnel.setTunnelDiameter(4);
83+
84+
tunnel.save();
85+
}
86+
}
87+
88+
private void unlockScreen() {
89+
if(!this.unlocked) {
90+
final MainActivity activity = mActivityTestRule.getActivity();
91+
Runnable wakeUpDevice = new Runnable() {
92+
public void run() {
93+
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON |
94+
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED |
95+
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
96+
}
97+
};
98+
activity.runOnUiThread(wakeUpDevice);
99+
}
38100
}
39101

40102
@Test
@@ -83,7 +145,7 @@ public void confirmCalendar() {
83145
appCompatButton2.perform(click());
84146
} catch (Exception e) {
85147
ViewInteraction appCompatButton2 = onView(
86-
allOf(withId(android.R.id.button1), withText("OK"), isDisplayed()));
148+
allOf(withId(android.R.id.button1), withText("Done"), isDisplayed()));
87149
appCompatButton2.perform(click());
88150
}
89151
}
@@ -97,8 +159,7 @@ public String randomString(int length) {
97159
char c1 = chars1[random.nextInt(chars1.length)];
98160
sb1.append(c1);
99161
}
100-
String random_string = sb1.toString();
101162

102-
return random_string;
163+
return sb1.toString();
103164
}
104165
}

app/src/androidTest/java/mavonie/subterminal/ExitTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ public void tabTest() {
9191
}
9292

9393
@Test
94-
public void clickRandomItemTest() {
94+
public void clickRandomItemTest() throws InterruptedException {
95+
addExitTest();
96+
addExitTest();
97+
9598
navigateToExits();
9699

97100
navigateTab("All");

app/src/androidTest/java/mavonie/subterminal/GearTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,12 @@ public void deleteSuitTest() {
191191
allOf(withId(android.R.id.title), withText("Suits (" + new Suit().count(Synchronizable.getActiveParams()) + ")"), isDisplayed()));
192192
appCompatTextView.perform(click());
193193

194-
clickRandomItemTest();
194+
//Magic happening
195+
int x = getRandomRecyclerPosition(R.id.list);
196+
197+
onView(withId(R.id.list))
198+
.perform(RecyclerViewActions
199+
.actionOnItemAtPosition(x, click()));
195200

196201
ViewInteraction actionMenuItemView = onView(
197202
allOf(withId(R.id.action_delete), withContentDescription("Delete"), isDisplayed()));

app/src/androidTest/java/mavonie/subterminal/JumpTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package mavonie.subterminal;
22

33

4+
import android.support.design.widget.NavigationView;
45
import android.support.test.espresso.ViewInteraction;
56
import android.support.test.espresso.contrib.RecyclerViewActions;
67

@@ -19,7 +20,9 @@
1920
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
2021
import static android.support.test.espresso.action.ViewActions.replaceText;
2122
import static android.support.test.espresso.action.ViewActions.scrollTo;
23+
import static android.support.test.espresso.action.ViewActions.swipeDown;
2224
import static android.support.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition;
25+
import static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom;
2326
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
2427
import static android.support.test.espresso.matcher.ViewMatchers.withId;
2528
import static android.support.test.espresso.matcher.ViewMatchers.withParent;
@@ -100,6 +103,8 @@ public void addJump() {
100103
public static void navigateToJumpsList() {
101104
openNavigationDrawer();
102105

106+
onView(isAssignableFrom(NavigationView.class)).perform(swipeDown());
107+
103108
ViewInteraction appCompatCheckedTextView = onView(
104109
allOf(withId(R.id.design_menu_item_text), withText("Jumps"), isDisplayed()));
105110
appCompatCheckedTextView.perform(click());

app/src/androidTest/java/mavonie/subterminal/MainActivityTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package mavonie.subterminal;
22

3+
import android.support.design.widget.NavigationView;
34
import android.support.test.espresso.ViewInteraction;
45
import android.view.View;
56
import android.view.ViewGroup;
@@ -16,6 +17,8 @@
1617

1718
import static android.support.test.espresso.Espresso.onView;
1819
import static android.support.test.espresso.action.ViewActions.click;
20+
import static android.support.test.espresso.action.ViewActions.swipeUp;
21+
import static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom;
1922
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
2023
import static android.support.test.espresso.matcher.ViewMatchers.withId;
2124
import static android.support.test.espresso.matcher.ViewMatchers.withText;
@@ -31,6 +34,7 @@ public void testModeChange() {
3134

3235
public static void testSkydiveMode() {
3336
openNavigationDrawer();
37+
onView(isAssignableFrom(NavigationView.class)).perform(swipeUp());
3438

3539
ViewInteraction modeMenu2 = onView(
3640
allOf(withId(R.id.design_menu_item_text), withText(Prefs.getString(Preference.PREFS_MODE, Subterminal.MODE_SKYDIVING)), isDisplayed()));
@@ -49,6 +53,7 @@ public static void testSkydiveMode() {
4953

5054
public static void testBaseMode() {
5155
openNavigationDrawer();
56+
onView(isAssignableFrom(NavigationView.class)).perform(swipeUp());
5257

5358
ViewInteraction modeMenu = onView(
5459
allOf(withId(R.id.design_menu_item_text), withText(Prefs.getString(Preference.PREFS_MODE, Subterminal.MODE_SKYDIVING)), isDisplayed()));

0 commit comments

Comments
 (0)