Added the ability to view the library as a list (#394)

* Added in the ability to view the library as a list

* reverted LibraryAdapter and renamed libraryToggleViewEvent to LibraryToggleViewEvent for consistency

* removed LibraryToggleViewEvent and directly subscribed to option change

* fixed the toggleView subscription

* Made the library list item layout more compliant with material design

* Changed unread text style and removed background
This commit is contained in:
Josh
2016-07-27 10:37:36 -05:00
committed by Bram van de Kerkhof
parent 74e3d387eb
commit f21a030cf8
16 changed files with 313 additions and 44 deletions

View File

@@ -3,11 +3,9 @@
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v4.view.ViewPager>
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>

View File

@@ -9,14 +9,27 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<eu.kanade.tachiyomi.widget.AutofitRecyclerView
android:id="@+id/recycler"
style="@style/Theme.Widget.GridView"
<ViewSwitcher
android:id="@+id/library_switcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnWidth="140dp"
tools:listitem="@layout/item_catalogue_grid"/>
android:layout_height="0dp"
android:layout_weight="1">
<eu.kanade.tachiyomi.widget.AutofitRecyclerView
android:id="@+id/recycler"
style="@style/Theme.Widget.GridView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnWidth="140dp"
tools:listitem="@layout/item_catalogue_grid"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/library_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/item_library_list"/>
</ViewSwitcher>
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?android:listPreferredItemHeightSmall"
android:background="?attr/selectable_list_drawable">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/thumbnail"
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/icon"
android:layout_gravity="center_vertical|left"
android:paddingLeft="6dp"/>
<TextView
android:id="@+id/title"
style="@style/TextAppearance.Regular.Body1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="38dp"
android:text="Sample name"/>
<TextView
android:id="@+id/unread_text"
style="@style/TextAppearance.Regular.Caption"
android:textColor="@color/material_grey_500"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:paddingRight="9dp"
android:visibility="gone"/>
</FrameLayout>

View File

@@ -29,6 +29,11 @@
app:showAsAction="collapseActionView|ifRoom"
app:actionViewClass="android.support.v7.widget.SearchView" />
<item
android:id="@+id/action_library_display_mode"
android:title="Display Mode"
app:showAsAction="always"/>
<item
android:id="@+id/action_update_library"
android:title="@string/action_update_library"

View File

@@ -9,6 +9,7 @@
<string name="pref_category_about_key">pref_category_about_key</string>
<string name="pref_category_sources_key">pref_category_sources_key</string>
<string name="pref_display_library_as_list">pref_display_library_as_list</string>
<string name="pref_library_columns_dialog_key">pref_library_columns_dialog_key</string>
<string name="pref_library_columns_portrait_key">pref_library_columns_portrait_key</string>
<string name="pref_library_columns_landscape_key">pref_library_columns_landscape_key</string>

View File

@@ -13,7 +13,7 @@
android:key="@string/pref_theme_key"
android:summary="%s"
android:title="@string/pref_theme"/>
<eu.kanade.tachiyomi.widget.preference.IntListPreference
android:title="@string/pref_start_screen"
android:key="@string/pref_start_screen_key"