aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2017-01-06 20:56:44 +0100
committerDaniel Gultsch <daniel@gultsch.de>2017-01-06 20:56:44 +0100
commit39c8867ed7a13480f29e35ac1c5fdd5db62fcff8 (patch)
treee13f46c1bd0cccc2cc75604f805b14dcb9a7df39 /src/main/java
parent1269123816e0d7b17626dc5f0b4e8728578edefb (diff)
add more punctuations to message preview
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/UIHelper.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
index ae40fc08..cc8f68ee 100644
--- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
@@ -9,6 +9,7 @@ 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 eu.siacs.conversations.Config;
@@ -29,9 +30,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
@@ -49,7 +50,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;
@@ -209,7 +212,7 @@ public class UIHelper {
builder.append(' ');
}
builder.append(line);
- if (last != '.' && last != '!' && last != '?' && last != ',') {
+ if (!PUNCTIONATION.contains(last)) {
break;
}
}