Merge branch 'dev' into strings-squashed

This commit is contained in:
Al Lansley 2024-08-05 13:30:03 +10:00
commit d3f8e928b6
4 changed files with 19 additions and 27 deletions

View File

@ -1,6 +1,7 @@
package org.thoughtcrime.securesms.components.emoji; package org.thoughtcrime.securesms.components.emoji;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
@ -8,6 +9,8 @@ import android.widget.PopupWindow;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import org.session.libsession.utilities.ThemeUtil;
import java.util.List; import java.util.List;
import network.loki.messenger.R; import network.loki.messenger.R;
@ -26,7 +29,9 @@ public class EmojiVariationSelectorPopup extends PopupWindow {
this.listener = listener; this.listener = listener;
this.list = (ViewGroup) getContentView(); this.list = (ViewGroup) getContentView();
setBackgroundDrawable(null); setBackgroundDrawable(
new ColorDrawable(ThemeUtil.getThemedColor(context, R.attr.colorPrimary))
);
setOutsideTouchable(true); setOutsideTouchable(true);
} }

View File

@ -261,8 +261,14 @@ class ConversationViewModel(
_recipient.updateTo(repository.maybeGetRecipientForThreadId(threadId)) _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 { fun legacyBannerRecipient(context: Context): Recipient? = recipient?.run {
storage.getLastLegacyRecipient(address.serialize())?.let { Recipient.from(context, Address.fromSerialized(it), false) } storage.getLastLegacyRecipient(address.serialize())?.let { Recipient.from(context, Address.fromSerialized(it), false) }

View File

@ -104,7 +104,6 @@ class HomeAdapter(
holder.binding.run { holder.binding.run {
messageRequests?.let { messageRequests?.let {
unreadCountTextView.text = it.count unreadCountTextView.text = it.count
timestampTextView.text = it.timestamp
} }
} }
} }

View File

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" 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:contentDescription="@string/AccessibilityId_message_request_banner"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
@ -19,7 +19,8 @@
android:layout_marginStart="@dimen/medium_spacing" android:layout_marginStart="@dimen/medium_spacing"
android:padding="10dp" android:padding="10dp"
android:src="@drawable/ic_outline_message_requests_24" android:src="@drawable/ic_outline_message_requests_24"
app:circleColor="#585858" android:tint="?unreadIndicatorTextColor"
app:circleColor="?unreadIndicatorBackgroundColor"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -47,7 +48,7 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_marginStart="4dp" android:layout_marginStart="4dp"
android:background="@drawable/circle_tintable" android:background="@drawable/circle_tintable"
android:backgroundTint="#585858" android:backgroundTint="?unreadIndicatorBackgroundColor"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/conversationViewDisplayNameTextView" app:layout_constraintStart_toEndOf="@id/conversationViewDisplayNameTextView"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
@ -57,30 +58,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:textColor="@color/white" android:textColor="?unreadIndicatorTextColor"
android:textSize="@dimen/very_small_font_size" android:textSize="@dimen/very_small_font_size"
android:textStyle="bold" android:textStyle="bold"
tools:text="8" /> tools:text="8" />
</RelativeLayout> </RelativeLayout>
<TextView
android:id="@+id/timestampTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/medium_spacing"
android:alpha="0.4"
android:ellipsize="end"
android:maxLines="1"
android:textAlignment="textEnd"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/small_font_size"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintStart_toEndOf="@id/unreadCountIndicator"
app:layout_constraintTop_toTopOf="parent"
tools:text="11 Apr, 9:41 AM" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>