From 97a470bfd2ff4b8df7421dba6c27b3c2cc93f5fc Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 26 Sep 2012 14:10:43 +0200 Subject: [PATCH] XML boolean to authorize or not multiline chat messages --- res/layout/chat.xml | 3 ++- res/values/non_localizable_custom.xml | 1 + src/org/linphone/ChatFragment.java | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/res/layout/chat.xml b/res/layout/chat.xml index 8f77bd62e..d00a18240 100644 --- a/res/layout/chat.xml +++ b/res/layout/chat.xml @@ -82,7 +82,8 @@ true + false true true true diff --git a/src/org/linphone/ChatFragment.java b/src/org/linphone/ChatFragment.java index 10c68713e..bc2643f44 100644 --- a/src/org/linphone/ChatFragment.java +++ b/src/org/linphone/ChatFragment.java @@ -61,6 +61,7 @@ import android.provider.MediaStore; import android.support.v4.app.Fragment; import android.support.v4.content.CursorLoader; import android.text.Editable; +import android.text.InputType; import android.text.TextWatcher; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; @@ -131,7 +132,12 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC sendMessage = (TextView) view.findViewById(R.id.sendMessage); sendMessage.setOnClickListener(this); + message = (EditText) view.findViewById(R.id.message); + if (!getActivity().getResources().getBoolean(R.bool.allow_chat_multiline)) { + message.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE); + message.setMaxLines(1); + } uploadLayout = (RelativeLayout) view.findViewById(R.id.uploadLayout); textLayout = (RelativeLayout) view.findViewById(R.id.messageLayout);