Я пытаюсь обернуть текст в EditText, но он не работает. Я перепробовал много решений от stackoverflow, но у меня ничего не работает.
Вот код EditText в макете представления карты.
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:layout_weight="1"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="18dp"
app:cardElevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/spacing_xmlarge"
android:orientation="horizontal"
android:paddingLeft="@dimen/spacing_small"
android:paddingRight="@dimen/spacing_small">
<ImageView
android:layout_width="@dimen/spacing_xmlarge"
android:layout_height="@dimen/spacing_xmlarge"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:padding="@dimen/spacing_middle"
android:tint="#00897B"
app:srcCompat="@drawable/ic_sentiment_satisfied" />
<EditText
android:id="@+id/edittext_chat_log"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:gravity="top|left"
android:hint="Write a message..."
android:imeOptions="actionSearch"
android:inputType="textMultiLine|textCapSentences"
android:lines="5"
android:maxLines="10"
android:minLines="1"
android:padding="@dimen/spacing_middle"
android:scrollbars="none" />
<ImageView
android:id="@+id/photoPickerButton"
android:layout_width="@dimen/spacing_xmlarge"
android:layout_height="@dimen/spacing_xmlarge"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:padding="@dimen/spacing_middle"
android:tint="#00897B"
app:srcCompat="@drawable/ic_photo_camera" />
</LinearLayout>
</androidx.cardview.widget.CardView>
Вот полный код XML-файла:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E8E9E4"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#075E54"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/lyt_back"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/spacing_medium"
android:paddingRight="@dimen/spacing_medium">
<ImageButton
android:id="@+id/chat_back_press"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
app:srcCompat="@drawable/ic_arrow_back" />
<View
android:layout_width="@dimen/spacing_medium"
android:layout_height="0dp" />
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/image"
android:layout_width="36dp"
android:layout_height="36dp"
android:src="@drawable/photo_male_8"
app:civ_border="true"
app:civ_border_color="#075E54"
app:civ_border_width="0dp"
app:civ_shadow="true"
app:civ_shadow_radius="0" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/spacing_small"
android:paddingRight="@dimen/spacing_small">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Roberts"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@android:color/white"
app:fontFamily="sans-serif-medium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Online"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textColor="@color/grey_10" />
</LinearLayout>
<androidx.appcompat.widget.Toolbar
android:id="@+id/chat_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:contentInsetStartWithNavigation="0dp"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<!-- <android.support.v7.widget.RecyclerView-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview_chat_log"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingTop="@dimen/spacing_medium"
android:paddingBottom="@dimen/spacing_medium"
android:scrollbars="vertical"
android:scrollingCache="true"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_alignParentTop="true"
android:background="@drawable/bg_gradient_soft"
android:rotation="180" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/spacing_medium">
<!-- <android.support.v7.widget.CardView-->
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:layout_weight="1"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="18dp"
app:cardElevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/spacing_xmlarge"
android:orientation="horizontal"
android:paddingLeft="@dimen/spacing_small"
android:paddingRight="@dimen/spacing_small">
<ImageView
android:layout_width="@dimen/spacing_xmlarge"
android:layout_height="@dimen/spacing_xmlarge"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:padding="@dimen/spacing_middle"
android:tint="#00897B"
app:srcCompat="@drawable/ic_sentiment_satisfied" />
<EditText
android:id="@+id/edittext_chat_log"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@android:color/transparent"
android:gravity="top|left"
android:hint="Write a message..."
android:imeOptions="actionSearch"
android:inputType="textMultiLine|textCapSentences"
android:lines="5"
android:maxLines="10"
android:minLines="1"
android:padding="@dimen/spacing_middle"
android:scrollbars="none" />
<ImageView
android:id="@+id/photoPickerButton"
android:layout_width="@dimen/spacing_xmlarge"
android:layout_height="@dimen/spacing_xmlarge"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:padding="@dimen/spacing_middle"
android:tint="#00897B"
app:srcCompat="@drawable/ic_photo_camera" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- <android.support.design.widget.FloatingActionButton-->
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/send_button_chat_log"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:clickable="true"
android:gravity="center"
android:tint="@android:color/white"
app:backgroundTint="#00897B"
app:elevation="1dp"
app:fabSize="mini"
app:srcCompat="@drawable/ic_mic"
app:useCompatPadding="false" />
</LinearLayout>