Подскажите как быть. Приходит с сервера строка без (\n, \t и т.д.) нужно программно задать высоту EditText так чтобы поместился весь текст с этой строки. Как это можно сделать? P.S. Точно такой функционал реализован в любом чате (Skype, Viber) Вот код из xml разметки:
<RelativeLayout
android:id="@+id/item_chat_relative_layout_separate"
android:gravity="center_vertical"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_toLeftOf="@+id/item_chat_text_view_message_title"
android:layout_toStartOf="@+id/item_chat_text_view_message_title"
android:layout_alignBottom="@+id/item_chat_text_view_message_title">
<View
android:layout_gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@color/color_background_view_title_and_text_interests" />
</LinearLayout>
<TextView
android:layout_weight="1"
android:id="@+id/item_chat_text_view_message_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/activity_chat_item_text_today"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textSize="16dp"
android:textColor="@color/color_background_view_title_and_text_interests"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<LinearLayout
android:layout_marginRight="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/item_chat_text_view_message_title"
android:layout_toEndOf="@+id/item_chat_text_view_message_title"
android:layout_alignBottom="@+id/item_chat_text_view_message_title">
<View
android:layout_gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="@color/color_background_view_title_and_text_interests" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/item_chat_relative_layout_another"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="visible">
<com.erminesoft.scadaddle.custom_view.RoundedImageView
app:setR="21"
app:stroke="false"
android:src="@drawable/ic_logo"
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/item_chat_rounded_image_another" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/item_chat_rounded_image_another"
android:id="@+id/item_chat_edit_text_message_another"
android:inputType="none"
android:scrollHorizontally="false"
android:focusable="false"
android:background="@drawable/user_bubble"
android:textColor="@android:color/black"
android:layout_toLeftOf="@+id/item_chat_text_view_date_time_another"
android:layout_toStartOf="@+id/item_chat_text_view_date_time_another"
android:layout_alignBottom="@+id/item_chat_image_button_twitter_another"
android:layout_alignParentTop="true" />
<ImageView
android:id="@+id/item_chat_image_view_message_another"
android:layout_width="100dp"
android:layout_height="100dp"
android:paddingLeft="12dp"
android:paddingTop="5dp"
android:paddingRight="5dp"
android:paddingBottom="5dp"
android:src="@drawable/ic_logo"
android:layout_alignParentTop="true"
android:background="@drawable/user_bubble"
android:layout_toRightOf="@+id/item_chat_rounded_image_another"
android:layout_toEndOf="@+id/item_chat_rounded_image_another" />
<TextView
android:id="@+id/item_chat_text_view_date_time_another"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Date and Time"
android:textColor="@android:color/black"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<ImageButton
android:id="@+id/item_chat_image_button_facebook_another"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_margin="2dp"
android:background="@drawable/button_chat_facebook_selector"
android:layout_below="@+id/item_chat_text_view_date_time_another"
android:layout_alignRight="@+id/item_chat_text_view_date_time_another"
android:layout_alignEnd="@+id/item_chat_text_view_date_time_another" />
<ImageButton
android:id="@+id/item_chat_image_button_twitter_another"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_margin="2dp"
android:background="@drawable/button_chat_twitter_selector"
android:layout_below="@+id/item_chat_text_view_date_time_another"
android:layout_toLeftOf="@+id/item_chat_image_button_facebook_another"
android:layout_toStartOf="@+id/item_chat_image_button_facebook_another" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/item_chat_relative_layout_own"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="visible">
<TextView
android:gravity="center"
android:id="@+id/item_chat_text_view_date_time_own"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Date and Time"
android:textColor="@android:color/black"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ImageButton
android:id="@+id/item_chat_image_button_facebook_own"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_margin="2dp"
android:background="@drawable/button_chat_facebook_selector"
android:layout_below="@+id/item_chat_text_view_date_time_own"
android:layout_toRightOf="@+id/item_chat_image_button_twitter_own"
android:layout_toEndOf="@+id/item_chat_image_button_twitter_own" />
<ImageButton
android:id="@+id/item_chat_image_button_twitter_own"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_margin="2dp"
android:background="@drawable/button_chat_twitter_selector"
android:layout_below="@+id/item_chat_text_view_date_time_own"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<com.erminesoft.scadaddle.custom_view.RoundedImageView
app:setR="21"
app:stroke="false"
android:src="@drawable/ic_logo"
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/item_chat_rounded_image_own"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/item_chat_edit_text_message_own"
android:layout_alignParentTop="true"
android:inputType="none"
android:scrollHorizontally="false"
android:focusable="false"
android:textColor="@android:color/white"
android:background="@drawable/author_bubble"
android:layout_toLeftOf="@+id/item_chat_rounded_image_own"
android:layout_toRightOf="@+id/item_chat_text_view_date_time_own"
android:layout_toEndOf="@+id/item_chat_text_view_date_time_own"
android:layout_alignBottom="@+id/item_chat_image_button_facebook_own" />
<ImageView
android:id="@+id/item_chat_image_view_message_own"
android:paddingRight="12dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/ic_logo"
android:background="@drawable/author_bubble"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/item_chat_rounded_image_own"
android:layout_toStartOf="@+id/item_chat_rounded_image_own" />
</RelativeLayout>
xml
код как вы это организовали. возможно не в\n
\t
ошибка. и как определить куда ставить\n
?TextView
а в комментахEditText
покажите этот элемент в видеxml
(в вопросе) а то какая то путеница