Closed jlhonora closed 9 years ago
I'm not sure I understand which TextView
is displaying what.
I'll see if I can lower the min API for version 2.0.X.
Added view id and image highlighting for clarity.
Regarding API level, that would be excellent!
API level >= 4 could be supported with small changes https://github.com/JoanZapata/android-iconify/compare/master...jlhonora:master . Basically the difference is
diff --git a/android-iconify/src/main/java/com/joanzapata/iconify/internal/CustomTypefaceSpan.java b/android-iconify/src/main/java/com/joanzapata/iconify/internal/CustomTypefaceSpan.java
index 3d907eb..282cc44 100644
--- a/android-iconify/src/main/java/com/joanzapata/iconify/internal/CustomTypefaceSpan.java
+++ b/android-iconify/src/main/java/com/joanzapata/iconify/internal/CustomTypefaceSpan.java
@@ -29,7 +30,7 @@ public class CustomTypefaceSpan extends ReplacementSpan {
this.iconSizePx = iconSizePx;
this.iconSizeRatio = iconSizeRatio;
this.iconColor = iconColor;
- if (rotate) {
+ if (rotate && Build.VERSION.SDK_INT >= 11) {
The icon rotation wouldn't work though, since ValueAnimator was introduced in API level 11.
I'd rather encapsulate the API level check in a single method, but the linter doesn't like that.
If you like the changes I can make a PR.
I didn't want to have different behaviors on lower API levels, I can see the issues coming like "icons are not rotating on my Nokia 3310!". :smile:
I'll spend some time on implementing the rotation in an API 4 compatible way. If that proves impossible or too hard to maintain, then I'll gladly merge your code. :)
2.0.10 release will be compatible with API 4, spinning included. :)
Excellent!
Took a while to follow up on this, sorry :)
I'm facing a strange issue regarding TextView height when calling
addIcons
. I'm using release 1.0.11, due to API level restrictions (I need >= 10, current min is 11). Using the following view:I'm setting the text this way:
and it looks fine (no added icons of course, red frame added by me):
But when I add:
there's an added height to the TextView (again, red frame added by me, depicts the full height of the TextView, retrieved by UI automator):
How can I prevent this? Am I doing something wrong? I'd rather use the
{fa-tag color}
built-in, but I can't migrate to2.0.X
due to API level restrictions.Thanks in advance, great library.