diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-06-30 05:33:05 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-06-30 05:33:05 +0000 |
commit | bde545b75fa4beb140a6ce10861d178505a16bdc (patch) | |
tree | 2947139d4b5cc26c34a54ed8bcd5d1ff7f1a110b /app/src/main/res | |
parent | a888ae84355fe7fe3a936ce8077b3ac0ba8bb970 (diff) | |
download | infinity-for-reddit-bde545b75fa4beb140a6ce10861d178505a16bdc.tar infinity-for-reddit-bde545b75fa4beb140a6ce10861d178505a16bdc.tar.gz infinity-for-reddit-bde545b75fa4beb140a6ce10861d178505a16bdc.tar.bz2 infinity-for-reddit-bde545b75fa4beb140a6ce10861d178505a16bdc.tar.lz infinity-for-reddit-bde545b75fa4beb140a6ce10861d178505a16bdc.tar.xz infinity-for-reddit-bde545b75fa4beb140a6ce10861d178505a16bdc.tar.zst infinity-for-reddit-bde545b75fa4beb140a6ce10861d178505a16bdc.zip |
Implemente a chat UI for private messages.
Diffstat (limited to 'app/src/main/res')
5 files changed, 126 insertions, 8 deletions
diff --git a/app/src/main/res/drawable/private_message_ballon_received.xml b/app/src/main/res/drawable/private_message_ballon_received.xml new file mode 100644 index 00000000..522d5cf0 --- /dev/null +++ b/app/src/main/res/drawable/private_message_ballon_received.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid + android:color="#4185F4" > + </solid> + + <corners + android:radius="22dp"> + </corners> +</shape> diff --git a/app/src/main/res/drawable/private_message_ballon_sent.xml b/app/src/main/res/drawable/private_message_ballon_sent.xml new file mode 100644 index 00000000..e813c552 --- /dev/null +++ b/app/src/main/res/drawable/private_message_ballon_sent.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid + android:color="#31BF7D" > + </solid> + + <corners + android:radius="22dp"> + </corners> +</shape>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_view_private_messages.xml b/app/src/main/res/layout/activity_view_private_messages.xml index 67c665a9..3819bc4d 100644 --- a/app/src/main/res/layout/activity_view_private_messages.xml +++ b/app/src/main/res/layout/activity_view_private_messages.xml @@ -40,12 +40,4 @@ android:clipToPadding="false" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> - <com.google.android.material.floatingactionbutton.FloatingActionButton - android:id="@+id/fab_view_private_messages_activity" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="bottom|end" - android:layout_margin="@dimen/fab_margin" - app:srcCompat="@drawable/ic_add_day_night_24dp" /> - </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_private_message_received.xml b/app/src/main/res/layout/item_private_message_received.xml new file mode 100644 index 00000000..f3ba1c88 --- /dev/null +++ b/app/src/main/res/layout/item_private_message_received.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content" + android:paddingTop="8dp" + android:paddingBottom="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:animateLayoutChanges="true"> + + <pl.droidsonroids.gif.GifImageView + android:id="@+id/avatar_image_view_item_private_message_received" + android:layout_width="36dp" + android:layout_height="36dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintEnd_toStartOf="@id/barrier3" /> + + <TextView + android:id="@+id/message_text_view_item_private_message_received" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:paddingTop="12dp" + android:paddingBottom="12dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:layout_marginStart="16dp" + android:textSize="?attr/content_font_16" + app:layout_constraintBottom_toTopOf="@id/time_text_view_item_private_message_received" + app:layout_constraintStart_toEndOf="@id/avatar_image_view_item_private_message_received" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintWidth_max="wrap" + app:layout_constraintWidth_percent="0.7" + app:layout_constraintHorizontal_bias="0" /> + + <TextView + android:id="@+id/time_text_view_item_private_message_received" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:textSize="?attr/font_default" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/avatar_image_view_item_private_message_received" + app:layout_constraintTop_toBottomOf="@id/message_text_view_item_private_message_received" + app:layout_constraintWidth_max="wrap" + app:layout_constraintWidth_percent="0.7" + app:layout_constraintHorizontal_bias="0" /> + + <androidx.constraintlayout.widget.Barrier + android:id="@+id/barrier3" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:barrierDirection="start" + app:constraint_referenced_ids="message_text_view_item_private_message_received, time_text_view_item_private_message_received" /> + +</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_private_message_sent.xml b/app/src/main/res/layout/item_private_message_sent.xml new file mode 100644 index 00000000..62951ba4 --- /dev/null +++ b/app/src/main/res/layout/item_private_message_sent.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content" + android:paddingTop="8dp" + android:paddingBottom="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:animateLayoutChanges="true"> + + <TextView + android:id="@+id/message_text_view_item_private_message_sent" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:paddingTop="12dp" + android:paddingBottom="12dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:textSize="?attr/content_font_16" + app:layout_constraintBottom_toTopOf="@id/time_text_view_item_private_message_sent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintWidth_max="wrap" + app:layout_constraintWidth_percent="0.7" + app:layout_constraintHorizontal_bias="1" /> + + <TextView + android:id="@+id/time_text_view_item_private_message_sent" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:textSize="?attr/font_default" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/message_text_view_item_private_message_sent" + app:layout_constraintWidth_max="wrap" + app:layout_constraintWidth_percent="0.7" + app:layout_constraintHorizontal_bias="1" /> + +</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file |