Fix first message bad displaying

This commit is contained in:
Sylvain Berfini 2012-07-25 15:42:11 +02:00
parent f1972455e5
commit d2c387ac42
3 changed files with 5 additions and 4 deletions

View file

@ -12,7 +12,7 @@
<bool name="useFirstLoginActivity">false</bool> <bool name="useFirstLoginActivity">false</bool>
<bool name="disable_animations">false</bool> <bool name="disable_animations">false</bool>
<bool name="lock_statusbar">false</bool> <bool name="lock_statusbar">false</bool>
<bool name="emoticons_in_messages">false</bool> <bool name="emoticons_in_messages">true</bool>
<bool name="only_display_username_if_unknown">true</bool> <bool name="only_display_username_if_unknown">true</bool>
<bool name="display_messages_time">true</bool> <!-- Used to show the time of each message arrival --> <bool name="display_messages_time">true</bool> <!-- Used to show the time of each message arrival -->

View file

@ -164,7 +164,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneO
LinphoneActivity.instance().onMessageSent(sipUri, messageToSend); LinphoneActivity.instance().onMessageSent(sipUri, messageToSend);
} }
displayMessage(previousMessageID + 1, messageToSend, getString(R.string.now_date_format), false, messagesLayout); displayMessage(previousMessageID + 2, messageToSend, getString(R.string.now_date_format), false, messagesLayout);
scrollToEnd(); scrollToEnd();
} }
} }
@ -181,7 +181,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneO
@Override @Override
public void onMessageReceived(LinphoneAddress from, String message) { public void onMessageReceived(LinphoneAddress from, String message) {
if (from.asStringUriOnly().equals(sipUri)) { if (from.asStringUriOnly().equals(sipUri)) {
int id = previousMessageID + 1; int id = previousMessageID + 2;
displayMessage(id, message, getString(R.string.now_date_format), true, messagesLayout); displayMessage(id, message, getString(R.string.now_date_format), true, messagesLayout);
scrollToEnd(); scrollToEnd();
} }

View file

@ -24,6 +24,7 @@ import java.util.Map.Entry;
import org.linphone.LinphoneUtils; import org.linphone.LinphoneUtils;
import org.linphone.R; import org.linphone.R;
import org.linphone.core.Log;
import android.content.Context; import android.content.Context;
import android.graphics.Color; import android.graphics.Color;