Skip to content

Commit

Permalink
Finish Release-1.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
riggaroo committed Jan 3, 2016
2 parents d4fb4aa + 001e432 commit 0384275
Show file tree
Hide file tree
Showing 82 changed files with 935 additions and 353 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: android
android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
- platform-tools
- tools

# The BuildTools version used by your project
- build-tools-23.0.2

# The SDK version used to compile your project
- android-23

# Additional components
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ http://bookdash.org/
/parse_data_example/
If you want to download the actual books, you need to individually download each book and import the files into the parse manually. See the information here: https://www.parse.com/questions/exporting-file-objects-and-importing-to-another-application

4. Change the Parse API Key and Client Key in the file to your unique parse key: /appconfig-sample.properties .
4. Change the Parse API Key and Client Key in the file to your unique parse key: /gradle.properties .
5. Setup a Fabric Account. https://fabric.io/dashboard
6. Get your Fabric API Key and Client key, change it in the file: /app/fabric-sample.properties
7. If you wish to build a release version you will need to create your own keystore file and edit the password values in the following file - (create a version of the file without the .sample extension): release-keystore.properties.sample
6. Get your Fabric API Key and Client key, change it in the file: /app/fabric-sample.properties and rename the file to fabric.properties
7. Go generate a google-services.json file by following the instructions here: https://developers.google.com/mobile/add?platform=android
You will need to select App Invites API and Google Analytics and enter your SHA-1 of your debug keystore.
8. If you wish to build a release version you will need to create your own keystore file and edit the password values in the following file - (create a version of the file without the .sample extension): release-keystore.properties.sample

# License
Copyright 2015 Book Dash.
Expand Down
50 changes: 26 additions & 24 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,40 @@ repositories {
}


def appConfig = new Properties()

