0
나는이 모양의 Android xml 레이아웃을 가지고 있으며 채팅 거품이 있습니다. LinearLayout
에서 ConstraintLayout
으로 변환하고 싶습니다.
이것은 LinearLayout
버전이며 이것은 ConstraintLayout
버전과 채팅 bubbels가 너무 좋은 보이지 않는수행 방법 ConstraintLayout의 채팅 거품 생성
좋아 보인다. 이 거품으로
나는 약간의 도움이 필요. 보시다시피 화살표는 구속하기가 어렵습니다. 나는 하나의 제약 조건을 적용하지만 작동하지 않기 위해 하나의 android.support.constraint.Guideline
을 추가했다. 여기
ConstraintLayout
XML
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end|center_vertical">
<com.github.curioustechizen.ago.RelativeTimeTextView
android:id="@+id/timestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?AppTheme.ChatBubbleTextColor"
android:textSize="@dimen/chat_timestamp_text_size"
tools:text="Just Now"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"
app:layout_constraintRight_toLeftOf="@+id/message"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp" />
<TextView
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_balloon"
android:padding="8dp"
android:textColor="?AppTheme.ChatBubbleTextColor"
android:textSize="@dimen/chat_message_body_text_size"
tools:text="This is chat message"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toLeftOf="@+id/guideline1"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" />
<android.support.constraint.Guideline
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/guideline1"
android:orientation="vertical"
tools:layout_editor_absoluteY="0dp"
tools:layout_editor_absoluteX="218dp"
app:layout_constraintGuide_percent="0.859375" />
<View
android:layout_width="8dp"
android:layout_height="8dp"
android:background="?AppTheme.ChatBubbleBackGroundColor"
android:rotation="45"
android:id="@+id/view"
app:layout_constraintRight_toLeftOf="@+id/thumbnail"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/guideline1"
app:layout_constraintHorizontal_bias="0.0"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp" />
<ImageView
android:id="@+id/thumbnail"
android:layout_width="22dp"
android:layout_height="24dp"
tools:src="@drawable/tw__composer_logo_blue"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginEnd="8dp"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="8dp" />
</android.support.constraint.ConstraintLayout>
어쩌면 좋은 것 이것에 대해 거품이나 아이디어를 만들어 GitHub의에서 일부 라이브러리가있다?