Implement mute UI

This commit is contained in:
Niels Andriesse 2020-01-16 11:48:49 +11:00
parent 7519400579
commit eda21064a4
3 changed files with 18 additions and 0 deletions

9
res/drawable/ic_mute.xml Normal file
View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:pathData="M215.03,71.05L126.06,160H24c-13.26,0 -24,10.74 -24,24v144c0,13.25 10.74,24 24,24h102.06l88.97,88.95c15.03,15.03 40.97,4.47 40.97,-16.97V88.02c0,-21.46 -25.96,-31.98 -40.97,-16.97zM461.64,256l45.64,-45.64c6.3,-6.3 6.3,-16.52 0,-22.82l-22.82,-22.82c-6.3,-6.3 -16.52,-6.3 -22.82,0L416,210.36l-45.64,-45.64c-6.3,-6.3 -16.52,-6.3 -22.82,0l-22.82,22.82c-6.3,6.3 -6.3,16.52 0,22.82L370.36,256l-45.63,45.63c-6.3,6.3 -6.3,16.52 0,22.82l22.82,22.82c6.3,6.3 16.52,6.3 22.82,0L416,301.64l45.64,45.64c6.3,6.3 16.52,6.3 22.82,0l22.82,-22.82c6.3,-6.3 6.3,-16.52 0,-22.82L461.64,256z"
android:fillColor="#FFFFFF"/>
</vector>

View File

@ -70,6 +70,14 @@
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical"> android:gravity="center_vertical">
<ImageView
android:id="@+id/muteIndicatorImageView"
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@drawable/ic_mute"
android:layout_marginTop="1dp"
android:layout_marginRight="4dp" />
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content">

View File

@ -64,6 +64,7 @@ class ConversationView : LinearLayout {
val senderDisplayName = if (thread.recipient.isLocalNumber) context.getString(R.string.note_to_self) else thread.recipient.name val senderDisplayName = if (thread.recipient.isLocalNumber) context.getString(R.string.note_to_self) else thread.recipient.name
displayNameTextView.text = senderDisplayName displayNameTextView.text = senderDisplayName
timestampTextView.text = DateUtils.getBriefRelativeTimeSpanString(context, Locale.getDefault(), thread.date) timestampTextView.text = DateUtils.getBriefRelativeTimeSpanString(context, Locale.getDefault(), thread.date)
muteIndicatorImageView.visibility = if (thread.recipient.isMuted) VISIBLE else GONE
val rawSnippet = thread.getDisplayBody(context) val rawSnippet = thread.getDisplayBody(context)
val snippet = highlightMentions(rawSnippet, thread.threadId, context) val snippet = highlightMentions(rawSnippet, thread.threadId, context)
snippetTextView.text = snippet snippetTextView.text = snippet