mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-25 18:47:51 +02:00
Use a gradient at the bottom of the cover. Remove external repositories from gradle
This commit is contained in:
@ -67,7 +67,7 @@ public class LibraryCategoryAdapter extends FlexibleAdapter<LibraryHolder, Manga
|
||||
}
|
||||
|
||||
public int getCoverHeight() {
|
||||
return fragment.recycler.getItemWidth() / 9 * 12;
|
||||
return fragment.recycler.getItemWidth() / 3 * 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,6 +1,7 @@
|
||||
package eu.kanade.tachiyomi.ui.library;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -17,6 +18,7 @@ import static android.widget.RelativeLayout.LayoutParams;
|
||||
|
||||
public class LibraryHolder extends FlexibleViewHolder {
|
||||
|
||||
@Bind(R.id.image_container) FrameLayout container;
|
||||
@Bind(R.id.thumbnail) ImageView thumbnail;
|
||||
@Bind(R.id.title) TextView title;
|
||||
@Bind(R.id.unreadText) TextView unreadText;
|
||||
@ -24,7 +26,7 @@ public class LibraryHolder extends FlexibleViewHolder {
|
||||
public LibraryHolder(View view, LibraryCategoryAdapter adapter, OnListItemClickListener listener) {
|
||||
super(view, adapter, listener);
|
||||
ButterKnife.bind(this, view);
|
||||
thumbnail.setLayoutParams(new LayoutParams(MATCH_PARENT, adapter.getCoverHeight()));
|
||||
container.setLayoutParams(new LayoutParams(MATCH_PARENT, adapter.getCoverHeight()));
|
||||
}
|
||||
|
||||
public void onSetValues(Manga manga, LibraryPresenter presenter) {
|
||||
|
12
app/src/main/res/drawable/gradient_shape.xml
Normal file
12
app/src/main/res/drawable/gradient_shape.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:startColor="#aa000000"
|
||||
android:centerColor="#00000000"
|
||||
android:endColor="#00ffffff"/>
|
||||
|
||||
<corners android:radius="0dp" />
|
||||
</shape>
|
@ -12,13 +12,27 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/card_background">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/thumbnail"
|
||||
android:layout_width="match_parent"
|
||||
<android.support.percent.PercentFrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="220dp"
|
||||
android:background="@color/white"
|
||||
tools:background="@color/md_red_100"
|
||||
tools:src="@mipmap/ic_launcher"/>
|
||||
android:id="@+id/image_container">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/thumbnail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:background="@color/md_red_100"
|
||||
tools:src="@mipmap/ic_launcher"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_heightPercent="50%"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/gradient_shape"/>
|
||||
|
||||
</android.support.percent.PercentFrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/unreadText"
|
||||
@ -38,39 +52,32 @@
|
||||
android:id="@+id/favorite_sticker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignEnd="@+id/thumbnail"
|
||||
android:layout_alignRight="@+id/thumbnail"
|
||||
android:layout_alignTop="@+id/thumbnail"
|
||||
android:layout_alignEnd="@+id/image_container"
|
||||
android:layout_alignRight="@+id/image_container"
|
||||
android:layout_alignTop="@+id/image_container"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:src="@drawable/ic_action_favorite_blue"
|
||||
android:visibility="invisible"/>
|
||||
|
||||
<FrameLayout
|
||||
<eu.kanade.tachiyomi.widget.PTSansTextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/thumbnail"
|
||||
android:background="@color/manga_cover_title_background">
|
||||
|
||||
<eu.kanade.tachiyomi.widget.PTSansTextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:typeface="ptsansNarrowBold"
|
||||
android:lineSpacingExtra="-4dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:shadowDx="0"
|
||||
android:shadowDy="0"
|
||||
android:shadowColor="@color/primary_text"
|
||||
android:shadowRadius="4"
|
||||
tools:text="Sample name"/>
|
||||
|
||||
</FrameLayout>
|
||||
android:layout_gravity="center_vertical"
|
||||
app:typeface="ptsansNarrowBold"
|
||||
android:lineSpacingExtra="-4dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:padding="8dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:shadowDx="0"
|
||||
android:shadowDy="0"
|
||||
android:shadowColor="@color/primary_text"
|
||||
android:shadowRadius="4"
|
||||
android:layout_alignBottom="@+id/image_container"
|
||||
tools:text="Sample name"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
Reference in New Issue
Block a user