Skip to content

Commit

Permalink
color change for time
Browse files Browse the repository at this point in the history
  • Loading branch information
immohanravi committed Nov 12, 2022
1 parent df2205c commit 2d72aab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/src/main/res/layout/activity_chat_view_test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
app:leftBubbleTextColor="@color/royal_light"
app:rightBubbleTextColor="@color/royal_light"
app:timeTextColor="@color/transparent_black_hex_5"
app:righttimeTextColor="@color/royal_accent"
app:lefttimeTextColor="@color/royal_dark"
android:layout_above="@+id/sendLL"
app:showSenderLayout="true"
app:showSenderName="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public class MessageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
private int rightBubbleLayoutColor = R.color.colorAccent1;
private int leftBubbleTextColor = android.R.color.black;
private int rightBubbleTextColor = android.R.color.white;
private int rightTimeTextColor = android.R.color.white;
private int leftTimeTextColor = android.R.color.black;
private int timeTextColor = android.R.color.tab_indicator_text;
private int senderNameTextColor = android.R.color.tab_indicator_text;
private float textSize = 20;
Expand Down Expand Up @@ -275,7 +277,7 @@ public LeftTextViewHolder(View view) {
leftBubbleIconCV = view.findViewById(R.id.leftBubbleIconCV);
setBackgroundColor(leftBubbleLayoutColor);
setTextColor(leftBubbleTextColor);
setTimeTextColor(timeTextColor);
setTimeTextColor(leftTimeTextColor);
setSenderNameTextColor(senderNameTextColor);
showSenderName(showSenderName);
showLeftBubbleIcon(showLeftBubbleIcon);
Expand Down Expand Up @@ -356,7 +358,7 @@ public RightTextViewHolder(View view) {
rightBubbleIconIV = view.findViewById(R.id.rightBubbleIconIV);
setBackgroundColor(rightBubbleLayoutColor);
setTextColor(rightBubbleTextColor);
setTimeTextColor(timeTextColor);
setTimeTextColor(rightTimeTextColor);
setSenderNameTextColor(senderNameTextColor);
showSenderName(showSenderName);
showRightBubbleIcon(showRightBubbleIcon);
Expand Down Expand Up @@ -1606,6 +1608,13 @@ public void setRightBubbleLayoutColor(int color){

}

public void setRightTimeTextColor(int color){
this.rightTimeTextColor = color;
}
public void setLeftTimeTextColor(int color){
this.leftTimeTextColor = color;
}

public void setLeftBubbleTextColor(int color){
this.leftBubbleTextColor = color;
}
Expand Down
2 changes: 2 additions & 0 deletions chatview/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<attr name="rightBubbleTextColor" format="color" />
<attr name="chatViewBackgroundColor" format="color" />
<attr name="timeTextColor" format="color" />
<attr name="righttimeTextColor" format="color" />
<attr name="lefttimeTextColor" format="color" />
<attr name="chatViewBackground" format="integer" />
<attr name="textSize" format="dimension" />
<attr name="showLeftBubbleIcon" format="boolean" />
Expand Down

0 comments on commit 2d72aab

Please sign in to comment.