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

Commit

Permalink
Merged release-0.7 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmigloz committed Jan 16, 2017
2 parents 8dc27b7 + 984bfa8 commit 30a8a1b
Show file tree
Hide file tree
Showing 45 changed files with 2,982 additions and 100 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ android {
applicationId "com.davidmiguel.gobees"
minSdkVersion 19
targetSdkVersion 25
versionCode 6
versionName "v0.6"
versionCode 7
versionName "v0.7"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -112,8 +112,8 @@ dependencies {
// Dependencies for local unit tests
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-all:2.0.2-beta'
testCompile 'org.slf4j:slf4j-api:1.7.21'
testCompile 'org.slf4j:slf4j-log4j12:1.7.21'
testCompile 'org.slf4j:slf4j-api:1.7.22'
testCompile 'org.slf4j:slf4j-log4j12:1.7.22'
testCompile 'log4j:log4j:1.2.17'
testCompile 'org.json:json:20160810'

Expand All @@ -123,7 +123,7 @@ dependencies {

// Dependencies for Android unit tests
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'org.mockito:mockito-core:2.3.0'
androidTestCompile 'org.mockito:mockito-core:2.5.5'

// Espresso UI Testing
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
Expand Down
36 changes: 30 additions & 6 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
-keep class android.support.test.espresso.IdlingResource { *; }
-keep class com.google.common.base.Preconditions { *; }

# For Guava:
-dontwarn javax.annotation.**
-dontwarn javax.inject.**
-dontwarn sun.misc.Unsafe

# Proguard rules that are applied to your test apk/code.
-ignorewarnings

Expand All @@ -23,5 +18,34 @@
-dontwarn org.junit.**
-dontwarn org.hamcrest.**
-dontwarn com.squareup.javawriter.JavaWriter

# Uncomment this if you use Mockito
-dontwarn org.mockito.**
-dontwarn org.mockito.**

# Configuration for Guava 18.0
-keep class com.google.common.io.Resources {
public static <methods>;
}
-keep class com.google.common.collect.Lists {
public static ** reverse(**);
}
-keep class com.google.common.base.Charsets {
public static <fields>;
}
-keep class com.google.common.base.Joiner {
public static com.google.common.base.Joiner on(java.lang.String);
public ** join(...);
}
-keepclassmembers class ** {
@com.google.common.eventbus.Subscribe public *;
}
-keep class com.google.common.collect.MapMakerInternalMap$ReferenceEntry
-keep class com.google.common.cache.LocalCache$ReferenceEntry
# http://stackoverflow.com/questions/9120338/proguard-configuration-for-guava-with-obfuscation-and-optimization
-dontwarn javax.annotation.**
-dontwarn javax.inject.**
-dontwarn sun.misc.Unsafe
# Guava 19.0
-dontwarn java.lang.ClassValue
-dontwarn com.google.j2objc.annotations.Weak
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
31 changes: 30 additions & 1 deletion app/proguardTest-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,34 @@
-dontwarn org.junit.**
-dontwarn org.hamcrest.**
-dontwarn com.squareup.javawriter.JavaWriter

# Uncomment this if you use Mockito
-dontwarn org.mockito.**
-dontwarn org.mockito.**

# Configuration for Guava 18.0
-keep class com.google.common.io.Resources {
public static <methods>;
}
-keep class com.google.common.collect.Lists {
public static ** reverse(**);
}
-keep class com.google.common.base.Charsets {
public static <fields>;
}
-keep class com.google.common.base.Joiner {
public static com.google.common.base.Joiner on(java.lang.String);
public ** join(...);
}
-keepclassmembers class ** {
@com.google.common.eventbus.Subscribe public *;
}
-keep class com.google.common.collect.MapMakerInternalMap$ReferenceEntry
-keep class com.google.common.cache.LocalCache$ReferenceEntry
# http://stackoverflow.com/questions/9120338/proguard-configuration-for-guava-with-obfuscation-and-optimization
-dontwarn javax.annotation.**
-dontwarn javax.inject.**
-dontwarn sun.misc.Unsafe
# Guava 19.0
-dontwarn java.lang.ClassValue
-dontwarn com.google.j2objc.annotations.Weak
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
6 changes: 6 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
<activity
android:name=".settings.SettingsActivity"
android:parentActivityName=".apiaries.ApiariesActivity"/>
<activity
android:name=".about.AboutActivity"
android:parentActivityName=".apiaries.ApiariesActivity"/>
<activity
android:name=".help.HelpActivity"
android:parentActivityName=".apiaries.ApiariesActivity"/>

<service android:name=".monitoring.MonitoringService"/>
</application>
Expand Down
68 changes: 68 additions & 0 deletions app/src/main/java/com/davidmiguel/gobees/about/AboutActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* GoBees
* Copyright (c) 2016 - 2017 David Miguel Lozano
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
*/

package com.davidmiguel.gobees.about;

import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;

import com.davidmiguel.gobees.R;
import com.davidmiguel.gobees.utils.ActivityUtils;

/**
* About GoBees activity.
*/
public class AboutActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about_act);

// Set up the toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setTitle(R.string.about_title);
}

// Add fragment to the activity
AboutFragment aboutFragment =
(AboutFragment) getSupportFragmentManager().findFragmentById(R.id.contentFrame);
if (aboutFragment == null) {
// Create the fragment
aboutFragment = AboutFragment.newInstance();
ActivityUtils.addFragmentToActivity(
getSupportFragmentManager(), aboutFragment, R.id.contentFrame);
}

// Create the presenter
new AboutPresenter(aboutFragment);
}

@Override
public boolean onSupportNavigateUp() {
onBackPressed();
return true;
}
}
92 changes: 92 additions & 0 deletions app/src/main/java/com/davidmiguel/gobees/about/AboutContract.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* GoBees
* Copyright (c) 2016 - 2017 David Miguel Lozano
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
*/

package com.davidmiguel.gobees.about;

import com.davidmiguel.gobees.utils.BasePresenter;
import com.davidmiguel.gobees.utils.BaseView;

import java.util.List;

/**
* This specifies the contract between the view and the presenter.
*/
interface AboutContract {

interface View extends BaseView<AboutContract.Presenter> {

/**
* Shows app verion.
*
* @param version vresion number.
*/
void showVersion(String version);

/**
* Opens website.
*
* @param url website url.
*/
void openWebsite(int url);

/**
* Opens a modal window with the changelog.
*
* @param title title.
* @param changelog data.
*/
void openChangelog(int title, int changelog);

/**
* Opens a modal window with the license text.
*
* @param title modal title.
* @param license license text.
*/
void openLicence(String title, int license);

/**
* Shows list of libraries used in the app.
*
* @param libraries list of libraries.
*/
void showLibraries(List<Library> libraries);

}

interface Presenter extends BasePresenter {

/**
* When website button is clicked.
*/
void onWebsiteClicked();

/**
* When changelog button is clicked.
*/
void onChangelogClicked();

/**
* When a license button is clicked.
*
* @param license type of license.
*/
void onLicenseClicked(Library.License license);

}
}
Loading

0 comments on commit 30a8a1b

Please sign in to comment.