-
-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added EmojiUtils #145
Added EmojiUtils #145
Conversation
Some small fixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few things otherwise this looks good
@@ -2,7 +2,9 @@ | |||
|
|||
import android.content.Context; | |||
import android.text.Spannable; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove these
import com.vanniktech.emoji.EmojiManager.EmojiRange; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove these
import com.vanniktech.emoji.emoji.Emoji; | ||
import com.vanniktech.emoji.emoji.EmojiCategory; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove these
@@ -2,8 +2,10 @@ | |||
|
|||
import android.support.annotation.NonNull; | |||
import android.support.annotation.Nullable; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove these
|
||
public final class EmojiUtils { | ||
|
||
private static final Pattern SPACE_REMOVAL = Pattern.compile(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about tabs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also added line terminations to get rid of the trim()
import com.pushtorefresh.private_constructor_checker.PrivateConstructorChecker; | ||
import com.vanniktech.emoji.emoji.Emoji; | ||
import com.vanniktech.emoji.emoji.EmojiCategory; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove
package com.vanniktech.emoji; | ||
|
||
import android.support.annotation.NonNull; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove
|
||
@Before public void setUp() { | ||
EmojiManager.install(new EmojiProvider() { | ||
@NonNull |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: same line
} | ||
|
||
@Test public void isOnlyEmojis_empty() { | ||
boolean onlyEmojis = EmojiUtils.isOnlyEmojis(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just inline all of these variables please
.check(); | ||
} | ||
|
||
@Test public void isOnlyEmojis_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also remove underscores from method names
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
public final class EmojiUtils { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the EmojiManager
should provide this functionality and not another class.
@vanniktech Maybe we should make all of the EmojiManager
public now as with this included changes it is quite usefull for other things apart from only managing TextViews
and EditTexts
(#128).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave it here for now (in EmojiUtils) I anyways thought of restructuring it a bit before the 0.5.0 release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now. Just the build would need to get green
Really? :D |
@vanniktech I added a suppression for that MultipleStringLiterals in tests, let me know if that's not ok. |
Codecov Report
@@ Coverage Diff @@
## master #145 +/- ##
=======================================
+ Coverage 24.2% 26.21% +2%
=======================================
Files 19 20 +1
Lines 661 679 +18
Branches 72 72
=======================================
+ Hits 160 178 +18
Misses 490 490
Partials 11 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thank you very much !
This class contains 2 methods for now: