|
@@ -91,7 +91,7 @@ public class EmotionLayout extends LinearLayout implements View.OnClickListener
|
|
|
//组装图片数据
|
|
//组装图片数据
|
|
|
List<String> pngList = new ArrayList<>(perPageCount);
|
|
List<String> pngList = new ArrayList<>(perPageCount);
|
|
|
for (int j = 0; j < perPageCount; j++) {
|
|
for (int j = 0; j < perPageCount; j++) {
|
|
|
- int index = i * EMOJI_COLUMNS + j;
|
|
|
|
|
|
|
+ int index = i * ( perPageCount - 1) + j;
|
|
|
if (index + 1 >= totalCount) {
|
|
if (index + 1 >= totalCount) {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -188,6 +188,18 @@ public class EmotionLayout extends LinearLayout implements View.OnClickListener
|
|
|
String replaceContent = String.format(Locale.CHINA, "<img src=\"%s\" />", tagToNameMap.get(pngTag));
|
|
String replaceContent = String.format(Locale.CHINA, "<img src=\"%s\" />", tagToNameMap.get(pngTag));
|
|
|
content = content.replaceAll(String.format(Locale.CHINA, "\\[%s\\]", pngTag), replaceContent);
|
|
content = content.replaceAll(String.format(Locale.CHINA, "\\[%s\\]", pngTag), replaceContent);
|
|
|
}
|
|
}
|
|
|
|
|
+ content = content.replaceAll("\n", "<br>");//替换换行
|
|
|
return content;
|
|
return content;
|
|
|
}
|
|
}
|
|
|
|
|
+ //转换内容
|
|
|
|
|
+ public static boolean hasExp(String content) {
|
|
|
|
|
+ if(content != null && content.contains("[")) {
|
|
|
|
|
+ for (String pngTag : PNG_TAGS) {
|
|
|
|
|
+ if (content.contains(String.format(Locale.CHINA, "[%s]", pngTag))) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|