Skip to content

Commit

Permalink
Change display of "extra pages not found" to progress bar becoming gr…
Browse files Browse the repository at this point in the history
…een when completed
  • Loading branch information
RobbWatershed committed Nov 16, 2021
1 parent 932ea47 commit eae8853
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.Animatable;
Expand Down Expand Up @@ -372,7 +373,8 @@ public void onDownloadPreparationEvent(DownloadPreparationEvent event) {
) {
progressBar.setMax(event.total);
progressBar.setProgress(event.done);
progressBar.setVisibility(event.isCompleted() ? View.GONE : View.VISIBLE);
progressBar.setProgressTintList(ColorStateList.valueOf(getResources().getColor(R.color.secondary_light)));
progressBar.setVisibility(View.VISIBLE);
}
}

Expand Down Expand Up @@ -1154,11 +1156,11 @@ private void onSearchForExtraImagesSuccess(
@NonNull final Content onlineContent,
@NonNull final List<ImageFile> additionalImages) {
searchExtraImagesdisposable.dispose();
if (additionalImages.isEmpty()) {
ToastHelper.toast(R.string.no_extra_page);
return;
}
if (null == currentContent) return;
progressBar.setProgress(progressBar.getMax());
progressBar.setVisibility(View.VISIBLE);
progressBar.setProgressTintList(ColorStateList.valueOf(getResources().getColor(R.color.green)));

if (null == currentContent || additionalImages.isEmpty()) return;

if (currentContent.getUrl().equalsIgnoreCase(onlineContent.getUrl()) || duplicateId == storedContent.getId()) { // User hasn't left the book page since
// Retrieve the URLs of stored pages
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/colors-palette.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@
<!-- Alert colors -->
<color name="orange">@android:color/holo_orange_dark</color>
<color name="red">@android:color/holo_red_dark</color>

<!-- Green -->
<color name="green">#70AD47</color>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@
<string name="bookmark_copy_url">Copy bookmark URL to clipboard</string>
<string name="alert_unwanted_tags">This book is tagged with %s</string>
<string name="bookmark_homepage">Homepage</string>
<string name="no_extra_page">No extra pages found</string>
<!-- Web browser (site specifics) -->
<string name="help_web_fakku_account">Please use or create a legit Fakku account.\nHentoid won\'t work without.</string>
<string name="help_web_fakku_premium">That book can\'t be viewed with your current Fakku access.</string>
Expand Down

0 comments on commit eae8853

Please sign in to comment.