Commit 44ca5cc9 authored by Yusuke Iwaki's avatar Yusuke Iwaki

suppress redundant rendering of RocketChatMessageUrlsLayout#setUrls,...

suppress redundant rendering of RocketChatMessageUrlsLayout#setUrls, RocketChatMessageAttachmentsLayout#setAttachments
parent 790d8fae
......@@ -30,6 +30,7 @@ import org.json.JSONObject;
public class RocketChatMessageAttachmentsLayout extends LinearLayout {
private LayoutInflater inflater;
private String hostname;
private String attachmentsString;
private String userId;
private String token;
......@@ -93,6 +94,10 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
}
public void setAttachments(String attachmentsString) {
if (this.attachmentsString != null && this.attachmentsString.equals(attachmentsString)) {
return;
}
this.attachmentsString = attachmentsString;
removeAllViews();
try {
......
......@@ -23,6 +23,7 @@ import org.json.JSONObject;
*/
public class RocketChatMessageUrlsLayout extends LinearLayout {
private LayoutInflater inflater;
private String urlsString;
public RocketChatMessageUrlsLayout(Context context) {
super(context);
......@@ -52,6 +53,10 @@ public class RocketChatMessageUrlsLayout extends LinearLayout {
}
public void setUrls(String urlsString) {
if (this.urlsString != null && this.urlsString.equals(urlsString)) {
return;
}
this.urlsString = urlsString;
removeAllViews();
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment