Add clickable links to notices/requests

This commit is contained in:
Katelyn Dickey
2023-01-03 17:05:08 -05:00
parent d825227eb5
commit 75d5dec45f
4 changed files with 8 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ import static android.view.View.GONE;
import static android.view.View.VISIBLE;
import static org.briarproject.bramble.util.StringUtils.isNullOrEmpty;
import static org.briarproject.bramble.util.StringUtils.trim;
import static org.briarproject.briar.android.util.UiUtils.makeLinksClickable;
@UiThread
@NotNullByDefault
@@ -40,6 +41,7 @@ class ConversationNoticeViewHolder extends ConversationItemViewHolder {
} else {
msgText.setVisibility(VISIBLE);
msgText.setText(trim(text));
makeLinksClickable(msgText, listener::onLinkClick);
layout.setBackgroundResource(isIncoming() ?
R.drawable.notice_in_bottom : R.drawable.notice_out_bottom);
}

View File

@@ -21,6 +21,8 @@
android:layout_marginRight="@dimen/message_bubble_margin_non_tail"
android:background="@drawable/msg_in_top"
android:elevation="@dimen/message_bubble_elevation"
android:textColorLink="@color/briar_text_link"
android:autoLink="web"
tools:text="Short message"
tools:visibility="visible" />

View File

@@ -23,6 +23,8 @@
android:background="@drawable/msg_out_top"
android:elevation="@dimen/message_bubble_elevation"
android:textColor="@color/briar_text_primary_inverse"
android:textColorLink="@color/briar_text_link_inverse"
android:autoLink="web"
tools:text="This is a long long long message that spans over several lines.\n\nIt ends here."
tools:visibility="visible" />

View File

@@ -22,6 +22,8 @@
android:background="@drawable/msg_in_top"
android:elevation="@dimen/message_bubble_elevation"
android:textColor="?android:attr/textColorPrimary"
android:textColorLink="@color/briar_text_link"
android:autoLink="web"
tools:text="Short message"
tools:visibility="visible" />