appConfig.load(new FileInputStream(rootProject.file("appconfig.properties")))

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "org.bookdash.android"
minSdkVersion 16
targetSdkVersion 23
versionCode 11
versionName "1.0.11"
versionCode 12
versionName "1.0.12"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "String", "PARSE_APPLICATION_ID", "\"${BOOKDASH_PARSE_APP_ID}\""
buildConfigField "String", "PARSE_CLIENT_KEY", "\"${BOOKDASH_PARSE_CLIENT_ID}\""

}
signingConfigs {
release {
def props = new Properties()
File signFile = rootProject.file('release-keystore.properties')
if (signFile.exists()) {
signingConfigs {
release {
def props = new Properties()

props.load(new FileInputStream(rootProject.file("release-keystore.properties")))
props.load(new FileInputStream(signFile))

storeFile rootProject.file(props.keyStore)
storePassword props.keyStorePassword
keyAlias props.keyAlias
keyPassword props.keyAliasPassword
storeFile rootProject.file(props.keyStore)
storePassword props.keyStorePassword
keyAlias props.keyAlias
keyPassword props.keyAliasPassword
}
}
buildTypes.release.signingConfig signingConfigs.release

}

packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
Expand All @@ -61,7 +67,6 @@ android {

productFlavors {
mock {
applicationIdSuffix = ".mock"
}
prod {

Expand All @@ -84,16 +89,11 @@ android {
buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-project.txt'
signingConfig signingConfigs.release
buildConfigField "String", "PARSE_APPLICATION_ID", appConfig.PARSE_APPLICATION_ID
buildConfigField "String", "PARSE_CLIENT_KEY", appConfig.PARSE_CLIENT_KEY
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro'
ext.enableCrashlytics = true
}
debug {
buildConfigField "String", "PARSE_APPLICATION_ID", appConfig.PARSE_APPLICATION_ID
buildConfigField "String", "PARSE_CLIENT_KEY", appConfig.PARSE_CLIENT_KEY
ext.enableCrashlytics = false
// Run code coverage reports by default on debug builds.
testCoverageEnabled = true
Expand Down Expand Up @@ -141,7 +141,6 @@ dependencies {
exclude module: 'support-annotations'
exclude module: 'support-v4'
}
compile 'com.google.android.gms:play-services-analytics:8.3.0'

compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':fabbutton')
Expand All @@ -162,5 +161,8 @@ dependencies {
transitive = true;
}
compile 'za.co.riggaroo:materialhelptutorial:1.0.3'
compile 'com.google.android.gms:play-services-appindexing:8.3.0'
compile "com.google.android.gms:play-services-appinvite:$rootProject.ext.googlePlayServicesVersion"
compile "com.google.android.gms:play-services-appindexing:$rootProject.ext.googlePlayServicesVersion"
compile "com.android.support:design:$rootProject.ext.googlePlayServicesVersion"
compile "com.google.android.gms:play-services-analytics:$rootProject.ext.googlePlayServicesVersion"
}
38 changes: 37 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,41 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-ignorewarnings

-keep class me.zhanghai.android.materialprogressbar.** { *; }
-keep class com.joanzapata.** { *; }
-keep class com.joanzapata.** { *; }
-keep class com.parse.** { *; }




-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
}

-keep class com.crashlytics.** { *; }
-keep class com.crashlytics.android.**
-keepattributes SourceFile,LineNumberTable

-keepattributes Signature
-keepattributes InnerClass
-keep class com.squareup.okhttp.** {*;}
-keep class za.co.riggaroo.materialhelptutorial.view.** { *;}
-keep class mbanje.kurt.fabbutton.** {*;}
-keep class com.google.android.gms.** {*;}
-keep class android.support.v7.** {*;}

-keep class android.support.design.** {*;}
-keep class android.support.v4.** {*;}
# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-keep class sun.misc.Unsafe { *; }
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class org.bookdash.android.domain.pojo.gson.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import android.text.Html;
import android.view.View;

import junit.framework.Assert;

import org.bookdash.android.R;
import org.junit.After;
import org.junit.Before;
Expand Down Expand Up @@ -71,11 +73,15 @@ public void loadAboutBookDash_SeeInformation() throws Throwable {
@Test
public void clickLearnMore_OpenBrowser() throws Throwable {

onView(withText("LEARN MORE")).perform(scrollTo(),click());
onView(withText(R.string.learn_more)).perform(scrollTo(), click());

intended(allOf(hasAction(Intent.ACTION_VIEW),
hasData(Uri.parse("http://bookdash.org"))
)
);
}
@Test
public void testGetScreenName(){
Assert.assertEquals("About Screen",testRule.getActivity().getScreenName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Intent;
import android.net.Uri;
import android.support.design.widget.NavigationView;
import android.support.test.InstrumentationRegistry;
import android.support.test.espresso.intent.Intents;
import android.support.test.rule.ActivityTestRule;
Expand All @@ -28,6 +29,7 @@
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasData;
import static android.support.test.espresso.matcher.RootMatchers.isDialog;
import static android.support.test.espresso.matcher.RootMatchers.*;
import static android.support.test.espresso.matcher.ViewMatchers.isClickable;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
Expand Down Expand Up @@ -61,31 +63,27 @@ public void tearDown() {
Intents.release();
}

@Test
public void languageItemClick_ShowLanguageChooser() {
onView(withId(R.id.action_language_choice)).perform(click());
//Then
onView(withText(R.string.language_selection_heading)).inRoot(isDialog()).check(matches(isDisplayed()));
}

@Test
public void aboutMenuClick_ShowAboutBookDashScreen() {
//Given
openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext());

//When
String title = InstrumentationRegistry.getTargetContext().getString(R.string.action_about);
onView(withText(title)).perform(click());

selectNavDrawItem(R.id.action_about);
//Then
intended(hasComponent(AboutActivity.class.getName()));
}



@Test
public void rateThisAppClick_ShowPlayStoreDetail() {
//Given
openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext());

//When
String title = InstrumentationRegistry.getTargetContext().getString(R.string.rate_this_app);
onView(withText(title)).perform(click());

selectNavDrawItem(R.id.action_rate_app);
//Then
intended(allOf(hasAction(Intent.ACTION_VIEW),
hasData(Uri.parse("market://details?id=" + org.bookdash.android.BuildConfig.APPLICATION_ID))
Expand All @@ -95,29 +93,35 @@ public void rateThisAppClick_ShowPlayStoreDetail() {

@Test
public void contributorsClicked_ShowThanksPopover() {
//Given
openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext());

//When
String title = InstrumentationRegistry.getTargetContext().getString(R.string.settings_thank_yous);
onView(withText(title)).perform(click());

selectNavDrawItem(R.id.action_thanks);
//Then
onView(withText("Contributors")).inRoot(isDialog()).check(matches(isDisplayed()));

}

@Test
public void contributorsOkClick_HideThanksPopover() {
//Given
openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext());

//When
String title = InstrumentationRegistry.getTargetContext().getString(R.string.settings_thank_yous);
onView(withText(title)).perform(click());
selectNavDrawItem(R.id.action_thanks);

//Then
onView(withText(android.R.string.ok)).perform(click());

}

// Due to the NavigationItem not being exposed, we have to do this work around to test NavigationView
// https://code.google.com/p/android/issues/detail?id=187701
public void selectNavDrawItem(final int navItemId){
onView(allOf(withContentDescription(containsString("Navigate up")), isClickable())).perform(click());
final NavigationView navigation =(NavigationView) mActivityTestRule.getActivity().findViewById(R.id.navigation_view);
mActivityTestRule.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
navigation.getMenu().performIdentifierAction(navItemId, 0);
navigation.setCheckedItem(navItemId);
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.bookdash.android.mock.test.BuildConfig;
import org.bookdash.android.test.BuildConfig;


import static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.support.design.widget.NavigationView;
import android.support.test.InstrumentationRegistry;
import android.support.test.espresso.ViewInteraction;
import android.support.test.espresso.intent.Intents;
Expand All @@ -13,6 +14,8 @@
import android.test.suitebuilder.annotation.LargeTest;
import android.view.MenuItem;

import junit.framework.Assert;

import org.bookdash.android.R;
import org.bookdash.android.data.settings.FakeSettingsApiImpl;
import org.bookdash.android.presentation.about.AboutActivity;
Expand All @@ -25,7 +28,7 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.bookdash.android.mock.test.BuildConfig;
import org.bookdash.android.test.BuildConfig;


import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist;
Expand All @@ -38,7 +41,9 @@
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent;
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasData;
import static android.support.test.espresso.matcher.RootMatchers.isDialog;
import static android.support.test.espresso.matcher.ViewMatchers.isClickable;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static android.support.test.espresso.action.ViewActions.click;
Expand Down Expand Up @@ -102,11 +107,11 @@ public void openScreen_AppBarTitleIsCorrect() {
matchToolbarTitle("Book Dash");
}


@Test
public void chooseDifferentLanguage_NewBooksLoaded(){
openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext());
String title = InstrumentationRegistry.getTargetContext().getString(R.string.action_language_choice);
onView(withText(title)).perform(click());
// selectNavDrawItem(R.id.action_language_choice);
onView(withId(R.id.action_language_choice)).perform(click());

//When
onView(withText("Zulu")).perform(click());
Expand All @@ -118,6 +123,10 @@ public void chooseDifferentLanguage_NewBooksLoaded(){
onView(withText("Why is Nita Upside Down?")).check(doesNotExist());
}

@Test
public void testGetScreenName_IsBookListing(){
Assert.assertEquals("BookListingScreen", activityTestRule.getActivity().getScreenName());
}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.bookdash.android.mock.test.BuildConfig;
import org.bookdash.android.test.BuildConfig;


import static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom;
Expand Down
Loading

0 comments on commit 0384275

Please sign in to comment.