Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit 30a8a1b

Browse files
committed
Merged release-0.7 into master
2 parents 8dc27b7 + 984bfa8 commit 30a8a1b

Some content is hidden

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

45 files changed

+2982
-100
lines changed

app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ android {
2828
applicationId "com.davidmiguel.gobees"
2929
minSdkVersion 19
3030
targetSdkVersion 25
31-
versionCode 6
32-
versionName "v0.6"
31+
versionCode 7
32+
versionName "v0.7"
3333

3434
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3535
}
@@ -112,8 +112,8 @@ dependencies {
112112
// Dependencies for local unit tests
113113
testCompile 'junit:junit:4.12'
114114
testCompile 'org.mockito:mockito-all:2.0.2-beta'
115-
testCompile 'org.slf4j:slf4j-api:1.7.21'
116-
testCompile 'org.slf4j:slf4j-log4j12:1.7.21'
115+
testCompile 'org.slf4j:slf4j-api:1.7.22'
116+
testCompile 'org.slf4j:slf4j-log4j12:1.7.22'
117117
testCompile 'log4j:log4j:1.2.17'
118118
testCompile 'org.json:json:20160810'
119119

@@ -123,7 +123,7 @@ dependencies {
123123

124124
// Dependencies for Android unit tests
125125
androidTestCompile 'junit:junit:4.12'
126-
androidTestCompile 'org.mockito:mockito-core:2.3.0'
126+
androidTestCompile 'org.mockito:mockito-core:2.5.5'
127127

128128
// Espresso UI Testing
129129
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'

app/proguard-rules.pro

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
-keep class android.support.test.espresso.IdlingResource { *; }
66
-keep class com.google.common.base.Preconditions { *; }
77

8-
# For Guava:
9-
-dontwarn javax.annotation.**
10-
-dontwarn javax.inject.**
11-
-dontwarn sun.misc.Unsafe
12-
138
# Proguard rules that are applied to your test apk/code.
149
-ignorewarnings
1510

@@ -23,5 +18,34 @@
2318
-dontwarn org.junit.**
2419
-dontwarn org.hamcrest.**
2520
-dontwarn com.squareup.javawriter.JavaWriter
21+
2622
# Uncomment this if you use Mockito
27-
-dontwarn org.mockito.**
23+
-dontwarn org.mockito.**
24+
25+
# Configuration for Guava 18.0
26+
-keep class com.google.common.io.Resources {
27+
public static <methods>;
28+
}
29+
-keep class com.google.common.collect.Lists {
30+
public static ** reverse(**);
31+
}
32+
-keep class com.google.common.base.Charsets {
33+
public static <fields>;
34+
}
35+
-keep class com.google.common.base.Joiner {
36+
public static com.google.common.base.Joiner on(java.lang.String);
37+
public ** join(...);
38+
}
39+
-keepclassmembers class ** {
40+
@com.google.common.eventbus.Subscribe public *;
41+
}
42+
-keep class com.google.common.collect.MapMakerInternalMap$ReferenceEntry
43+
-keep class com.google.common.cache.LocalCache$ReferenceEntry
44+
# http://stackoverflow.com/questions/9120338/proguard-configuration-for-guava-with-obfuscation-and-optimization
45+
-dontwarn javax.annotation.**
46+
-dontwarn javax.inject.**
47+
-dontwarn sun.misc.Unsafe
48+
# Guava 19.0
49+
-dontwarn java.lang.ClassValue
50+
-dontwarn com.google.j2objc.annotations.Weak
51+
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

app/proguardTest-rules.pro

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,34 @@
1111
-dontwarn org.junit.**
1212
-dontwarn org.hamcrest.**
1313
-dontwarn com.squareup.javawriter.JavaWriter
14+
1415
# Uncomment this if you use Mockito
15-
-dontwarn org.mockito.**
16+
-dontwarn org.mockito.**
17+
18+
# Configuration for Guava 18.0
19+
-keep class com.google.common.io.Resources {
20+
public static <methods>;
21+
}
22+
-keep class com.google.common.collect.Lists {
23+
public static ** reverse(**);
24+
}
25+
-keep class com.google.common.base.Charsets {
26+
public static <fields>;
27+
}
28+
-keep class com.google.common.base.Joiner {
29+
public static com.google.common.base.Joiner on(java.lang.String);
30+
public ** join(...);
31+
}
32+
-keepclassmembers class ** {
33+
@com.google.common.eventbus.Subscribe public *;
34+
}
35+
-keep class com.google.common.collect.MapMakerInternalMap$ReferenceEntry
36+
-keep class com.google.common.cache.LocalCache$ReferenceEntry
37+
# http://stackoverflow.com/questions/9120338/proguard-configuration-for-guava-with-obfuscation-and-optimization
38+
-dontwarn javax.annotation.**
39+
-dontwarn javax.inject.**
40+
-dontwarn sun.misc.Unsafe
41+
# Guava 19.0
42+
-dontwarn java.lang.ClassValue
43+
-dontwarn com.google.j2objc.annotations.Weak
44+
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757
<activity
5858
android:name=".settings.SettingsActivity"
5959
android:parentActivityName=".apiaries.ApiariesActivity"/>
60+
<activity
61+
android:name=".about.AboutActivity"
62+
android:parentActivityName=".apiaries.ApiariesActivity"/>
63+
<activity
64+
android:name=".help.HelpActivity"
65+
android:parentActivityName=".apiaries.ApiariesActivity"/>
6066

6167
<service android:name=".monitoring.MonitoringService"/>
6268
</application>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* GoBees
3+
* Copyright (c) 2016 - 2017 David Miguel Lozano
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
17+
*/
18+
19+
package com.davidmiguel.gobees.about;
20+
21+
import android.os.Bundle;
22+
import android.support.v7.app.ActionBar;
23+
import android.support.v7.app.AppCompatActivity;
24+
import android.support.v7.widget.Toolbar;
25+
26+
import com.davidmiguel.gobees.R;
27+
import com.davidmiguel.gobees.utils.ActivityUtils;
28+
29+
/**
30+
* About GoBees activity.
31+
*/
32+
public class AboutActivity extends AppCompatActivity {
33+
34+
@Override
35+
protected void onCreate(Bundle savedInstanceState) {
36+
super.onCreate(savedInstanceState);
37+
setContentView(R.layout.about_act);
38+
39+
// Set up the toolbar
40+
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
41+
setSupportActionBar(toolbar);
42+
ActionBar actionBar = getSupportActionBar();
43+
if (actionBar != null) {
44+
actionBar.setDisplayHomeAsUpEnabled(true);
45+
actionBar.setDisplayShowHomeEnabled(true);
46+
actionBar.setTitle(R.string.about_title);
47+
}
48+
49+
// Add fragment to the activity
50+
AboutFragment aboutFragment =
51+
(AboutFragment) getSupportFragmentManager().findFragmentById(R.id.contentFrame);
52+
if (aboutFragment == null) {
53+
// Create the fragment
54+
aboutFragment = AboutFragment.newInstance();
55+
ActivityUtils.addFragmentToActivity(
56+
getSupportFragmentManager(), aboutFragment, R.id.contentFrame);
57+
}
58+
59+
// Create the presenter
60+
new AboutPresenter(aboutFragment);
61+
}
62+
63+
@Override
64+
public boolean onSupportNavigateUp() {
65+
onBackPressed();
66+
return true;
67+
}
68+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* GoBees
3+
* Copyright (c) 2016 - 2017 David Miguel Lozano
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
17+
*/
18+
19+
package com.davidmiguel.gobees.about;
20+
21+
import com.davidmiguel.gobees.utils.BasePresenter;
22+
import com.davidmiguel.gobees.utils.BaseView;
23+
24+
import java.util.List;
25+
26+
/**
27+
* This specifies the contract between the view and the presenter.
28+
*/
29+
interface AboutContract {
30+
31+
interface View extends BaseView<AboutContract.Presenter> {
32+
33+
/**
34+
* Shows app verion.
35+
*
36+
* @param version vresion number.
37+
*/
38+
void showVersion(String version);
39+
40+
/**
41+
* Opens website.
42+
*
43+
* @param url website url.
44+
*/
45+
void openWebsite(int url);
46+
47+
/**
48+
* Opens a modal window with the changelog.
49+
*
50+
* @param title title.
51+
* @param changelog data.
52+
*/
53+
void openChangelog(int title, int changelog);
54+
55+
/**
56+
* Opens a modal window with the license text.
57+
*
58+
* @param title modal title.
59+
* @param license license text.
60+
*/
61+
void openLicence(String title, int license);
62+
63+
/**
64+
* Shows list of libraries used in the app.
65+
*
66+
* @param libraries list of libraries.
67+
*/
68+
void showLibraries(List<Library> libraries);
69+
70+
}
71+
72+
interface Presenter extends BasePresenter {
73+
74+
/**
75+
* When website button is clicked.
76+
*/
77+
void onWebsiteClicked();
78+
79+
/**
80+
* When changelog button is clicked.
81+
*/
82+
void onChangelogClicked();
83+
84+
/**
85+
* When a license button is clicked.
86+
*
87+
* @param license type of license.
88+
*/
89+
void onLicenseClicked(Library.License license);
90+
91+
}
92+
}

0 commit comments

Comments
 (0)