@@ -232,6 +232,8 @@ public static class ChatHolder extends RecyclerView.ViewHolder {
232
232
private final FrameLayout mRightArrow ;
233
233
private final RelativeLayout mMessageContainer ;
234
234
private final LinearLayout mMessage ;
235
+ private final int mGreen300 ;
236
+ private final int mGray300 ;
235
237
236
238
public ChatHolder (View itemView ) {
237
239
super (itemView );
@@ -241,17 +243,19 @@ public ChatHolder(View itemView) {
241
243
mRightArrow = (FrameLayout ) itemView .findViewById (R .id .right_arrow );
242
244
mMessageContainer = (RelativeLayout ) itemView .findViewById (R .id .message_container );
243
245
mMessage = (LinearLayout ) itemView .findViewById (R .id .message );
246
+ mGreen300 = ContextCompat .getColor (itemView .getContext (), R .color .material_green_300 );
247
+ mGray300 = ContextCompat .getColor (itemView .getContext (), R .color .material_gray_300 );
244
248
}
245
249
246
250
public void setIsSender (boolean isSender ) {
247
251
final int color ;
248
252
if (isSender ) {
249
- color = ContextCompat . getColor ( itemView . getContext (), R . color . material_green_300 ) ;
253
+ color = mGreen300 ;
250
254
mLeftArrow .setVisibility (View .GONE );
251
255
mRightArrow .setVisibility (View .VISIBLE );
252
256
mMessageContainer .setGravity (Gravity .END );
253
257
} else {
254
- color = ContextCompat . getColor ( itemView . getContext (), R . color . material_gray_300 ) ;
258
+ color = mGray300 ;
255
259
mLeftArrow .setVisibility (View .VISIBLE );
256
260
mRightArrow .setVisibility (View .GONE );
257
261
mMessageContainer .setGravity (Gravity .START );
0 commit comments