So möchte ich Chat-Nachricht Container so breit wie die Nachricht ist. möchte ich etwas wirklich ähnlich zu dieser Art von Chat-Nachricht erreichen: http://img.creativemark.co.uk/uploads/images/805/15805/img3File.pngChat-Message-Box so breit wie Textinhalt
Hier ist mein Plan, mit denen ich zu kämpfen habe:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/single_message_view"
android:layout_margin="5dp">
<LinearLayout
android:layout_marginEnd="15dp"
android:layout_marginStart="15dp"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="100dp"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="author"
android:id="@+id/sender_data"
android:layout_marginEnd="5dp"
android:textColor="@color/colorWhite" />
<TextView
android:layout_width="wrap_content"
android:layout_weight="1"
android:textAlignment="textEnd"
android:layout_height="wrap_content"
android:text="date"
android:textColor="@color/colorWhite"
android:id="@+id/send_date" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/message_content"
android:background="@drawable/msg_haze"
>
<TextView
android:layout_margin="10dp"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/colorWhite"
android:id="@+id/message_text"
android:text="content" />
<LinearLayout
android:layout_margin="10dp"
android:minWidth="100dp"
android:layout_below="@id/message_text"
android:id="@+id/tags_container"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:id="@+id/message_tags"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="LinearLayoutManager"
tools:listitem="@layout/item_tag" />
</LinearLayout>
<ImageView
android:layout_marginBottom="10dp"
android:layout_marginEnd="10dp"
android:paddingBottom="10dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_width="15dp"
android:layout_height="15dp"
android:id="@+id/message_state" />
<LinearLayout
android:id="@+id/attachment_holder"
android:layout_marginTop="10dp"
android:padding="5dp"
android:visibility="gone"
android:orientation="vertical"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/attachments_haze">
<android.support.v7.widget.RecyclerView
android:id="@+id/attachments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="GridLayoutManager"/>
<ImageView
android:id="@+id/attachment"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
Ich denke, dies wird nicht für diese spezielle Frage notwendig ist, als ob Sie das Bild Referenz in der Frage öffnen können, gibt es ein einfaches quadratischen Box-Gehäuse mit flacher Farbe kann die mit einem selbst ziehbaren erhalten werden. Keine Notwendigkeit für ein 9-Patch-Bild. Legen Sie das Layout einfach logisch fest, indem Sie eine Farbe verwenden, die für Hintergrundzwecke gezeichnet werden kann. Veröffentlichen Sie das gesamte Layout in einer Weile. – Mit
Ja das ist auch möglich. aber das ist nur ein Hinweis. Die meisten (nicht alle) Chat-Blasen bestehen aus dem neunen Patch-Bild. –
ja, du hast absolut recht, das ist y ich erwähnte "das wird nicht notwendig sein für dieses spezielle problem" – Mit