/*
 * Copyright (c) 2015, Apptentive, Inc. All Rights Reserved.
 * Please refer to the LICENSE file for the terms and conditions
 * under which redistribution and use of this file is permitted.
 */

package com.apptentive.android.sdk.module.messagecenter.view.holder;

import android.view.View;
import android.widget.TextView;

import com.apptentive.android.sdk.R;
import com.apptentive.android.sdk.module.messagecenter.view.MessageView;

/**
 * @author Sky Kelsey
 */
public class MessageHolder extends MessageCenterListItemHolder {
	public TextView datestamp;
	public TextView status;

	public MessageHolder(MessageView view) {
		datestamp = (TextView) view.findViewById(R.id.datestamp);
		status = (TextView) view.findViewById(R.id.status);
	}

	public void updateMessage(String datestamp, String status) {
		this.datestamp.setText(datestamp);
		this.datestamp.setVisibility(datestamp != null ? View.VISIBLE : View.GONE);
		this.status.setText(status);
		this.status.setVisibility(status != null ? View.VISIBLE : View.GONE);
	}
}

@@ -803,16 +803,49 @@
 atus) %7B%0A
+%09%09if (this.datestamp != null) %7B%0A%09
 %09%09this.d
@@ -873,16 +873,17 @@
 stamp);%0A
+%09
 %09%09this.d
@@ -952,16 +952,50 @@
 .GONE);%0A
+%09%09%7D%0A%09%09if (this.status != null) %7B%0A%09
 %09%09this.s
@@ -1017,16 +1017,17 @@
 tatus);%0A
+%09
 %09%09this.s
@@ -1090,13 +1090,17 @@
 .GONE);%0A
+%09%09%7D%0A
 %09%7D%0A%7D%0A

Check that datestamp and status fields exist before setting them, since incoming messages don't have a status view.