summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorTom Hennen <tom.hennen@gmail.com>2016-03-26 14:03:38 -0400
committerTom Hennen <tom.hennen@gmail.com>2016-03-26 14:03:38 -0400
commit193f58376d23381b108a33c1a1a5132ae41e154f (patch)
tree1524ee7ade85c429410717577cbb12f8bc0398d0 /app/src/main
parentdf587ec5af9c5180e195de094218c15e091646c7 (diff)
downloadAntennaPod-193f58376d23381b108a33c1a1a5132ae41e154f.zip
add label that shows count
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/assets/LICENSE_TRIANGLE_LABEL_VIEW.txt13
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java5
-rw-r--r--app/src/main/res/layout/subscription_item.xml14
-rw-r--r--app/src/main/templates/about.html3
4 files changed, 35 insertions, 0 deletions
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<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;
}
}
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 @@
<?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>
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 <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&oacute;pez Ma&ntilde;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>