Skip to content

Commit d147522

Browse files
alex-signalcody-signal
authored andcommitted
Add chevron to pending participants view.
1 parent 636b5a4 commit d147522

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

22.9 KB
Binary file not shown.

app/src/main/java/org/thoughtcrime/securesms/components/webrtc/PendingParticipantsView.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package org.thoughtcrime.securesms.components.webrtc
77

88
import android.content.Context
9+
import android.text.SpannableStringBuilder
910
import android.util.AttributeSet
1011
import android.view.View
1112
import android.widget.TextView
@@ -14,8 +15,10 @@ import com.google.android.material.button.MaterialButton
1415
import com.google.android.material.card.MaterialCardView
1516
import org.thoughtcrime.securesms.R
1617
import org.thoughtcrime.securesms.components.AvatarImageView
18+
import org.thoughtcrime.securesms.fonts.SignalSymbols
1719
import org.thoughtcrime.securesms.recipients.Recipient
1820
import org.thoughtcrime.securesms.service.webrtc.PendingParticipantCollection
21+
import org.thoughtcrime.securesms.util.SpanUtil
1922
import org.thoughtcrime.securesms.util.visible
2023

2124
/**
@@ -55,8 +58,14 @@ class PendingParticipantsView @JvmOverloads constructor(
5558
avatar.setAvatar(firstRecipient)
5659
avatar.setOnClickListener { listener?.onLaunchRecipientSheet(firstRecipient) }
5760

58-
name.text = firstRecipient.getShortDisplayName(context)
59-
61+
name.text = SpannableStringBuilder(firstRecipient.getShortDisplayName(context))
62+
.append(" ")
63+
.append(SpanUtil.ofSize(
64+
SignalSymbols.getSpannedString(context, SignalSymbols.Weight.REGULAR, SignalSymbols.Glyph.CHEVRON_RIGHT),
65+
16
66+
))
67+
name.setOnClickListener { listener?.onLaunchRecipientSheet(firstRecipient) }
68+
6069
allow.setOnClickListener { listener?.onAllowPendingRecipient(firstRecipient) }
6170
reject.setOnClickListener { listener?.onRejectPendingRecipient(firstRecipient) }
6271

app/src/main/java/org/thoughtcrime/securesms/fonts/SignalSymbols.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ object SignalSymbols {
2222
}
2323

2424
enum class Weight {
25-
BOLD
25+
BOLD,
26+
REGULAR
2627
}
2728

2829
private val cache = mutableMapOf<Weight, Typeface>()
@@ -45,6 +46,7 @@ object SignalSymbols {
4546
private fun getTypeface(context: Context, weight: Weight): Typeface {
4647
return when (weight) {
4748
Weight.BOLD -> getBoldWeightedFont(context)
49+
Weight.REGULAR -> getRegularWeightedFont(context)
4850
else -> error("Unsupported weight: $weight")
4951
}
5052
}
@@ -60,6 +62,17 @@ object SignalSymbols {
6062
}
6163
}
6264

65+
private fun getRegularWeightedFont(context: Context): Typeface {
66+
return cache.getOrPut(
67+
Weight.REGULAR
68+
) {
69+
Typeface.createFromAsset(
70+
context.assets,
71+
"fonts/SignalSymbols-Regular.otf"
72+
)
73+
}
74+
}
75+
6376
/**
6477
* Custom TypefaceSpan to support TypefaceSpan in API<28
6578
*

0 commit comments

Comments
 (0)