Skip to content

Commit

Permalink
Finish Release-1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
riggaroo committed Apr 30, 2016
2 parents adccd70 + df1df7f commit fbd962c
Show file tree
Hide file tree
Showing 23 changed files with 348 additions and 217 deletions.
7 changes: 4 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ android {
applicationId "org.bookdash.android"
minSdkVersion 16
targetSdkVersion 23
versionCode 18
versionName "1.1.0"
versionCode 19
versionName "1.1.1"
testInstrumentationRunner "org.bookdash.android.presentation.CustomTestRunner"
buildConfigField "String", "PARSE_APPLICATION_ID", "\"${BOOKDASH_PARSE_APP_ID}\""
buildConfigField "String", "PARSE_CLIENT_KEY", "\"${BOOKDASH_PARSE_CLIENT_ID}\""
Expand Down Expand Up @@ -102,9 +102,10 @@ android {
testCoverageEnabled = true
}
}

play {
jsonFile = rootProject.file('google-play-keys.json')
track = 'alpha'
track = "${track}"
}
}

Expand Down
42 changes: 4 additions & 38 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<activity
android:name=".presentation.main.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme.NoActionBar">

</activity>
<activity
Expand All @@ -44,7 +44,7 @@
<activity
android:name="org.bookdash.android.presentation.bookinfo.BookInfoActivity"
android:label=""
android:theme="@style/AppTheme"
android:theme="@style/AppTheme.NoActionBar"
>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
Expand Down Expand Up @@ -76,7 +76,7 @@
<activity
android:name="org.bookdash.android.presentation.splash.SplashActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

Expand All @@ -87,45 +87,11 @@
<activity
android:name="za.co.riggaroo.materialhelptutorial.tutorial.MaterialTutorialActivity"
android:label="@string/tutorial_screen"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme.NoActionBar">
</activity>

<service android:name="com.parse.PushService"/>

<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.USER_PRESENT"/>
</intent-filter>
</receiver>
<receiver
android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>

