diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueAdapter.java b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueAdapter.java index 784d3fba0..df2adff17 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueAdapter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/catalogue/CatalogueAdapter.java @@ -49,6 +49,7 @@ public class CatalogueAdapter extends ArrayAdapter { @Bind(R.id.title) TextView title; @Bind(R.id.author) TextView author; @Bind(R.id.thumbnail) ImageView thumbnail; + @Bind(R.id.favorite_sticker) ImageView favorite_sticker; CatalogueFragment fragment; @@ -73,6 +74,12 @@ public class CatalogueAdapter extends ArrayAdapter { } else { thumbnail.setImageResource(android.R.color.transparent); } + + if(manga.favorite){ + favorite_sticker.setVisibility(View.VISIBLE); + }else{ + favorite_sticker.setVisibility(View.INVISIBLE); + } } } } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java index 1563d86d7..8478188a1 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersFragment.java @@ -15,6 +15,7 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.CheckBox; +import android.widget.ImageView; import java.util.List; @@ -39,9 +40,10 @@ public class ChaptersFragment extends BaseRxFragment implemen @Bind(R.id.swipe_refresh) SwipeRefreshLayout swipeRefresh; @Bind(R.id.toolbar_bottom) Toolbar toolbarBottom; - private MenuItem sortUpBtn; - private MenuItem sortDownBtn; - private CheckBox readCb; + @Bind(R.id.action_sort) ImageView sortBtn; + @Bind(R.id.action_next_unread) ImageView nextUnreadBtn; + @Bind(R.id.action_show_unread) CheckBox readCb; + @Bind(R.id.action_show_downloaded) CheckBox downloadedCb; private ChaptersAdapter adapter; @@ -69,20 +71,11 @@ public class ChaptersFragment extends BaseRxFragment implemen createAdapter(); setSwipeRefreshListener(); - toolbarBottom.inflateMenu(R.menu.chapter_filter); - - sortUpBtn = toolbarBottom.getMenu().findItem(R.id.action_sort_up); - sortDownBtn = toolbarBottom.getMenu().findItem(R.id.action_sort_down); - readCb = (CheckBox) toolbarBottom.findViewById(R.id.action_show_unread); readCb.setOnCheckedChangeListener((arg, isCheked) -> getPresenter().setReadFilter(isCheked)); - toolbarBottom.setOnMenuItemClickListener(arg0 -> { - switch (arg0.getItemId()) { - case R.id.action_sort_up: - case R.id.action_sort_down: - getPresenter().revertSortOrder(); - return true; - } - return false; + sortBtn.setOnClickListener(v->getPresenter().revertSortOrder()); + nextUnreadBtn.setOnClickListener(v->{ + getPresenter().onChapterClicked(getPresenter().getNextUnreadChapter()); + startActivity(ReaderActivity.newIntent(getActivity())); }); return view; } @@ -247,8 +240,9 @@ public class ChaptersFragment extends BaseRxFragment implemen } public void setSortIcon(boolean aToZ) { - if (sortUpBtn != null) sortUpBtn.setVisible(aToZ); - if (sortDownBtn != null) sortDownBtn.setVisible(!aToZ); + if (sortBtn != null) { + sortBtn.setImageResource(!aToZ ? R.drawable.ic_expand_less_white_36dp : R.drawable.ic_expand_more_white_36dp); + } } public void setReadFilter(boolean onlyUnread) { diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java index afdde3f9f..3358e7f23 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/manga/chapter/ChaptersPresenter.java @@ -1,7 +1,6 @@ package eu.kanade.mangafeed.ui.manga.chapter; import android.os.Bundle; -import android.support.v7.widget.RecyclerView; import java.io.File; import java.util.List; @@ -122,6 +121,14 @@ public class ChaptersPresenter extends BasePresenter { EventBus.getDefault().postSticky(new SourceMangaChapterEvent(source, manga, chapter)); } + public Chapter getNextUnreadChapter() { + List chapters = db.getNextUnreadChapter(manga).executeAsBlocking(); + if(chapters.size() < 1){ + return null; + } + return chapters.get(0); + } + public void markChaptersRead(Observable selectedChapters, boolean read) { add(markReadSubscription = selectedChapters .subscribeOn(Schedulers.io()) diff --git a/app/src/main/res/drawable-hdpi/ic_action_favorite_blue.png b/app/src/main/res/drawable-hdpi/ic_action_favorite_blue.png new file mode 100644 index 000000000..657c4874e Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_favorite_blue.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_play_arrow_white_36dp.png b/app/src/main/res/drawable-hdpi/ic_play_arrow_white_36dp.png new file mode 100644 index 000000000..29adeed05 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_play_arrow_white_36dp.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_favorite_blue.png b/app/src/main/res/drawable-mdpi/ic_action_favorite_blue.png new file mode 100644 index 000000000..60b063257 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_favorite_blue.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_play_arrow_white_36dp.png b/app/src/main/res/drawable-mdpi/ic_play_arrow_white_36dp.png new file mode 100644 index 000000000..57c9fa546 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_play_arrow_white_36dp.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_favorite_blue.png b/app/src/main/res/drawable-xhdpi/ic_action_favorite_blue.png new file mode 100644 index 000000000..8254e7482 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_favorite_blue.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_play_arrow_white_36dp.png b/app/src/main/res/drawable-xhdpi/ic_play_arrow_white_36dp.png new file mode 100644 index 000000000..547ef30aa Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_play_arrow_white_36dp.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_favorite_blue.png b/app/src/main/res/drawable-xxhdpi/ic_action_favorite_blue.png new file mode 100644 index 000000000..e4645e9e6 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_favorite_blue.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_play_arrow_white_36dp.png b/app/src/main/res/drawable-xxhdpi/ic_play_arrow_white_36dp.png new file mode 100644 index 000000000..23bb1ba9f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_play_arrow_white_36dp.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_favorite_blue.png b/app/src/main/res/drawable-xxxhdpi/ic_action_favorite_blue.png new file mode 100644 index 000000000..76b491e6e Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_action_favorite_blue.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_36dp.png b/app/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_36dp.png new file mode 100644 index 000000000..2745c3ab9 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_36dp.png differ diff --git a/app/src/main/res/layout/fragment_manga_chapters.xml b/app/src/main/res/layout/fragment_manga_chapters.xml index ae5666a54..6940e96a4 100644 --- a/app/src/main/res/layout/fragment_manga_chapters.xml +++ b/app/src/main/res/layout/fragment_manga_chapters.xml @@ -19,6 +19,7 @@ android:layout_height="fill_parent" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" + android:descendantFocusability="blocksDescendants" tools:listitem="@layout/item_chapter"> @@ -37,10 +38,72 @@ android:theme="@style/ThemeOverlay.AppTheme.Dark" app:popupTheme="@style/AppTheme.Popup"> - + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/item_catalogue.xml b/app/src/main/res/layout/item_catalogue.xml index 6e34fa3b6..eeb72151e 100644 --- a/app/src/main/res/layout/item_catalogue.xml +++ b/app/src/main/res/layout/item_catalogue.xml @@ -1,10 +1,10 @@ + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/card_background" + android:orientation="vertical"> + android:visibility="gone"/> + + + android:layout_alignStart="@+id/unreadText" + android:background="@color/white" + android:orientation="vertical"> + android:textStyle="bold" + tools:text="Sample name"/> + android:textSize="13sp" + tools:text="Sample name"/> diff --git a/app/src/main/res/layout/item_chapter.xml b/app/src/main/res/layout/item_chapter.xml index 9ea767283..5f02487ed 100644 --- a/app/src/main/res/layout/item_chapter.xml +++ b/app/src/main/res/layout/item_chapter.xml @@ -64,7 +64,8 @@ android:layout_above="@+id/relativeLayout" android:layout_alignParentRight="true" android:layout_alignParentEnd="true" - android:layout_alignParentTop="true"/> + android:layout_alignParentTop="true" + android:layout_marginRight="30dp"/> + android:paddingBottom="18dp" + android:layout_alignParentRight="true" + android:layout_alignParentEnd="true"> - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 19994301c..0787c78d2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -21,10 +21,12 @@ Edit Sort up Sort down - Show unread + Unread + Downloaded + Next unread - Ok + OK Cancel