D
D
Dmitry Serkov2016-07-28 19:52:01
Android
Dmitry Serkov, 2016-07-28 19:52:01

Is it possible to programmatically change text color in RecycleView via Binding?

part of the code

<TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:id="@+id/mItem"
            android:textSize="18sp"
            android:layout_toRightOf="@+id/mTime"
            android:text="@{history.mItem}"
            android:layout_weight="15"
            android:textColor="@{history.mColor}" />

text gets up, but textColor does not change. I take the color from R.color.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Serkov, 2016-07-28
@Hutaab

Understood)
Passed to history.mColor not R.color.red, but Color.RED.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question