Allow to create/remove categories. Some refactoring.

This commit is contained in:
inorichi
2015-12-28 01:13:52 +01:00
parent 3dff7f90e7
commit e548cbf171
31 changed files with 539 additions and 75 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/categories_list"
android:choiceMode="multipleChoice"
android:listSelector="@color/list_choice_pressed_bg_light" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
android:clickable="true"
android:src="@drawable/ic_action_add_18dp"
app:borderWidth="0dp"/>
</android.support.design.widget.CoordinatorLayout>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeightLarge"
android:paddingTop="@dimen/margin_top"
android:paddingBottom="@dimen/margin_bottom"
android:background="@drawable/selector_chapter_light">
<ImageView
android:id="@+id/image"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerInParent="true"
android:elevation="4dp"
android:clickable="true"
android:layout_marginLeft="@dimen/margin_left"
android:layout_marginStart="@dimen/margin_left"
android:layout_marginRight="@dimen/margin_right"
android:layout_marginEnd="@dimen/margin_right"/>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/margin_right"
android:layout_marginEnd="@dimen/margin_right"
android:layout_toRightOf="@id/image"
android:layout_toEndOf="@id/image"
android:layout_centerInParent="true"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="@color/primary_text"
tools:text="Title"/>
</RelativeLayout>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_delete"
android:title="@string/action_delete"
android:icon="@drawable/ic_action_delete"
android:orderInCategory="1"
app:showAsAction="always"/>
</menu>

View File

@@ -1,17 +1,25 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
<item
android:id="@+id/action_search"
android:title="@string/action_search"
android:icon="@drawable/ic_action_search"
android:orderInCategory="100"
app:showAsAction="collapseActionView|ifRoom"
app:actionViewClass="android.support.v7.widget.SearchView"/>
app:actionViewClass="android.support.v7.widget.SearchView" />
<item
android:id="@+id/action_refresh"
android:title="@string/action_refresh"
android:icon="@drawable/ic_action_refresh"
android:orderInCategory="1"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_edit_categories"
android:title="@string/action_edit_categories"
app:showAsAction="never" />
</menu>

View File

@@ -2,6 +2,11 @@
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="margin_top">16dp</dimen>
<dimen name="margin_bottom">16dp</dimen>
<dimen name="margin_left">16dp</dimen>
<dimen name="margin_right">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="text_headline">24sp</dimen>
<dimen name="text_large_title">22sp</dimen>

View File

@@ -1,12 +1,15 @@
<resources>
<string name="app_name">Mangafeed</string>
<string name="name">Name</string>
<!-- Activities and fragments labels (toolbar title) -->
<string name="label_settings">Settings</string>
<string name="label_download_queue">Download queue</string>
<string name="label_library">My library</string>
<string name="label_recent_updates">Recent updates</string>
<string name="label_catalogues">Catalogues</string>
<string name="label_selected">Selected: %1$d</string>
<!-- Actions -->
<string name="action_settings">Settings</string>
@@ -19,6 +22,8 @@
<string name="action_delete">Delete</string>
<string name="action_update">Update</string>
<string name="action_edit">Edit</string>
<string name="action_add_category">Add category</string>
<string name="action_edit_categories">Edit categories</string>
<string name="action_sort_up">Sort up</string>
<string name="action_sort_down">Sort down</string>
<string name="action_show_unread">Unread</string>
@@ -118,7 +123,6 @@
<!-- Manga chapters fragment -->
<string name="manga_chapters_tab">Chapters</string>
<string name="selected_chapters_title">Selected: %1$d</string>
<string name="manga_chapter_no_title">No title</string>
<string name="chapter_downloaded">Downloaded</string>
<string name="chapter_queued">Queued</string>