1

enter image description here

How would I make it so the textview begins a new line starting all the way to the left, but also retaining the property "toTheRightOf" username25?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <TextView
        android:id="@+id/model_rv_videoactivity_username"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="username25:"
        android:textStyle="bold"
        android:paddingLeft="12dp"
        android:paddingRight="6dp"/>
    <TextView
        android:id="@+id/model_rv_videoactivity_message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@color/colorBlackFont"
        android:text="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
        android:layout_toRightOf="@+id/model_rv_videoactivity_username"/>

</RelativeLayout>

Like this:

enter image description here

WHOATEMYNOODLES
  • 845
  • 9
  • 25

1 Answers1

2

My guess would be that the twitch app makes use of HTML formatting. Essentially using HTML to style specific parts of your text and injecting the different parts of it into just one text view.

Maybe take a look at this: https://developer.android.com/reference/android/text/Html.html#fromHtml(java.lang.String,%20int)

You can use HTMl to style the username25: part of your string and then concatenate the message part to it all in one text view.

Jacob Collins
  • 454
  • 2
  • 4
  • 9