XML boolean to authorize or not multiline chat messages

This commit is contained in:
Sylvain Berfini 2012-09-26 14:10:43 +02:00
parent f400b4c562
commit 97a470bfd2
3 changed files with 9 additions and 1 deletions

View file

@ -82,7 +82,8 @@
<EditText
android:id="@+id/message"
android:inputType="textShortMessage"
android:inputType="textMultiLine"
android:maxLines="3"
android:textColor="@android:color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -31,6 +31,7 @@
<bool name="display_call_stats">true</bool>
<!-- Behavior Settings -->
<bool name="allow_chat_multiline">false</bool>
<bool name="call_last_log_if_adress_is_empty">true</bool>
<bool name="allow_ringing_while_early_media">true</bool>
<bool name="allow_transfers">true</bool>

View file

@ -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);