From 41ab9b98f820afc0435013683c475be613116b48 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Fri, 2 Aug 2024 16:00:24 +1000 Subject: [PATCH 1/3] Updated logic for hiding the input in conversation --- .../securesms/conversation/v2/ConversationViewModel.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt index cbae0e757f..b0a541a9e8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt @@ -261,8 +261,14 @@ class ConversationViewModel( _recipient.updateTo(repository.maybeGetRecipientForThreadId(threadId)) } - fun hidesInputBar(): Boolean = openGroup?.canWrite != true && - blindedRecipient?.blocksCommunityMessageRequests == true + /** + * The input should be hidden when: + * - We are in a community without write access + * - We are dealing with a contact from a community (blinded recipient) that does not allow + * requests form community members + */ + fun hidesInputBar(): Boolean = openGroup?.canWrite == false || + blindedRecipient?.blocksCommunityMessageRequests == true fun legacyBannerRecipient(context: Context): Recipient? = recipient?.run { storage.getLastLegacyRecipient(address.serialize())?.let { Recipient.from(context, Address.fromSerialized(it), false) } From 9ce3ab4b8032b9fdfeaf6d0ac4066fe619389477 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Fri, 2 Aug 2024 16:31:24 +1000 Subject: [PATCH 2/3] Added a background to emoji variations popup --- .../components/emoji/EmojiVariationSelectorPopup.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiVariationSelectorPopup.java b/app/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiVariationSelectorPopup.java index 7f8282d2c6..14a901b3ba 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiVariationSelectorPopup.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiVariationSelectorPopup.java @@ -1,6 +1,7 @@ package org.thoughtcrime.securesms.components.emoji; import android.content.Context; +import android.graphics.drawable.ColorDrawable; import android.view.LayoutInflater; import android.view.ViewGroup; import android.widget.ImageView; @@ -8,6 +9,8 @@ import android.widget.PopupWindow; import androidx.annotation.NonNull; +import org.session.libsession.utilities.ThemeUtil; + import java.util.List; import network.loki.messenger.R; @@ -26,7 +29,9 @@ public class EmojiVariationSelectorPopup extends PopupWindow { this.listener = listener; this.list = (ViewGroup) getContentView(); - setBackgroundDrawable(null); + setBackgroundDrawable( + new ColorDrawable(ThemeUtil.getThemedColor(context, R.attr.colorPrimary)) + ); setOutsideTouchable(true); } From 48554fada7676fa6d9899be540297bb9d7afa0da Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Sat, 3 Aug 2024 09:42:02 +1000 Subject: [PATCH 3/3] [SES-2494] Applying proper styling for message request --- .../securesms/home/HomeAdapter.kt | 1 - .../layout/view_message_request_banner.xml | 28 ++++--------------- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/home/HomeAdapter.kt b/app/src/main/java/org/thoughtcrime/securesms/home/HomeAdapter.kt index 47b6252165..453d15050a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/home/HomeAdapter.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/home/HomeAdapter.kt @@ -104,7 +104,6 @@ class HomeAdapter( holder.binding.run { messageRequests?.let { unreadCountTextView.text = it.count - timestampTextView.text = it.timestamp } } } diff --git a/app/src/main/res/layout/view_message_request_banner.xml b/app/src/main/res/layout/view_message_request_banner.xml index c03e9c1cdf..e4b7d03232 100644 --- a/app/src/main/res/layout/view_message_request_banner.xml +++ b/app/src/main/res/layout/view_message_request_banner.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/conversation_view_background" + android:background="@drawable/conversation_unread_background" android:contentDescription="@string/AccessibilityId_message_request_banner" android:gravity="center_vertical" android:orientation="horizontal" @@ -19,7 +19,8 @@ android:layout_marginStart="@dimen/medium_spacing" android:padding="10dp" android:src="@drawable/ic_outline_message_requests_24" - app:circleColor="#585858" + android:tint="?unreadIndicatorTextColor" + app:circleColor="?unreadIndicatorBackgroundColor" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -47,7 +48,7 @@ android:layout_height="20dp" android:layout_marginStart="4dp" android:background="@drawable/circle_tintable" - android:backgroundTint="#585858" + android:backgroundTint="?unreadIndicatorBackgroundColor" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toEndOf="@id/conversationViewDisplayNameTextView" app:layout_constraintTop_toTopOf="parent"> @@ -57,30 +58,11 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" - android:textColor="@color/white" + android:textColor="?unreadIndicatorTextColor" android:textSize="@dimen/very_small_font_size" android:textStyle="bold" tools:text="8" /> - -