diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-01-09 21:51:22 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-01-09 21:51:22 +0100 |
commit | b4be51d2a1b637f0f5da8a343277aea3dd36ee06 (patch) | |
tree | 3449f0eeb454bdf819b95f055b287139c2a586b9 /src/main/java/de/pixart/messenger | |
parent | d798cf0e594d6f55c968dedeb429bf52cd789057 (diff) |
add more punctuations to message preview
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/UIHelper.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/UIHelper.java b/src/main/java/de/pixart/messenger/utils/UIHelper.java index dce1b031c..7978650dc 100644 --- a/src/main/java/de/pixart/messenger/utils/UIHelper.java +++ b/src/main/java/de/pixart/messenger/utils/UIHelper.java @@ -5,10 +5,10 @@ import android.text.format.DateFormat; import android.text.format.DateUtils; import android.util.Pair; -import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Date; +import java.util.List; import java.util.Locale; import de.pixart.messenger.Config; @@ -28,9 +28,9 @@ public class UIHelper { private static String HEAVY_BLACK_HEART_SUIT = "\u2764"; private static String WHITE_HEART_SUIT = "\u2661"; - public static final ArrayList<String> HEARTS = new ArrayList<>(Arrays.asList(BLACK_HEART_SUIT, HEAVY_BLACK_HEART_SUIT, WHITE_HEART_SUIT)); + public static final List<String> HEARTS = Arrays.asList(BLACK_HEART_SUIT,HEAVY_BLACK_HEART_SUIT,WHITE_HEART_SUIT); - private static final ArrayList<String> LOCATION_QUESTIONS = new ArrayList<>(Arrays.asList( + private static final List<String> LOCATION_QUESTIONS = Arrays.asList( "where are you", //en "where are you now", //en "where are you right now", //en @@ -48,7 +48,9 @@ public class UIHelper { "wo seid ihr gerade", //de "dónde estás", //es "donde estas" //es - )); + ); + + private static final List<Character> PUNCTIONATION = Arrays.asList('.',',','?','!',';',':'); private static final int SHORT_DATE_FLAGS = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NO_YEAR | DateUtils.FORMAT_ABBREV_ALL; @@ -217,7 +219,7 @@ public class UIHelper { builder.append(' '); } builder.append(line); - if (last != '.' && last != '!' && last != '?' && last != ',') { + if (!PUNCTIONATION.contains(last)) { break; } } |