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; ...@@ -30,6 +30,7 @@ import org.json.JSONObject;
public class RocketChatMessageAttachmentsLayout extends LinearLayout { public class RocketChatMessageAttachmentsLayout extends LinearLayout {
private LayoutInflater inflater; private LayoutInflater inflater;
private String hostname; private String hostname;
private String attachmentsString;
private String userId; private String userId;
private String token; private String token;
...@@ -93,6 +94,10 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout { ...@@ -93,6 +94,10 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
} }
public void setAttachments(String attachmentsString) { public void setAttachments(String attachmentsString) {
if (this.attachmentsString != null && this.attachmentsString.equals(attachmentsString)) {
return;
}
this.attachmentsString = attachmentsString;
removeAllViews(); removeAllViews();
try { try {
......
...@@ -23,6 +23,7 @@ import org.json.JSONObject; ...@@ -23,6 +23,7 @@ import org.json.JSONObject;
*/ */
public class RocketChatMessageUrlsLayout extends LinearLayout { public class RocketChatMessageUrlsLayout extends LinearLayout {
private LayoutInflater inflater; private LayoutInflater inflater;
private String urlsString;
public RocketChatMessageUrlsLayout(Context context) { public RocketChatMessageUrlsLayout(Context context) {
super(context); super(context);
...@@ -52,6 +53,10 @@ public class RocketChatMessageUrlsLayout extends LinearLayout { ...@@ -52,6 +53,10 @@ public class RocketChatMessageUrlsLayout extends LinearLayout {
} }
public void setUrls(String urlsString) { public void setUrls(String urlsString) {
if (this.urlsString != null && this.urlsString.equals(urlsString)) {
return;
}
this.urlsString = urlsString;
removeAllViews(); removeAllViews();
try { 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