Dynamic recyclerview inflation for the library view and better swap handling

This commit is contained in:
len
2016-07-30 23:54:32 +02:00
parent fbd2235a51
commit e95fcf6172
9 changed files with 99 additions and 158 deletions

View File

@@ -1,36 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ViewSwitcher
android:id="@+id/library_switcher"
android:layout_width="match_parent"
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"
android:paddingTop="@dimen/material_component_lists_padding_above_list"
tools:listitem="@layout/item_library_list"/>
</ViewSwitcher>
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<eu.kanade.tachiyomi.widget.AutofitRecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/library_grid"
style="@style/Theme.Widget.GridView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnWidth="140dp"
tools:listitem="@layout/item_catalogue_grid" />

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/library_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/material_component_lists_padding_above_list"
tools:listitem="@layout/item_library_list" />