<!--
IMPORTANT: Change "com.parse.tutorials.pushnotifications" to match your app's package name.
-->
<category android:name="org.bookdash.bookdash"/>
</intent-filter>
</receiver>
<receiver
android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE"/>
<action android:name="com.parse.push.intent.DELETE"/>
<action android:name="com.parse.push.intent.OPEN"/>
</intent-filter>
</receiver>
<!-- replace @drawable/push_icon with your push icon identifier -->
<meta-data
android:name="com.parse.push.notification_icon"
android:resource="@drawable/ic_stat_book"/>
<!-- ATTENTION: This was auto-generated to add Google Play services to your project for
App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information. -->
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,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.orderByAscending(Language.LANGUAGE_ORDER);
queryLanguages.findInBackground(new FindCallback<Language>() {
@Override
public void done(List<Language> list, ParseException e) {
Expand Down Expand Up @@ -215,7 +215,7 @@ public Void call() throws Exception {
@WorkerThread
private void deleteLocalBook(BookDetail bookDetail) {
FileManager.deleteFolder(bookDetail.getFolderLocation());
FileManager.deleteFolder(BookDashApplication.FILES_DIR + "/" + bookDetail.getObjectId());
FileManager.deleteFolder(BookDashApplication.FILES_DIR + "/" + bookDetail.getObjectId());
}

private void getBookPages(final BookDetail bookInfo, final byte[] bytes, final BookServiceCallback<BookPages> bookServiceCallback) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class Language extends ParseObject {
public static final String LANG_CODE_COL = "language_abbreviation";
public static final String LANG_NAME_COL = "language_name";
public static final String LANGUAGE_ID = "language_id";
public static final String LANGUAGE_ORDER = "language_order";

public Language() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.OvershootInterpolator;
import android.widget.Button;
Expand Down Expand Up @@ -163,7 +162,7 @@ public void onClick(View v) {
if (!bookInfo.isDownloadedAlready()) {
floatingActionButton.resetIcon();
floatingActionButton.showProgress(true);
floatingActionButton.setProgress(0, true);
floatingActionButton.setProgress(0, false);
}
actionsListener.downloadBook(bookInfo);
}
Expand Down Expand Up @@ -247,8 +246,6 @@ private void enterAnimation() {
floatingActionButton.setScaleX(0);
floatingActionButton.setScaleY(0);
floatingActionButton.animate().setStartDelay(500).scaleY(1).scaleX(1).setInterpolator(new OvershootInterpolator()).setDuration(getResources().getInteger(android.R.integer.config_mediumAnimTime)).start();


}


Expand Down Expand Up @@ -317,7 +314,7 @@ public void showDownloadProgress(final int downloadProgress) {
runOnUiThread(new Runnable() {
@Override
public void run() {
floatingActionButton.setProgress(downloadProgress, true);
floatingActionButton.setProgress(downloadProgress, false);
}
});

Expand Down Expand Up @@ -405,8 +402,6 @@ public void setStatusBarColor(int color) {

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
// window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(color);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.SimpleTarget;

import org.bookdash.android.BookDashApplication;
import org.bookdash.android.R;
import org.bookdash.android.data.books.BookDetailRepository;
import org.bookdash.android.domain.pojo.BookContributor;
Expand Down Expand Up @@ -93,7 +92,6 @@ public void downloadBook(final BookDetail bookInfo) {
bookInfo.setIsDownloading(true);



bookDetailRepository.downloadBook(bookInfo, new BookDetailRepository.GetBookPagesCallback() {
@Override
public void onBookPagesLoaded(BookPages bookPages) {
Expand Down Expand Up @@ -162,6 +160,10 @@ public void onGenerated(Palette palette) {
darkerShade[2] = darkerShade[2] * 0.8f; //Make it a darker shade for the status bar
booksView.setStatusBarColor(ColorUtils.HSLToColor(darkerShade));

} else {

booksView.setStatusBarColor(ContextCompat.getColor(context.getApplicationContext(), R.color.colorPrimaryDark));

}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.bookdash.android.domain.pojo.BookDetail;
import org.bookdash.android.presentation.bookinfo.BookInfoActivity;
import org.bookdash.android.presentation.main.NavDrawerInterface;
import org.bookdash.android.presentation.widget.SpacesItemDecoration;

import java.util.List;

Expand All @@ -42,11 +41,10 @@ public class ListBooksFragment extends Fragment implements ListBooksContract.Vie
private static final int BOOK_DETAIL_REQUEST_CODE = 43;
private ListBooksContract.UserActionsListener actionsListener;
private Button buttonRetry;
private RecyclerView mRecyclerView;
private RecyclerView recyclerViewBooks;
private CircularProgressBar circularProgressBar;
private LinearLayout linearLayoutErrorScreen;
private TextView textViewErrorMessage;
private Toolbar toolbar;
private NavDrawerInterface navDrawerInterface;
private BookAdapter bookAdapter;

Expand All @@ -69,18 +67,16 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
linearLayoutErrorScreen = (LinearLayout) view.findViewById(R.id.linear_layout_error);
buttonRetry = (Button) view.findViewById(R.id.button_retry);
textViewErrorMessage = (TextView) view.findViewById(R.id.text_view_error_screen);
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view_books);
mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), getContext().getResources().getInteger(R.integer.book_span)));
mRecyclerView.setHasFixedSize(true);
mRecyclerView.addItemDecoration(new SpacesItemDecoration(getResources().getInteger(R.integer.list_books_space)));
recyclerViewBooks = (RecyclerView) view.findViewById(R.id.recycler_view_books);
recyclerViewBooks.setLayoutManager(new GridLayoutManager(getActivity(), getContext().getResources().getInteger(R.integer.book_span)));
buttonRetry.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d(TAG, "Retry button clicked");
actionsListener.loadBooksForLanguagePreference();
}
});
toolbar = (Toolbar) view.findViewById(R.id.toolbar);
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
if (navDrawerInterface != null) {
navDrawerInterface.setToolbar(toolbar);
}
Expand Down Expand Up @@ -132,8 +128,10 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
public void showErrorScreen(boolean show, String errorMessage, boolean showRetryButton) {
if (show) {
linearLayoutErrorScreen.setVisibility(View.VISIBLE);
recyclerViewBooks.setVisibility(View.GONE);
} else {
linearLayoutErrorScreen.setVisibility(View.GONE);
recyclerViewBooks.setVisibility(View.VISIBLE);
}
buttonRetry.setVisibility(showRetryButton ? View.VISIBLE : View.GONE);
textViewErrorMessage.setText(errorMessage);
Expand All @@ -143,7 +141,7 @@ public void showErrorScreen(boolean show, String errorMessage, boolean showRetry
@Override
public void showLoading(boolean visible) {
circularProgressBar.setVisibility(visible ? View.VISIBLE : View.GONE);
mRecyclerView.setVisibility(visible ? View.GONE : View.VISIBLE);
recyclerViewBooks.setVisibility(visible ? View.GONE : View.VISIBLE);

}

Expand All @@ -153,13 +151,13 @@ public void showBooks(List<BookDetail> bookDetailList) {
showErrorScreen(true, getString(R.string.no_books_available), true);
}
bookAdapter = new BookAdapter(bookDetailList, ListBooksFragment.this.getActivity(), bookClickListener);
mRecyclerView.setAdapter(bookAdapter);
recyclerViewBooks.setAdapter(bookAdapter);

}

@Override
public void showSnackBarError(int message) {
Snackbar.make(mRecyclerView, message, Snackbar.LENGTH_LONG).show();
Snackbar.make(recyclerViewBooks, message, Snackbar.LENGTH_LONG).show();
}

private DialogInterface.OnClickListener languageClickListener = new DialogInterface.OnClickListener() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.bookdash.android.presentation.listbooks;
package org.bookdash.android.presentation.view;

import android.content.Context;
import android.util.AttributeSet;
Expand Down

This file was deleted.

Binary file removed app/src/main/res/drawable-hdpi/bookdashlogo.png
Binary file not shown.
Loading

0 comments on commit fbd962c

Please sign in to comment.