From 193f58376d23381b108a33c1a1a5132ae41e154f Mon Sep 17 00:00:00 2001 From: Tom Hennen Date: Sat, 26 Mar 2016 14:03:38 -0400 Subject: add label that shows count --- app/build.gradle | 2 ++ app/src/main/assets/LICENSE_TRIANGLE_LABEL_VIEW.txt | 13 +++++++++++++ .../de/danoeh/antennapod/adapter/SubscriptionsAdapter.java | 5 +++++ app/src/main/res/layout/subscription_item.xml | 14 ++++++++++++++ app/src/main/templates/about.html | 3 +++ 5 files changed, 37 insertions(+) create mode 100644 app/src/main/assets/LICENSE_TRIANGLE_LABEL_VIEW.txt (limited to 'app') diff --git a/app/build.gradle b/app/build.gradle index 73d751fb4..8deba4a11 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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") diff --git a/app/src/main/assets/LICENSE_TRIANGLE_LABEL_VIEW.txt b/app/src/main/assets/LICENSE_TRIANGLE_LABEL_VIEW.txt new file mode 100644 index 000000000..de9a1f228 --- /dev/null +++ b/app/src/main/assets/LICENSE_TRIANGLE_LABEL_VIEW.txt @@ -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. \ No newline at end of file diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java index e8e034afa..269d8410e 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java @@ -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 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; } } diff --git a/app/src/main/res/layout/subscription_item.xml b/app/src/main/res/layout/subscription_item.xml index 25e376f18..ffbcc33f1 100644 --- a/app/src/main/res/layout/subscription_item.xml +++ b/app/src/main/res/layout/subscription_item.xml @@ -1,6 +1,7 @@ @@ -30,4 +31,17 @@ android:background="#55000000" tools:text="@string/app_name" /> + + diff --git a/app/src/main/templates/about.html b/app/src/main/templates/about.html index 222429b17..5c7a3cbd0 100644 --- a/app/src/main/templates/about.html +++ b/app/src/main/templates/about.html @@ -100,6 +100,9 @@ licensed under the Apache 2.0 license (View)StackBlur (Link) by Enrique López Mañas, licensed under the Apache 2.0 license (View) +

Triangle Label View (Link)

+by Shota Saito, licensed under the Apache 2.0 license (View) +

AntennaPod-AudioPlayer (Link)

by the AntennaPod team, licensed under the Apache 2.0 license (View) -- cgit v1.2.3