add label that shows count
This commit is contained in:
parent
df587ec5af
commit
193f58376d
|
@ -40,6 +40,8 @@ dependencies {
|
|||
exclude module: "support-v4"
|
||||
}
|
||||
|
||||
compile 'com.github.shts:TriangleLabelView:1.0.0'
|
||||
|
||||
compile "com.github.AntennaPod:AntennaPod-AudioPlayer:$audioPlayerVersion"
|
||||
|
||||
compile project(":core")
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
Copyright (C) 2016 Shota Saito
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
|
@ -17,6 +17,7 @@ import com.bumptech.glide.request.target.Target;
|
|||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.core.feed.Feed;
|
||||
import de.danoeh.antennapod.core.glide.ApGlideSettings;
|
||||
import jp.shts.android.library.TriangleLabelView;
|
||||
|
||||
/**
|
||||
* Adapter for subscriptions
|
||||
|
@ -65,6 +66,7 @@ public class SubscriptionsAdapter extends BaseAdapter {
|
|||
convertView = layoutInflater.inflate(R.layout.subscription_item, parent, false);
|
||||
holder.feedTitle = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.imageView = (ImageView) convertView.findViewById(R.id.imgvCover);
|
||||
holder.count = (TriangleLabelView) convertView.findViewById(R.id.triangleCountView);
|
||||
|
||||
|
||||
convertView.setTag(holder);
|
||||
|
@ -73,6 +75,7 @@ public class SubscriptionsAdapter extends BaseAdapter {
|
|||
}
|
||||
|
||||
holder.feedTitle.setText(feed.getTitle());
|
||||
holder.count.setPrimaryText(String.valueOf(itemAccess.getFeedCounter(feed.getId())));
|
||||
Glide.with(context)
|
||||
.load(feed.getImageUri())
|
||||
.placeholder(R.color.light_gray)
|
||||
|
@ -88,6 +91,7 @@ public class SubscriptionsAdapter extends BaseAdapter {
|
|||
|
||||
@Override
|
||||
public boolean onResourceReady(GlideDrawable resource, Uri model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
|
||||
holder.feedTitle.setVisibility(View.INVISIBLE);
|
||||
return false;
|
||||
}
|
||||
})
|
||||
|
@ -99,5 +103,6 @@ public class SubscriptionsAdapter extends BaseAdapter {
|
|||
static class Holder {
|
||||
public TextView feedTitle;
|
||||
public ImageView imageView;
|
||||
public TriangleLabelView count;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
@ -30,4 +31,17 @@
|
|||
android:background="#55000000"
|
||||
tools:text="@string/app_name" />
|
||||
|
||||
<jp.shts.android.library.TriangleLabelView
|
||||
android:id="@+id/triangleCountView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
app:backgroundColor="#bbbfbfbf"
|
||||
app:corner="rightTop"
|
||||
app:primaryText="Test"
|
||||
app:primaryTextColor="@color/grey600"
|
||||
app:primaryTextSize="12sp"
|
||||
android:layout_gravity="right|top"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
@ -100,6 +100,9 @@ licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a
|
|||
<h2>StackBlur <a href="https://github.com/kikoso/android-stackblur">(Link)</a></h2>
|
||||
by Enrique López Mañas, licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a>
|
||||
|
||||
<h2>Triangle Label View <a href="https://github.com/shts/TriangleLabelView">(Link)</a></h2>
|
||||
by Shota Saito, licensed under the Apache 2.0 license <a href="LICENSE_TRIANGLE_LABEL_VIEW.txt">(View)</a>
|
||||
|
||||
<h2>AntennaPod-AudioPlayer <a href="https://github.com/AntennaPod/AntennaPod-AudioPlayer/">(Link)</a></h2>
|
||||
by the AntennaPod team, licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a>
|
||||
|
||||
|
|
Loading…
Reference in New Issue