Skip to content

Commit 234a35c

Browse files
authored
Merge pull request #88 from mattvb91/v1.3.x
v1.3.1
2 parents ca55b49 + 40bd75e commit 234a35c

29 files changed

+166
-1253
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ android:
1919
- tools
2020

2121
# The BuildTools version used by your project
22-
- build-tools-25.0.3
22+
- build-tools-26.0.2
2323

2424
# The SDK version used to compile your project
2525
- android-19
26-
- android-25
2726

2827
# Additional components
2928
- extra-google-m2repository
@@ -41,6 +40,10 @@ android:
4140
- 'android-support-.+'
4241

4342
before_script:
43+
- mkdir -p app/build/intermediates/assets/release/
44+
- cp -R app/src/main/assets/sql/ app/build/intermediates/assets/release/sql
45+
- mkdir -p app/build/intermediates/assets/debug/
46+
- cp -R app/src/main/assets/sql/ app/build/intermediates/assets/debug/sql
4447
- mv app/src/debug/google-services.json app/google-services.json
4548
- mv app/src/debug/res/values/keys.xml app/src/main/res/values/keys.xml
4649
- echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a

app/build.gradle

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ apply plugin: 'com.android.application'
33
repositories {
44
mavenCentral()
55
maven { url "http://dl.bintray.com/pixplicity/maven" }
6+
google()
67
}
78

