Skip to content

Commit

Permalink
Finish Release-1.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
riggaroo committed Nov 29, 2015
2 parents f1c2ce6 + 89c4355 commit fff5d6f
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 123 deletions.
6 changes: 4 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ android {
applicationId "org.bookdash.android"
minSdkVersion 16
targetSdkVersion 23
versionCode 9
versionName "1.0.9"
versionCode 10
versionName "1.0.10"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
Expand Down Expand Up @@ -94,6 +94,7 @@ android {
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 @@ -162,4 +163,5 @@ dependencies {
transitive = true;
}
compile 'za.co.riggaroo:materialhelptutorial:1.0.3'
compile 'com.google.android.gms:play-services-appindexing:8.3.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasAction;
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.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 org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.Matchers.contains;


Expand Down Expand Up @@ -74,18 +76,6 @@ public void aboutMenuClick_ShowAboutBookDashScreen() {
}


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

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

//Then
onView(withText(R.string.language_selection_heading)).inRoot(isDialog()).check(matches(isDisplayed()));
}

@Test
public void rateThisAppClick_ShowPlayStoreDetail() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.util.Log;

import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.core.CrashlyticsCore;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
import com.parse.Parse;
Expand Down Expand Up @@ -33,7 +34,10 @@ public class BookDashApplication extends Application {
public void onCreate() {
super.onCreate();

Fabric.with(this, new Crashlytics());
Crashlytics crashlyticsKit = new Crashlytics.Builder()
.core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build();
Fabric.with(this, crashlyticsKit);

ParseObject.registerSubclass(BookDetail.class);
ParseObject.registerSubclass(Language.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@
*/
public class BookDetailApiImpl implements BookDetailApi {

private static final String TAG = "BookDetailApiImpl";
private final Executor DISK_EXECUTOR = Executors.newCachedThreadPool();

@Override
public void getBooksForLanguages(String language, final BookServiceCallback<List<BookDetail>> bookServiceCallback) {
ParseQuery<Language> queryLanguagesNew = ParseQuery.getQuery(Language.class);
queryLanguagesNew.whereEqualTo("language_name", language);
queryLanguagesNew.whereEqualTo(Language.LANG_NAME_COL, language);

ParseQuery<BookDetail> queryBookDetail = ParseQuery.getQuery(BookDetail.class);
queryBookDetail.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ELSE_CACHE);
queryBookDetail.include("book_language");
queryBookDetail.include("book_id");
queryBookDetail.whereEqualTo("book_enabled", true);
queryBookDetail.addDescendingOrder("createdAt");
queryBookDetail.whereMatchesQuery("book_language", queryLanguagesNew);
queryBookDetail.include(BookDetail.BOOK_LANGUAGE_COL);
queryBookDetail.include(BookDetail.BOOK_ID_COL);
queryBookDetail.whereEqualTo(BookDetail.BOOK_ENABLED_COL, true);
queryBookDetail.addDescendingOrder(BookDetail.CREATED_AT_COL);
queryBookDetail.whereMatchesQuery(BookDetail.BOOK_LANGUAGE_COL, queryLanguagesNew);
queryBookDetail.findInBackground(new FindCallback<BookDetail>() {
@Override
public void done(List<BookDetail> list, ParseException e) {
Expand All @@ -62,17 +65,14 @@ public void done(List<BookDetail> list, ParseException e) {
});
}

private static final String TAG = "BookDetailApiImpl";
private final Executor DISK_EXECUTOR = Executors.newCachedThreadPool();

@Override
public void getBookDetail(String bookDetailId, final BookServiceCallback<BookDetail> bookServiceCallback) {
ParseQuery<BookDetail> queryBookDetail = ParseQuery.getQuery(BookDetail.class);
queryBookDetail.whereEqualTo("objectId", bookDetailId);
queryBookDetail.whereEqualTo(BookDetail.OBJECT_ID, bookDetailId);
queryBookDetail.setCachePolicy(ParseQuery.CachePolicy.CACHE_ELSE_NETWORK);
queryBookDetail.include("book_language");
queryBookDetail.include("book_id");
queryBookDetail.whereEqualTo("book_enabled", true);
queryBookDetail.include(BookDetail.BOOK_LANGUAGE_COL);
queryBookDetail.include(BookDetail.BOOK_ID_COL);
queryBookDetail.whereEqualTo(BookDetail.BOOK_ENABLED_COL, true);
queryBookDetail.getFirstInBackground(new GetCallback<BookDetail>() {
@Override
public void done(BookDetail bookDetail, ParseException e) {
Expand All @@ -90,8 +90,8 @@ public void getContributorsForBook(Book bookId, final BookServiceCallback<List<B

ParseQuery<BookContributor> query = ParseQuery.getQuery(BookContributor.class);
query.setCachePolicy(ParseQuery.CachePolicy.CACHE_ELSE_NETWORK);
query.whereEqualTo("book", bookId);
query.include("contributor");
query.whereEqualTo(BookContributor.BOOK_BOOK_COL, bookId);
query.include(BookContributor.BOOK_CONTRIBUTOR_COL);
query.findInBackground(new FindCallback<BookContributor>() {
@Override
public void done(List<BookContributor> list, ParseException e) {
Expand All @@ -111,7 +111,7 @@ public void done(List<BookContributor> list, ParseException e) {
public void getLanguages(final BookServiceCallback<List<Language>> languagesCallback) {
ParseQuery<Language> queryLanguages = ParseQuery.getQuery(Language.class);
queryLanguages.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ELSE_CACHE);

queryLanguages.orderByAscending(Language.LANGUAGE_ID);
queryLanguages.findInBackground(new FindCallback<Language>() {
@Override
public void done(List<Language> list, ParseException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class BookContributor extends ParseObject {
public static final String BOOK_CONTRIBUTOR_TABLE_NAME = "BookContributor";
public static final String BOOK_CONTRIBUTOR_COL = "contributor";
public static final String BOOK_BOOK_COL = "book";

public BookContributor() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class BookDetail extends ParseObject {
public static final String BOOK_ID_COL = "book_id";
public static final String ABOUT_BOOK_COL = "aboutBook";
public static final String OBJECT_ID = "objectId";
public static final String BOOK_ENABLED_COL = "book_enabled";
public static final String CREATED_AT_COL = "createdAt";

public BookDetail() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Language extends ParseObject {

public static final String LANGUAGE_TABLE_NAME = "Language";
public static final String LANG_CODE_COL = "language_abbreviation";
private static final String LANG_NAME_COL = "language_name";
public static final String LANG_NAME_COL = "language_name";
public static final String LANGUAGE_ID = "language_id";

public Language() {
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/activity_book_information.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@
<View
android:id="@+id/toolbar_background_gradient"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_gradient" />
android:layout_height="match_parent" />

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
Expand Down
184 changes: 96 additions & 88 deletions app/src/main/res/layout/fragment_page.xml
Original file line number Diff line number Diff line change
@@ -1,101 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto">

<data>
<import type="android.view.View"/>
<import type="android.text.TextUtils"/>

<import type="android.view.View" />
<import type="android.graphics.Color" />

<import type="android.text.TextUtils" />

<variable
name="page"
type="org.bookdash.android.domain.pojo.gson.Page"/>
type="org.bookdash.android.domain.pojo.gson.Page" />

<variable
name="page2"
type="org.bookdash.android.domain.pojo.gson.Page"/>
type="org.bookdash.android.domain.pojo.gson.Page" />
</data>

<LinearLayout
android:layout_width="match_parent"
android:weightSum="1"
android:orientation="horizontal"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="0dp"
<android.support.percent.PercentRelativeLayout
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:visibility="@{page == null ? View.INVISIBLE : View.VISIBLE}"

android:background="#FFFFFF"
android:orientation="vertical">


<ImageView
android:id="@+id/image_view_page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_weight="0.7"
android:visibility="@{TextUtils.isEmpty(page.image) ? View.GONE : View.VISIBLE}"
app:imageUrl="@{page.image}"/>


<org.bookdash.android.presentation.view.AutoResizeTextView
android:id="@+id/text_view_page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@id/image_view_page"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_margin="8dp"
android:layout_weight="0.3"
android:gravity="center|center_vertical|center_horizontal"
android:text="@{page.htmlText}"
android:textSize="@dimen/text_size_page"
android:fontFamily="sans-serif"
android:visibility="@{TextUtils.isEmpty(page.text) ? View.GONE : View.VISIBLE}"
android:nestedScrollingEnabled="true"
android:breakStrategy="high_quality"
android:hyphenationFrequency="full" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
app:layout_widthPercent="50%"
android:background="#ffffff"
android:visibility="@{page2 == null ? View.INVISIBLE : View.VISIBLE}"

android:layout_weight="0.5"
android:orientation="vertical">


<ImageView
android:id="@+id/image_view_page2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_weight="0.7"
android:visibility="@{TextUtils.isEmpty(page2.image) ? View.GONE : View.VISIBLE}"
app:imageUrl="@{page2.image}"/>


<org.bookdash.android.presentation.view.AutoResizeTextView
android:id="@+id/text_view_page2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@id/image_view_page2"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_margin="8dp"
android:layout_weight="0.3"
android:gravity="center|center_vertical|center_horizontal"
android:text="@{page2.htmlText}"
android:textSize="@dimen/text_size_page"
android:fontFamily="sans-serif"
android:visibility="@{TextUtils.isEmpty(page2.text) ? View.GONE : View.VISIBLE}"
android:nestedScrollingEnabled="true"
android:hyphenationFrequency="full"
android:breakStrategy="high_quality" />
</LinearLayout>
</LinearLayout>
tools:context=".presentation.bookinfo.BookInfoActivity">


<LinearLayout
android:orientation="vertical"
android:id="@+id/lin_layout_page1"
app:layout_aspectRatio="100%"
android:elevation="8dp"
android:layout_centerVertical="true"
android:background="#ffffff"
android:visibility="@{page == null ? View.INVISIBLE : View.VISIBLE}"
app:layout_widthPercent="50%">


<ImageView
android:id="@+id/image_view_page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_weight="0.7"
android:visibility="@{TextUtils.isEmpty(page.image) ? View.GONE : View.VISIBLE}"
app:imageUrl="@{page.image}" />


<org.bookdash.android.presentation.view.AutoResizeTextView
android:id="@+id/text_view_page"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@id/image_view_page"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_margin="8dp"
android:layout_weight="0.3"
android:breakStrategy="high_quality"
android:fontFamily="sans-serif"
android:gravity="center|center_vertical|center_horizontal"
android:hyphenationFrequency="full"
android:nestedScrollingEnabled="true"
android:text="@{page.htmlText}"
android:textSize="@dimen/text_size_page"
android:visibility="@{TextUtils.isEmpty(page.text) ? View.GONE : View.VISIBLE}" />
</LinearLayout>

<LinearLayout
android:layout_toRightOf="@id/lin_layout_page1"
android:layout_toEndOf="@id/lin_layout_page1"
android:orientation="vertical"
app:layout_aspectRatio="100%"
android:layout_centerVertical="true"
android:background="#ffffff"
android:elevation="8dp"
android:visibility="@{page2 == null ? View.INVISIBLE : View.VISIBLE}"
app:layout_widthPercent="50%">


<ImageView
android:id="@+id/image_view_page2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_weight="0.7"
android:visibility="@{TextUtils.isEmpty(page2.image) ? View.GONE : View.VISIBLE}"
app:imageUrl="@{page2.image}" />


<org.bookdash.android.presentation.view.AutoResizeTextView
android:id="@+id/text_view_page2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@id/image_view_page2"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_margin="8dp"
android:layout_weight="0.3"
android:breakStrategy="high_quality"
android:fontFamily="sans-serif"
android:gravity="center|center_vertical|center_horizontal"
android:hyphenationFrequency="full"
android:nestedScrollingEnabled="true"
android:text="@{page2.htmlText}"
android:textSize="@dimen/text_size_page"
android:visibility="@{TextUtils.isEmpty(page2.text) ? View.GONE : View.VISIBLE}" />
</LinearLayout>
</android.support.percent.PercentRelativeLayout>
</layout>
6 changes: 6 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@
<dimen name="fab_margin_top">112dp</dimen>
<dimen name="fab_margin_right_landscape">32dp</dimen>

<dimen name="elevation_micro">2dp</dimen>
<dimen name="elevation_small">4dp</dimen>
<dimen name="elevation_medium">8dp</dimen>
<dimen name="elevation_large">16dp</dimen>


</resources>

0 comments on commit fff5d6f

Please sign in to comment.