Use a gradient at the bottom of the cover. Remove external repositories from gradle

This commit is contained in:
inorichi 2016-01-24 23:41:21 +01:00
parent 59cc87c583
commit b174adbab0
7 changed files with 60 additions and 40 deletions

View file

@ -93,6 +93,7 @@ dependencies {
compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:percent:$SUPPORT_LIBRARY_VERSION"
compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.2'
compile 'com.squareup.okhttp:okhttp:2.7.2'
compile 'com.squareup.okio:okio:1.6.0'
@ -116,7 +117,7 @@ dependencies {
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
compile 'eu.davidea:flexible-adapter:4.2.0'
compile 'com.nononsenseapps:filepicker:2.5.1'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.github.amulyakhare:TextDrawable:558677e'
compile 'com.github.pwittchen:reactivenetwork:0.1.5'
compile "com.google.dagger:dagger:$DAGGER_VERSION"

View file

@ -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

View file

@ -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) {

View 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>

View file

@ -12,14 +12,28 @@
android:layout_height="wrap_content"
android:background="@drawable/card_background">
<android.support.percent.PercentFrameLayout
android:layout_width="wrap_content"
android:layout_height="220dp"
android:id="@+id/image_container">
<ImageView
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="220dp"
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"
android:layout_width="wrap_content"
@ -38,20 +52,14 @@
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
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"
@ -68,10 +76,9 @@
android:shadowDy="0"
android:shadowColor="@color/primary_text"
android:shadowRadius="4"
android:layout_alignBottom="@+id/image_container"
tools:text="Sample name"/>
</FrameLayout>
</RelativeLayout>
</FrameLayout>

View file

@ -21,7 +21,5 @@ allprojects {
jcenter()
maven { url "https://clojars.org/repo/" }
maven { url "https://jitpack.io" }
maven { url 'http://dl.bintray.com/amulyakhare/maven' }
maven { url 'https://github.com/suckgamony/RapidDecoder/raw/master/repository' }
}
}

View file

@ -6,9 +6,9 @@ version = '3.4.1'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile "com.android.support:support-annotations:23.1.1"
compile 'rapid.decoder:library:0.3.0'
compile 'rapid.decoder:jpeg-decoder:0.3.0'
compile 'rapid.decoder:png-decoder:0.3.0'
compile 'com.github.suckgamony.RapidDecoder:library:7cdfca4'
compile 'com.github.suckgamony.RapidDecoder:jpeg-decoder:7cdfca4'
compile 'com.github.suckgamony.RapidDecoder:png-decoder:7cdfca4'
}
android {