89
android {
910
compileSdkVersion 25
10-
buildToolsVersion '25.0.3'
11+
buildToolsVersion '26.0.2'
1112
defaultConfig {
1213
applicationId "mavonie.subterminal"
1314
minSdkVersion 19
1415
targetSdkVersion 25
15-
versionCode 34
16-
versionName "1.3.0"
16+
versionCode 35
17+
versionName "1.3.1"
1718
multiDexEnabled true
1819
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1920
}
@@ -32,9 +33,10 @@ android {
3233
}
3334

3435
def supportLibraryVersion = '25.3.1'
36+
def firebaseVersion = '11.4.2'
3537

3638
dependencies {
37-
compile 'com.android.support:multidex:1.0.1'
39+
compile 'com.android.support:multidex:1.0.2'
3840

3941
compile fileTree(include: ['*.jar'], dir: 'libs')
4042
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
@@ -49,12 +51,11 @@ dependencies {
4951
compile('com.facebook.fresco:fresco:1.3.0') {
5052
exclude group: 'com.parse.bolts', module: 'bolts-tasks';
5153
}
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'
54+
compile "com.google.firebase:firebase-core:${firebaseVersion}"
55+
compile "com.google.firebase:firebase-crash:${firebaseVersion}"
56+
compile "com.google.firebase:firebase-messaging:${firebaseVersion}"
57+
compile "com.google.firebase:firebase-ads:${firebaseVersion}"
58+
compile "com.google.android.gms:play-services-maps:${firebaseVersion}"
5859

5960
compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
6061
compile "com.android.support:support-v4:${supportLibraryVersion}"
@@ -65,8 +66,8 @@ dependencies {
6566
compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
6667
compile "com.android.support:design:${supportLibraryVersion}"
6768

68-
compile 'com.jakewharton:butterknife:8.6.0'
69-
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
69+
compile 'com.jakewharton:butterknife:8.7.0'
70+
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
7071

7172
compile 'co.lujun:androidtagview:1.1.3'
7273
compile 'com.github.developer-shivam:crescento:1.1.0'
@@ -93,12 +94,14 @@ dependencies {
9394
compile 'com.github.AhmadNemati:WindView:1.1.1'
9495
compile 'com.github.zurche:open-weather-map-android-wrapper:v0.1'
9596
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
96-
testCompile 'org.robolectric:robolectric:3.3.2'
97-
testCompile "org.robolectric:shadows-multidex:3.3.2"
97+
testCompile 'org.robolectric:robolectric:3.5.1'
98+
testCompile "org.robolectric:shadows-multidex:3.5.1"
9899
testCompile 'junit:junit:4.12'
99100
testCompile 'org.xerial:sqlite-jdbc:3.8.11.2'
100101
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
101102
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
103+
104+
compile 'ie.mavon.sqlitemodel:sqlitemodel:1.0.0'
102105
}
103106

104107

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

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ public void setMode() {
3333
public void addExitTest() throws InterruptedException {
3434
navigateToExits();
3535

36-
ViewInteraction appCompatTextView = onView(
37-
allOf(withId(android.R.id.title), withText("All"), isDisplayed()));
38-
appCompatTextView.perform(click());
39-
4036
ViewInteraction floatingActionButton = onView(
4137
allOf(withId(R.id.fab), isDisplayed()));
4238
floatingActionButton.perform(click());
@@ -78,39 +74,18 @@ public void navigateToExits() {
7874
appCompatCheckedTextView.perform(click());
7975
}
8076

81-
@Test
82-
public void tabTest() {
83-
84-
navigateToExits();
85-
86-
navigateTab("All");
87-
navigateTab("My Exits");
88-
89-
navigateTab("All");
90-
navigateTab("My Exits");
91-
}
92-
9377
@Test
9478
public void clickRandomItemTest() throws InterruptedException {
9579
addExitTest();
9680
addExitTest();
9781

9882
navigateToExits();
9983

100-
navigateTab("All");
101-
10284
//Magic happening
10385
int x = getRandomRecyclerPosition(R.id.list);
10486

10587
onView(withId(R.id.list))
10688
.perform(RecyclerViewActions
10789
.actionOnItemAtPosition(x, click()));
10890
}
109-
110-
public void navigateTab(String tab) {
111-
ViewInteraction appCompatTextView = onView(
112-
allOf(withId(android.R.id.title), withText(tab), isDisplayed()));
113-
appCompatTextView.perform(click());
114-
}
115-
11691
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="mavonie.subterminal"
4-
android:versionName="1.3.0">
4+
android:versionName="1.3.1">
55

66
<uses-permission android:name="android.permission.INTERNET"/>
77
<uses-permission android:name="android.permission.ACCESS_GPS"/>

app/src/main/assets/sql/create.sql

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ CREATE TABLE gear (
1616

1717
CREATE TABLE exit (
1818
_id INTEGER PRIMARY KEY,
19-
global_id TEXT,
2019
name TEXT,
2120
rockdrop_distance INTEGER,
2221
altitude_to_landing INTEGER,
@@ -28,19 +27,6 @@ CREATE TABLE exit (
2827
synced INTEGER DEFAULT 0,
2928
deleted INTEGER DEFAULT 0);
3029

31-
CREATE TABLE exit_details (
32-
_id INTEGER PRIMARY KEY,
33-
exit_id INTEGER,
34-
rules TEXT,
35-
difficulty_tracking_exit INTEGER,
36-
difficulty_tracking_freefall INTEGER,
37-
difficulty_tracking_landing INTEGER,
38-
difficulty_tracking_overall INTEGER,
39-
difficulty_wingsuit_exit INTEGER,
40-
difficulty_wingsuit_freefall INTEGER,
41-
difficulty_wingsuit_landing INTEGER,
42-
difficulty_wingsuit_overall INTEGER);
43-
4430
CREATE TABLE jump (
4531
_id INTEGER PRIMARY KEY,
4632
date DATE,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
DELETE FROM exit WHERE global_id IS NOT NULL;
2+
ALTER TABLE exit RENAME TO exit_old;
3+
4+
CREATE TABLE exit (
5+
_id INTEGER PRIMARY KEY,
6+
name TEXT,
7+
rockdrop_distance INTEGER,
8+
altitude_to_landing INTEGER,
9+
description TEXT,
10+
latitude DOUBLE,
11+
longtitude DOUBLE,
12+
object_type INTEGER,
13+
height_unit INTEGER DEFAULT 0,
14+
synced INTEGER DEFAULT 0,
15+
deleted INTEGER DEFAULT 0);
16+
17+
INSERT INTO exit SELECT _id, name, rockdrop_distance, altitude_to_landing, description, latitude, longtitude,
18+
object_type, height_unit, synced, deleted FROM exit_old;
19+
20+
DROP TABLE exit_old;
21+
DROP TABLE exit_details;

app/src/main/java/mavonie/subterminal/Dashboard.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,10 @@ public void onClick(View v) {
9494
});
9595
}
9696

97-
HashMap<String, Object> whereNotGlobal = new HashMap<>();
98-
whereNotGlobal.put(Model.FILTER_WHERE_FIELD, Exit.COLUMN_NAME_GLOBAL_ID);
99-
whereNotGlobal.put(Model.FILTER_WHERE_VALUE, null);
100-
10197
skydiveCount.setText(Integer.toString(Subterminal.getUser().getSettings().getSkydiveStartJumpNo() + new Skydive().count(Synchronizable.getActiveParams())));
10298
baseCount.setText(Integer.toString(Subterminal.getUser().getSettings().getBaseStartJumpNo() + new Jump().count(Synchronizable.getActiveParams())));
10399
dropzoneCount.setText(Integer.toString(Dropzone.getDropzonesVisitedCount()));
104-
exitsCount.setText(Integer.toString(new Exit().count(whereNotGlobal)));
100+
exitsCount.setText(Integer.toString(new Exit().count()));
105101

106102
setPieChartData();
107103
setBarChartData();
@@ -268,23 +264,18 @@ private void setPieChartData() {
268264

269265
Query buildingQuery = new Query(Exit.COLUMN_NAME_OBJECT_TYPE, Exit.TYPE_BUILDING);
270266
buildingQuery.getWheres().put(buildingQuery.getWheres().size(), Synchronizable.getActiveParams());
271-
buildingQuery.addWhere(Exit.COLUMN_NAME_GLOBAL_ID, null);
272267

273268
Query antennaQuery = new Query(Exit.COLUMN_NAME_OBJECT_TYPE, Exit.TYPE_ANTENNA);
274269
antennaQuery.getWheres().put(antennaQuery.getWheres().size(), Synchronizable.getActiveParams());
275-
antennaQuery.addWhere(Exit.COLUMN_NAME_GLOBAL_ID, null);
276270

277271
Query spanQuery = new Query(Exit.COLUMN_NAME_OBJECT_TYPE, Exit.TYPE_SPAN);
278272
spanQuery.getWheres().put(spanQuery.getWheres().size(), Synchronizable.getActiveParams());
279-
spanQuery.addWhere(Exit.COLUMN_NAME_GLOBAL_ID, null);
280273

281274
Query earthQuery = new Query(Exit.COLUMN_NAME_OBJECT_TYPE, Exit.TYPE_EARTH);
282275
earthQuery.getWheres().put(earthQuery.getWheres().size(), Synchronizable.getActiveParams());
283-
earthQuery.addWhere(Exit.COLUMN_NAME_GLOBAL_ID, null);
284276

285277
Query otherQuery = new Query(Exit.COLUMN_NAME_OBJECT_TYPE, Exit.TYPE_OTHER);
286278
otherQuery.getWheres().put(otherQuery.getWheres().size(), Synchronizable.getActiveParams());
287-
otherQuery.addWhere(Exit.COLUMN_NAME_GLOBAL_ID, null);
288279

289280
int buildings = new Exit().count(buildingQuery.getParams());
290281
int antennas = new Exit().count(antennaQuery.getParams());
Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,56 @@
11
package mavonie.subterminal;
22

33
import android.os.Bundle;
4-
import android.support.v4.app.Fragment;
5-
import android.support.v4.app.FragmentTabHost;
4+
import android.support.annotation.NonNull;
5+
import android.support.v7.widget.LinearLayoutManager;
6+
import android.support.v7.widget.RecyclerView;
67
import android.view.LayoutInflater;
78
import android.view.View;
89
import android.view.ViewGroup;
910

10-
public class Exit extends Fragment {
11+
import mavonie.subterminal.Models.Model;
12+
import mavonie.subterminal.Models.Synchronizable;
13+
import mavonie.subterminal.Utils.BaseFragment;
14+
import mavonie.subterminal.Utils.DB.Query;
15+
import mavonie.subterminal.ViewAdapters.ExitRecycler;
1116

12-
private FragmentTabHost mTabHost;
13-
14-
public static final String TAB = "TAB";
15-
16-
public static final int TAB_MY_EXITS = 0;
17-
public static final int TAB_ALL_EXITS = 1;
17+
/**
18+
* Exit list fragment
19+
*/
20+
public class Exit extends BaseFragment {
1821

22+
@Override
1923
public View onCreateView(LayoutInflater inflater, ViewGroup container,
2024
Bundle savedInstanceState) {
25+
View view = inflater.inflate(R.layout.fragment_exit_list, container, false);
26+
27+
RecyclerView recyclerView = (RecyclerView) view;
28+
recyclerView.setLayoutManager(new LinearLayoutManager(view.getContext()));
29+
recyclerView.setAdapter(new ExitRecycler(new mavonie.subterminal.Models.Exit().getItems(getQuery().getParams()), getmListener()));
2130

22-
View rootView = inflater.inflate(R.layout.fragment_tabs, container, false);
31+
return view;
32+
}
2333

34+
@NonNull
35+
private Query getQuery() {
36+
Query query = new Query();
37+
query.orderDir(mavonie.subterminal.Models.Exit.COLUMN_NAME_NAME, Model.FILTER_ORDER_DIR_ASC);
38+
query.getParams().putAll(Synchronizable.getActiveParams());
2439

25-
mTabHost = (FragmentTabHost) rootView.findViewById(android.R.id.tabhost);
26-
mTabHost.setup(getActivity(), getChildFragmentManager(), R.id.realtabcontent);
40+
return query;
41+
}
2742

28-
Bundle args = new Bundle();
29-
args.putInt(TAB, TAB_MY_EXITS);
43+
@Override
44+
public void onResume() {
45+
super.onResume();
3046

31-
mTabHost.addTab(mTabHost.newTabSpec(Integer.toString(TAB_MY_EXITS)).setIndicator("My Exits"),
32-
ExitTabs.class, args);
33-
mTabHost.addTab(mTabHost.newTabSpec(Integer.toString(TAB_ALL_EXITS)).setIndicator("All"),
34-
ExitTabs.class, null);
47+
// Set title
48+
String title = getString(R.string.title_exit) + " (" + new mavonie.subterminal.Models.Exit().count(getQuery().getParams()) + ")";
49+
MainActivity.getActivity().setTitle(title);
50+
}
3551

36-
return rootView;
52+
@Override
53+
protected String getItemClass() {
54+
return mavonie.subterminal.Models.Exit.class.getCanonicalName();
3755
}
38-
}
56+
}

app/src/main/java/mavonie/subterminal/ExitTabs.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)