[android] Use a nested RecyclerView with a single items to show image attachments

This is preparation for showing multiple image attachments in one
message bubble.
This commit is contained in:
Torsten Grote
2018-11-28 11:38:31 -02:00
parent cdf4f3a24b
commit c3d44663cd
13 changed files with 270 additions and 106 deletions

View File

@@ -15,7 +15,7 @@
android:background="@drawable/msg_in"
android:elevation="@dimen/message_bubble_elevation">
<ImageView
<android.support.v7.widget.RecyclerView
android:id="@+id/imageView"
android:layout_width="@dimen/message_bubble_image_default"
android:layout_height="@dimen/message_bubble_image_default"
@@ -23,6 +23,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription"
tools:listitem="@layout/list_item_image"
tools:src="@drawable/alerts_and_states_error"/>
<com.vanniktech.emoji.EmojiTextView

View File

@@ -15,7 +15,7 @@
android:background="@drawable/msg_in"
android:elevation="@dimen/message_bubble_elevation">
<ImageView
<android.support.v7.widget.RecyclerView
android:id="@+id/imageView"
android:layout_width="@dimen/message_bubble_image_default"
android:layout_height="@dimen/message_bubble_image_default"
@@ -23,6 +23,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription"
tools:listitem="@layout/list_item_image"
tools:src="@drawable/alerts_and_states_error"/>
<com.vanniktech.emoji.EmojiTextView

View File

@@ -15,7 +15,7 @@
android:background="@drawable/msg_in"
android:elevation="@dimen/message_bubble_elevation">
<ImageView
<android.support.v7.widget.RecyclerView
android:id="@+id/imageView"
android:layout_width="@dimen/message_bubble_image_default"
android:layout_height="@dimen/message_bubble_image_default"
@@ -23,7 +23,8 @@
app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription"/>
tools:ignore="ContentDescription"
tools:listitem="@layout/list_item_image"/>
<com.vanniktech.emoji.EmojiTextView
android:id="@+id/text"

View File

@@ -21,7 +21,7 @@
android:background="@drawable/msg_out"
android:elevation="@dimen/message_bubble_elevation">
<ImageView
<android.support.v7.widget.RecyclerView
android:id="@+id/imageView"
android:layout_width="@dimen/message_bubble_image_default"
android:layout_height="@dimen/message_bubble_image_default"

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageView
android:id="@+id/imageView"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/message_bubble_image_default"
android:layout_height="@dimen/message_bubble_image_default"
tools:ignore="ContentDescription"
tools:src="@drawable/alerts_and_states_error"/>