Chapter view improvements

- Smaller title
- Bigger touch zone
This commit is contained in:
Yuri Revich 2015-11-30 22:52:12 +03:00
parent 366b362709
commit d8703fd2e3
13 changed files with 33 additions and 26 deletions

View File

@ -7,6 +7,7 @@ import android.support.v7.widget.RecyclerView;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -27,7 +28,7 @@ public class ChaptersHolder extends RecyclerView.ViewHolder implements
@Bind(R.id.chapter_title) TextView title; @Bind(R.id.chapter_title) TextView title;
@Bind(R.id.download_text) TextView downloadText; @Bind(R.id.download_text) TextView downloadText;
@Bind(R.id.chapter_menu) ImageView chapterMenu; @Bind(R.id.chapter_menu) RelativeLayout chapterMenu;
@Bind(R.id.chapter_pages) TextView pages; @Bind(R.id.chapter_pages) TextView pages;
@Bind(R.id.chapter_date) TextView date; @Bind(R.id.chapter_date) TextView date;

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

View File

@ -44,7 +44,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:ellipsize="middle" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="8dp" android:paddingRight="8dp"

View File

@ -3,8 +3,11 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight" android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip" android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:background="@drawable/selector_chapter_light"> android:background="@drawable/selector_chapter_light"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight">
<RelativeLayout <RelativeLayout
android:layout_width="fill_parent" android:layout_width="fill_parent"
@ -52,33 +55,36 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignWithParentIfMissing="true" android:layout_alignWithParentIfMissing="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:textSize="20sp" android:textSize="18dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
tools:text="Title" tools:text="Title"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_toStartOf="@+id/relativeLayout2" android:layout_above="@+id/relativeLayout"
android:layout_toLeftOf="@+id/relativeLayout2"/>
<RelativeLayout
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_gravity="center_vertical" android:layout_alignParentTop="true"
android:gravity="center" android:paddingRight="30dp"/>
android:id="@+id/relativeLayout2"
android:layout_above="@+id/relativeLayout"> <RelativeLayout
<ImageView
android:id="@+id/chapter_menu" android:id="@+id/chapter_menu"
android:layout_width="fill_parent" android:layout_width="40dp"
android:layout_height="fill_parent" android:layout_height="wrap_content"
android:scaleType="fitXY" android:layout_alignParentTop="true"
android:src="@drawable/ic_more_horiz_black_36dp" android:gravity="center|end"
android:background="?android:selectableItemBackground"/> android:layout_alignRight="@+id/chapter_title"
android:layout_alignEnd="@+id/chapter_title"
android:layout_alignBottom="@+id/relativeLayout"
android:paddingBottom="18dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_more_horiz_black_24dp"
android:background="?android:selectableItemBackground"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="false"/>
</RelativeLayout> </RelativeLayout>