From e1aa460106e30febd969ff71eafa72161ce07bf1 Mon Sep 17 00:00:00 2001 From: inorichi Date: Fri, 22 Jan 2016 17:37:23 +0100 Subject: [PATCH] Allow to display manga from catalogue as a simple list (#35) --- .../data/preference/PreferencesHelper.java | 4 + .../ui/catalogue/CatalogueAdapter.java | 13 ++- .../ui/catalogue/CatalogueFragment.java | 94 +++++++++++++++--- .../ui/catalogue/CatalogueGridHolder.java | 38 +++++++ .../ui/catalogue/CatalogueHolder.java | 29 +----- .../ui/catalogue/CatalogueListHolder.java | 24 +++++ .../ui/catalogue/CataloguePresenter.java | 40 ++++++-- .../ui/library/LibraryCategoryAdapter.java | 2 +- ...er.java => EndlessGridScrollListener.java} | 4 +- .../widget/EndlessListScrollListener.java | 49 +++++++++ .../drawable-hdpi/ic_view_list_white_24dp.png | Bin 0 -> 125 bytes .../ic_view_module_white_24dp.png | Bin 0 -> 115 bytes .../drawable-ldpi/ic_view_list_white_24dp.png | Bin 0 -> 187 bytes .../ic_view_module_white_24dp.png | Bin 0 -> 278 bytes .../drawable-mdpi/ic_view_list_white_24dp.png | Bin 0 -> 89 bytes .../ic_view_module_white_24dp.png | Bin 0 -> 87 bytes .../ic_view_list_white_24dp.png | Bin 0 -> 117 bytes .../ic_view_module_white_24dp.png | Bin 0 -> 115 bytes .../ic_view_list_white_24dp.png | Bin 0 -> 144 bytes .../ic_view_module_white_24dp.png | Bin 0 -> 139 bytes .../ic_view_list_white_24dp.png | Bin 0 -> 176 bytes .../ic_view_module_white_24dp.png | Bin 0 -> 171 bytes .../main/res/layout/fragment_catalogue.xml | 23 +++-- .../res/layout/fragment_library_category.xml | 2 +- ..._catalogue.xml => item_catalogue_grid.xml} | 0 .../main/res/layout/item_catalogue_list.xml | 16 +++ app/src/main/res/menu/catalogue_list.xml | 7 +- app/src/main/res/values/keys.xml | 2 + app/src/main/res/values/strings.xml | 1 + 29 files changed, 286 insertions(+), 62 deletions(-) create mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueGridHolder.java create mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueListHolder.java rename app/src/main/java/eu/kanade/tachiyomi/widget/{EndlessRecyclerScrollListener.java => EndlessGridScrollListener.java} (89%) create mode 100644 app/src/main/java/eu/kanade/tachiyomi/widget/EndlessListScrollListener.java create mode 100644 app/src/main/res/drawable-hdpi/ic_view_list_white_24dp.png create mode 100644 app/src/main/res/drawable-hdpi/ic_view_module_white_24dp.png create mode 100644 app/src/main/res/drawable-ldpi/ic_view_list_white_24dp.png create mode 100644 app/src/main/res/drawable-ldpi/ic_view_module_white_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_view_list_white_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_view_module_white_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_view_list_white_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_view_module_white_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_view_list_white_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_view_module_white_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_view_list_white_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_view_module_white_24dp.png rename app/src/main/res/layout/{item_catalogue.xml => item_catalogue_grid.xml} (100%) create mode 100644 app/src/main/res/layout/item_catalogue_list.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.java b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.java index 896883c4dd..6963fc2a36 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.java +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.java @@ -116,6 +116,10 @@ public class PreferencesHelper { return rxPrefs.getInteger(getKey(R.string.pref_reader_theme_key), 0); } + public Preference catalogueAsList() { + return rxPrefs.getBoolean(getKey(R.string.pref_display_catalogue_as_list), false); + } + public String getSourceUsername(Source source) { return prefs.getString(SOURCE_ACCOUNT_USERNAME + source.getId(), ""); } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueAdapter.java b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueAdapter.java index 69871e28fa..9d7cd6f704 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueAdapter.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueAdapter.java @@ -31,6 +31,10 @@ public class CatalogueAdapter extends FlexibleAdapter { notifyDataSetChanged(); } + public List getItems() { + return mItems; + } + @Override public long getItemId(int position) { return mItems.get(position).id; @@ -44,8 +48,13 @@ public class CatalogueAdapter extends FlexibleAdapter { @Override public CatalogueHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = fragment.getActivity().getLayoutInflater(); - View v = inflater.inflate(R.layout.item_catalogue, parent, false); - return new CatalogueHolder(v, this, fragment); + if (parent.getId() == R.id.catalogue_grid) { + View v = inflater.inflate(R.layout.item_catalogue_grid, parent, false); + return new CatalogueGridHolder(v, this, fragment); + } else { + View v = inflater.inflate(R.layout.item_catalogue_list, parent, false); + return new CatalogueListHolder(v, this, fragment); + } } @Override diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.java b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.java index 8b2460023f..f9d43a420c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.java @@ -4,7 +4,10 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; +import android.support.v4.content.ContextCompat; import android.support.v7.widget.GridLayoutManager; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SearchView; import android.support.v7.widget.Toolbar; import android.text.TextUtils; @@ -14,9 +17,12 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; import android.widget.AdapterView; import android.widget.ProgressBar; import android.widget.Spinner; +import android.widget.ViewSwitcher; import com.afollestad.materialdialogs.MaterialDialog; @@ -30,11 +36,13 @@ import eu.kanade.tachiyomi.data.database.models.Manga; import eu.kanade.tachiyomi.data.source.base.Source; import eu.kanade.tachiyomi.ui.base.adapter.FlexibleViewHolder; import eu.kanade.tachiyomi.ui.base.fragment.BaseRxFragment; +import eu.kanade.tachiyomi.ui.decoration.DividerItemDecoration; import eu.kanade.tachiyomi.ui.main.MainActivity; import eu.kanade.tachiyomi.ui.manga.MangaActivity; import eu.kanade.tachiyomi.util.ToastUtil; import eu.kanade.tachiyomi.widget.AutofitRecyclerView; -import eu.kanade.tachiyomi.widget.EndlessRecyclerScrollListener; +import eu.kanade.tachiyomi.widget.EndlessGridScrollListener; +import eu.kanade.tachiyomi.widget.EndlessListScrollListener; import icepick.State; import nucleus.factory.RequiresPresenter; import rx.Subscription; @@ -45,14 +53,17 @@ import rx.subjects.PublishSubject; public class CatalogueFragment extends BaseRxFragment implements FlexibleViewHolder.OnListItemClickListener { - @Bind(R.id.recycler) AutofitRecyclerView recycler; + @Bind(R.id.switcher) ViewSwitcher switcher; + @Bind(R.id.catalogue_grid) AutofitRecyclerView catalogueGrid; + @Bind(R.id.catalogue_list) RecyclerView catalogueList; @Bind(R.id.progress) ProgressBar progress; @Bind(R.id.progress_grid) ProgressBar progressGrid; private Toolbar toolbar; private Spinner spinner; private CatalogueAdapter adapter; - private EndlessRecyclerScrollListener scrollListener; + private EndlessGridScrollListener gridScrollListener; + private EndlessListScrollListener listScrollListener; @State String query = ""; @State int selectedIndex = -1; @@ -61,6 +72,8 @@ public class CatalogueFragment extends BaseRxFragment private PublishSubject queryDebouncerSubject; private Subscription queryDebouncerSubscription; + private MenuItem displayMode; + public static CatalogueFragment newInstance() { return new CatalogueFragment(); } @@ -77,13 +90,32 @@ public class CatalogueFragment extends BaseRxFragment View view = inflater.inflate(R.layout.fragment_catalogue, container, false); ButterKnife.bind(this, view); - // Initialize adapter and scroll listener - GridLayoutManager layoutManager = (GridLayoutManager) recycler.getLayoutManager(); + // Initialize adapter, scroll listener and recycler views adapter = new CatalogueAdapter(this); - scrollListener = new EndlessRecyclerScrollListener(layoutManager, this::requestNextPage); - recycler.setHasFixedSize(true); - recycler.setAdapter(adapter); - recycler.addOnScrollListener(scrollListener); + + GridLayoutManager glm = (GridLayoutManager) catalogueGrid.getLayoutManager(); + gridScrollListener = new EndlessGridScrollListener(glm, this::requestNextPage); + catalogueGrid.setHasFixedSize(true); + catalogueGrid.setAdapter(adapter); + catalogueGrid.addOnScrollListener(gridScrollListener); + + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + listScrollListener = new EndlessListScrollListener(llm, this::requestNextPage); + catalogueList.setHasFixedSize(true); + catalogueList.setAdapter(adapter); + catalogueList.setLayoutManager(llm); + catalogueList.addOnScrollListener(listScrollListener); + catalogueList.addItemDecoration(new DividerItemDecoration( + ContextCompat.getDrawable(getContext(), R.drawable.line_divider))); + + if (getPresenter().isListMode()) { + switcher.showNext(); + } + + Animation inAnim = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in); + Animation outAnim = AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_out); + switcher.setInAnimation(inAnim); + switcher.setOutAnimation(outAnim); // Create toolbar spinner Context themedContext = getBaseActivity().getSupportActionBar() != null ? @@ -109,7 +141,8 @@ public class CatalogueFragment extends BaseRxFragment } else { selectedIndex = position; showProgressBar(); - recycler.setAdapter(adapter); + glm.scrollToPositionWithOffset(0, 0); + llm.scrollToPositionWithOffset(0, 0); getPresenter().startRequesting(source); } } @@ -152,6 +185,22 @@ public class CatalogueFragment extends BaseRxFragment return true; } }); + + // Show next display mode + displayMode = menu.findItem(R.id.action_display_mode); + int icon = getPresenter().isListMode() ? + R.drawable.ic_view_module_white_24dp : R.drawable.ic_view_list_white_24dp; + displayMode.setIcon(icon); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.action_display_mode: + swapDisplayMode(); + break; + } + return super.onOptionsItemSelected(item); } @Override @@ -198,7 +247,8 @@ public class CatalogueFragment extends BaseRxFragment query = newQuery; showProgressBar(); - recycler.getLayoutManager().scrollToPosition(0); + catalogueGrid.getLayoutManager().scrollToPosition(0); + catalogueList.getLayoutManager().scrollToPosition(0); getPresenter().restartRequest(query); } @@ -214,7 +264,8 @@ public class CatalogueFragment extends BaseRxFragment hideProgressBar(); if (page == 0) { adapter.clear(); - scrollListener.resetScroll(); + gridScrollListener.resetScroll(); + listScrollListener.resetScroll(); } adapter.addItems(mangas); } @@ -224,15 +275,28 @@ public class CatalogueFragment extends BaseRxFragment } public void updateImage(Manga manga) { - CatalogueHolder holder = getHolder(manga); + CatalogueGridHolder holder = getHolder(manga); if (holder != null) { holder.setImage(manga, getPresenter()); } } + public void swapDisplayMode() { + getPresenter().swapDisplayMode(); + boolean isListMode = getPresenter().isListMode(); + int icon = isListMode ? + R.drawable.ic_view_module_white_24dp : R.drawable.ic_view_list_white_24dp; + displayMode.setIcon(icon); + switcher.showNext(); + if (!isListMode) { + // Initialize mangas if going to grid view + getPresenter().initializeMangas(adapter.getItems()); + } + } + @Nullable - private CatalogueHolder getHolder(Manga manga) { - return (CatalogueHolder) recycler.findViewHolderForItemId(manga.id); + private CatalogueGridHolder getHolder(Manga manga) { + return (CatalogueGridHolder) catalogueGrid.findViewHolderForItemId(manga.id); } private void showProgressBar() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueGridHolder.java b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueGridHolder.java new file mode 100644 index 0000000000..b45fe51e6d --- /dev/null +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueGridHolder.java @@ -0,0 +1,38 @@ +package eu.kanade.tachiyomi.ui.catalogue; + +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import butterknife.Bind; +import butterknife.ButterKnife; +import eu.kanade.tachiyomi.R; +import eu.kanade.tachiyomi.data.database.models.Manga; + +public class CatalogueGridHolder extends CatalogueHolder { + + @Bind(R.id.title) TextView title; + @Bind(R.id.thumbnail) ImageView thumbnail; + @Bind(R.id.favorite_sticker) ImageView favoriteSticker; + + public CatalogueGridHolder(View view, CatalogueAdapter adapter, OnListItemClickListener listener) { + super(view, adapter, listener); + ButterKnife.bind(this, view); + } + + @Override + public void onSetValues(Manga manga, CataloguePresenter presenter) { + title.setText(manga.title); + favoriteSticker.setVisibility(manga.favorite ? View.VISIBLE : View.GONE); + setImage(manga, presenter); + } + + public void setImage(Manga manga, CataloguePresenter presenter) { + if (manga.thumbnail_url != null) { + presenter.coverCache.loadFromNetwork(thumbnail, manga.thumbnail_url, + presenter.getSource().getGlideHeaders()); + } else { + thumbnail.setImageResource(android.R.color.transparent); + } + } +} \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueHolder.java b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueHolder.java index 243b6d8041..8de83acee1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueHolder.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueHolder.java @@ -1,38 +1,15 @@ package eu.kanade.tachiyomi.ui.catalogue; import android.view.View; -import android.widget.ImageView; -import android.widget.TextView; -import butterknife.Bind; -import butterknife.ButterKnife; -import eu.kanade.tachiyomi.R; import eu.kanade.tachiyomi.data.database.models.Manga; import eu.kanade.tachiyomi.ui.base.adapter.FlexibleViewHolder; -public class CatalogueHolder extends FlexibleViewHolder { - - @Bind(R.id.title) TextView title; - @Bind(R.id.thumbnail) ImageView thumbnail; - @Bind(R.id.favorite_sticker) ImageView favoriteSticker; +public abstract class CatalogueHolder extends FlexibleViewHolder { public CatalogueHolder(View view, CatalogueAdapter adapter, OnListItemClickListener listener) { super(view, adapter, listener); - ButterKnife.bind(this, view); } - public void onSetValues(Manga manga, CataloguePresenter presenter) { - title.setText(manga.title); - favoriteSticker.setVisibility(manga.favorite ? View.VISIBLE : View.GONE); - setImage(manga, presenter); - } - - public void setImage(Manga manga, CataloguePresenter presenter) { - if (manga.thumbnail_url != null) { - presenter.coverCache.loadFromNetwork(thumbnail, manga.thumbnail_url, - presenter.getSource().getGlideHeaders()); - } else { - thumbnail.setImageResource(android.R.color.transparent); - } - } -} \ No newline at end of file + abstract void onSetValues(Manga manga, CataloguePresenter presenter); +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueListHolder.java b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueListHolder.java new file mode 100644 index 0000000000..a4fd788a4e --- /dev/null +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueListHolder.java @@ -0,0 +1,24 @@ +package eu.kanade.tachiyomi.ui.catalogue; + +import android.view.View; +import android.widget.TextView; + +import butterknife.Bind; +import butterknife.ButterKnife; +import eu.kanade.tachiyomi.R; +import eu.kanade.tachiyomi.data.database.models.Manga; + +public class CatalogueListHolder extends CatalogueHolder { + + @Bind(R.id.title) TextView title; + + public CatalogueListHolder(View view, CatalogueAdapter adapter, OnListItemClickListener listener) { + super(view, adapter, listener); + ButterKnife.bind(this, view); + } + + @Override + public void onSetValues(Manga manga, CataloguePresenter presenter) { + title.setText(manga.title); + } +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.java b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.java index bc30ba7602..97381fde99 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.java @@ -42,6 +42,8 @@ public class CataloguePresenter extends BasePresenter { private PublishSubject> mangaDetailSubject; + private boolean isListMode; + private static final int GET_MANGA_LIST = 1; private static final int GET_MANGA_DETAIL = 2; private static final int GET_MANGA_PAGE = 3; @@ -72,12 +74,14 @@ public class CataloguePresenter extends BasePresenter { .observeOn(Schedulers.io()) .flatMap(Observable::from) .filter(manga -> !manga.initialized) - .window(3) - .concatMap(pack -> pack.concatMap(this::getMangaDetails)) + .concatMap(this::getMangaDetails) .onBackpressureBuffer() .observeOn(AndroidSchedulers.mainThread()), CatalogueFragment::updateImage, (view, error) -> Timber.e(error.getMessage())); + + add(prefs.catalogueAsList().asObservable() + .subscribe(this::setDisplayMode)); } private void onProcessRestart() { @@ -87,6 +91,15 @@ public class CataloguePresenter extends BasePresenter { stop(GET_MANGA_PAGE); } + private void setDisplayMode(boolean asList) { + this.isListMode = asList; + if (asList) { + stop(GET_MANGA_DETAIL); + } else { + start(GET_MANGA_DETAIL); + } + } + public void startRequesting(Source source) { this.source = source; sourceId = source.getId(); @@ -98,7 +111,9 @@ public class CataloguePresenter extends BasePresenter { stop(GET_MANGA_PAGE); lastMangasPage = null; - start(GET_MANGA_DETAIL); + if (!isListMode) { + start(GET_MANGA_DETAIL); + } start(GET_MANGA_LIST); start(GET_MANGA_PAGE); } @@ -124,10 +139,7 @@ public class CataloguePresenter extends BasePresenter { .flatMap(mangasPage -> Observable.from(mangasPage.mangas)) .map(this::networkToLocalManga) .toList() - .doOnNext(mangas -> { - if (mangaDetailSubject != null) - mangaDetailSubject.onNext(mangas); - }) + .doOnNext(this::initializeMangas) .observeOn(AndroidSchedulers.mainThread()); } @@ -141,9 +153,12 @@ public class CataloguePresenter extends BasePresenter { return localManga; } + public void initializeMangas(List mangas) { + mangaDetailSubject.onNext(mangas); + } + private Observable getMangaDetails(final Manga manga) { return source.pullMangaFromNetwork(manga.url) - .subscribeOn(Schedulers.io()) .flatMap(networkManga -> { manga.copyFrom(networkManga); db.insertManga(manga).executeAsBlocking(); @@ -181,4 +196,13 @@ public class CataloguePresenter extends BasePresenter { manga.favorite = !manga.favorite; db.insertManga(manga).executeAsBlocking(); } + + public boolean isListMode() { + return isListMode; + } + + public void swapDisplayMode() { + prefs.catalogueAsList().set(!isListMode); + } + } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.java b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.java index 9319e9db93..5f3a0ff7ca 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.java @@ -52,7 +52,7 @@ public class LibraryCategoryAdapter extends FlexibleAdapter previousTotal)) { + loading = false; + previousTotal = totalItemCount; + } + if (!loading && (totalItemCount - visibleItemCount) + <= (firstVisibleItem + visibleThreshold)) { + // End has been reached + requestNext.call(); + loading = true; + } + } + +} \ No newline at end of file diff --git a/app/src/main/res/drawable-hdpi/ic_view_list_white_24dp.png b/app/src/main/res/drawable-hdpi/ic_view_list_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..98c45924adc61322072a0058cb4911b6f69aa87f GIT binary patch literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K;i>HfYNX4z>ALkupPZ(rfm|(tw zk<;i;xx>TccD@_DPHYOvoXu^4%_mGdvNpPHEisYGcD}gaVp7T$3CWP7CssH*A68(H XVAy%vs;MpuXdZ*7tDnm{r-UW|K|k0wldT1B8K;m8XkiNX4z>ALkupPZ(rfm|(tw zk=05-v+1Zp$OVTbCssHvX1l227^K_XbL`d%$L3QDE>`7US-@z~-m}O2k5>Rq OVeoYIb6Mw<&;$VPJ0+I@ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-ldpi/ic_view_list_white_24dp.png b/app/src/main/res/drawable-ldpi/ic_view_list_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..35df0ba80137b2af3a32cfa80269140acbbcf40a GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a)4CQlc~kcwN$2@2vJ9UTP@hQd?Q z+z%<(ad$n+zP@hh{;IE9!X2g!7OWk{6AGjP?#V?qa|C?2w!i-WJLW2tDnm{r-UW|1BO7w literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-ldpi/ic_view_module_white_24dp.png b/app/src/main/res/drawable-ldpi/ic_view_module_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..7bf1e34eeed3c2e7158784eac74781a6684b9ca9 GIT binary patch literal 278 zcmV+x0qOpUP)8xd@Ux8#UvtJgv4wyia}6@x(v6#A~CrLF<7_&n<#_$ih)*Q5?kYc8ogh$Wwo|t2g zD>}Hrr5^Oh>JOCeOzKnr=9ne^pz}J@`>nO$GYxz;z*{WhaP$h$>tDnm{r-UW|HCz?x literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_view_list_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_view_list_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..8ce8a806c4f9c9bc791d7122365de2a6a37bbb0e GIT binary patch literal 117 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}t8&4Op@B2u{L3FVdQ&MBb@09c476951J literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_view_module_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_view_module_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..89980e2620249af35757014a33be50f23fe85882 GIT binary patch literal 115 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tD^C~4kcwMxuNZOxC72KV`G5Hv z^IR?0mhR|j(JCwd>}6nR;CwJ`x*SMtgXvdS28IK(m>3%79$?(sdgPjuh4O!(41=eu KpUXO@geCyl&?8|0 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_view_list_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_view_list_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..6082dad61711ad208e576b363ddbf4f0b396caba GIT binary patch literal 144 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXhaw!aZFaLn>~)y|$5)!GMG1!2SA6 zV@D=2#)FqHJ>xp+pBl!_0R|bmFT&nuZf^jCe~mTO9}iDu1c6R@hiOtEB_4kS>><(( aw`v*8Zar%^?y3P~)y|z%0!GMG1;QRfV zmmEV_8d~)y}pr?!GOc{;Qs%Y z(pp$lnhI{+ic#JZQkD-?g9Pdr^FCKymqmy)R5mCvUpTT)04~&^7M8*=>xMWJT;#%$ gE*>}s$Vjk%!0>|M(xD^XWz#_7p00i_>zopr0Mmym!vFvP literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_view_module_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_view_module_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..02cd1b32145ee129e393340d21f1514af93b4ebe GIT binary patch literal 171 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%xcgiacE$Ln>~)y|Iv&!GVM2;OqUF z84u4+c3{&<<4Fp>xt9^B1_6GsR?J;ljo?FA4U!E;> - + android:id="@+id/switcher"> + + + + + + + tools:listitem="@layout/item_catalogue_grid" /> \ No newline at end of file diff --git a/app/src/main/res/layout/item_catalogue.xml b/app/src/main/res/layout/item_catalogue_grid.xml similarity index 100% rename from app/src/main/res/layout/item_catalogue.xml rename to app/src/main/res/layout/item_catalogue_grid.xml diff --git a/app/src/main/res/layout/item_catalogue_list.xml b/app/src/main/res/layout/item_catalogue_list.xml new file mode 100644 index 0000000000..409714fe62 --- /dev/null +++ b/app/src/main/res/layout/item_catalogue_list.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/catalogue_list.xml b/app/src/main/res/menu/catalogue_list.xml index c0b1a7c5eb..668f162618 100644 --- a/app/src/main/res/menu/catalogue_list.xml +++ b/app/src/main/res/menu/catalogue_list.xml @@ -1,11 +1,16 @@ + + + diff --git a/app/src/main/res/values/keys.xml b/app/src/main/res/values/keys.xml index 6ccd1552b8..e1013b9025 100644 --- a/app/src/main/res/values/keys.xml +++ b/app/src/main/res/values/keys.xml @@ -35,4 +35,6 @@ pref_version pref_build_time + + pref_display_catalogue_as_list \ 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 025323e9d1..d91187577b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -38,6 +38,7 @@ Previous chapter Next chapter Retry + Change display mode