translucent date bubble (aman9das)

This commit is contained in:
Arne 2022-07-05 23:36:28 +02:00
parent e665ca2b0d
commit 5a918fbce1

View file

@ -49,6 +49,7 @@ import android.widget.TextView;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.ColorUtils;
import androidx.core.graphics.drawable.DrawableCompat;
import com.google.common.base.Strings;
@ -1195,6 +1196,8 @@ public class MessageAdapter extends ArrayAdapter<Message> {
viewHolder.status_message.setText(DateUtils.formatDateTime(activity, message.getTimeSent(), DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR));
}
viewHolder.message_box.setBackgroundResource(darkBackground ? R.drawable.date_bubble_dark : R.drawable.date_bubble);
int date_bubble_color = ColorUtils.setAlphaComponent(StyledAttributes.getColor(activity, R.attr.colorAccent), 80); //set alpha to date_bubble
activity.setBubbleColor(viewHolder.message_box, (date_bubble_color), -1); // themed color
return view;
} else if (type == RTP_SESSION) {
final boolean isDarkTheme = activity.isDarkTheme();
@ -1218,6 +1221,8 @@ public class MessageAdapter extends ArrayAdapter<Message> {
viewHolder.indicatorReceived.setImageResource(RtpSessionStatus.getDrawable(received, rtpSessionStatus.successful, isDarkTheme));
viewHolder.indicatorReceived.setAlpha(isDarkTheme ? 0.7f : 0.57f);
viewHolder.message_box.setBackgroundResource(darkBackground ? R.drawable.date_bubble_dark : R.drawable.date_bubble);
int date_bubble_color = ColorUtils.setAlphaComponent(StyledAttributes.getColor(activity, R.attr.colorAccent), 80); //set alpha to date bubble
activity.setBubbleColor(viewHolder.message_box, (date_bubble_color), -1); //themed color
return view;
} else if (type == STATUS) {
if ("LOAD_MORE".equals(message.getBody())) {