renaming a view to make it clearer

This commit is contained in:
tibbi
2020-04-12 21:55:03 +02:00
parent aecaec8773
commit 98e20fc7cd
2 changed files with 8 additions and 7 deletions

View File

@ -169,8 +169,8 @@ class ThreadAdapter(
override fun onViewRecycled(holder: ViewHolder) { override fun onViewRecycled(holder: ViewHolder) {
super.onViewRecycled(holder) super.onViewRecycled(holder)
if (!activity.isDestroyed && !activity.isFinishing && holder.itemView.thread_message_photo != null) { if (!activity.isDestroyed && !activity.isFinishing && holder.itemView.thread_message_sender_photo != null) {
Glide.with(activity).clear(holder.itemView.thread_message_photo) Glide.with(activity).clear(holder.itemView.thread_message_sender_photo)
} }
} }
@ -179,11 +179,11 @@ class ThreadAdapter(
thread_message_body.text = message.body thread_message_body.text = message.body
if (message.isReceivedMessage()) { if (message.isReceivedMessage()) {
thread_message_photo.beVisible() thread_message_sender_photo.beVisible()
thread_message_body.setTextColor(textColor) thread_message_body.setTextColor(textColor)
context.loadImage(message.senderPhotoUri, thread_message_photo, message.senderName) context.loadImage(message.senderPhotoUri, thread_message_sender_photo, message.senderName)
} else { } else {
thread_message_photo?.beGone() thread_message_sender_photo?.beGone()
val background = context.getAdjustedPrimaryColor() val background = context.getAdjustedPrimaryColor()
thread_message_body.background.applyColorFilter(background.adjustAlpha(0.8f)) thread_message_body.background.applyColorFilter(background.adjustAlpha(0.8f))
thread_message_body.setTextColor(background.getContrastColor()) thread_message_body.setTextColor(background.getContrastColor())

View File

@ -18,7 +18,7 @@
app:layout_constraintWidth_percent="0.7"> app:layout_constraintWidth_percent="0.7">
<ImageView <ImageView
android:id="@+id/thread_message_photo" android:id="@+id/thread_message_sender_photo"
android:layout_width="@dimen/avatar_size" android:layout_width="@dimen/avatar_size"
android:layout_height="@dimen/avatar_size" android:layout_height="@dimen/avatar_size"
android:layout_alignBottom="@+id/thread_message_body" android:layout_alignBottom="@+id/thread_message_body"
@ -30,6 +30,7 @@
android:id="@+id/thread_mesage_attachments_holder" android:id="@+id/thread_mesage_attachments_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignStart="@+id/thread_message_body"
android:orientation="vertical" /> android:orientation="vertical" />
<ImageView <ImageView
@ -48,7 +49,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/thread_mesage_attachments_holder" android:layout_below="@+id/thread_mesage_attachments_holder"
android:layout_toEndOf="@+id/thread_message_photo" android:layout_toEndOf="@+id/thread_message_sender_photo"
android:background="@drawable/item_received_background" android:background="@drawable/item_received_background"
android:padding="@dimen/normal_margin" android:padding="@dimen/normal_margin"
android:textSize="@dimen/normal_text_size" android:textSize="@dimen/normal_text_size"