mirror of
https://github.com/yuliskov/SmartTube.git
synced 2025-08-06 20:10:13 +08:00
comments: add dark colors upd
This commit is contained in:
@ -21,6 +21,7 @@ import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.text.Spannable;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.util.SparseArray;
|
||||
@ -30,6 +31,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.LayoutRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@ -770,20 +772,17 @@ public class MessagesListAdapter<MESSAGE extends IMessage>
|
||||
// Change background of the focused message
|
||||
// NOTE: you can have only one focus listener
|
||||
View bubble = v.findViewById(R.id.bubble);
|
||||
TextView text = v.findViewById(R.id.messageText);
|
||||
//bubble.setBackgroundResource(hasFocus ? R.drawable.shape_incoming_message_focused : R.drawable.shape_incoming_message);
|
||||
|
||||
if (hasFocus) {
|
||||
// Invert text and bg color
|
||||
Drawable originalBackground = messagesListStyle.getIncomingBubbleDrawable();
|
||||
DrawableCompat.setTint(originalBackground, messagesListStyle.getIncomingTextColor()); // keep original shape
|
||||
bubble.setBackground(originalBackground);
|
||||
text.setTextColor(Helpers.invertColor(messagesListStyle.getIncomingTextColor()));
|
||||
Drawable shapeBackground = ContextCompat.getDrawable(bubble.getContext(), R.drawable.shape_incoming_message_focused);
|
||||
bubble.setBackground(new LayerDrawable(new Drawable[]{originalBackground, shapeBackground}));
|
||||
} else {
|
||||
// Revert to original
|
||||
Drawable originalBackground = messagesListStyle.getIncomingBubbleDrawable();
|
||||
bubble.setBackground(originalBackground);
|
||||
text.setTextColor(messagesListStyle.getIncomingTextColor());
|
||||
}
|
||||
|
||||
if (hasFocus) {
|
||||
|
@ -29,6 +29,6 @@
|
||||
<color name="dialog_date_text">@color/warm_grey_two</color>
|
||||
<color name="dialog_unread_text">@color/white</color>
|
||||
<color name="dialog_unread_bubble">@color/dark_mint</color>
|
||||
<color name="tg_selected_bg">#c2dcf2</color>
|
||||
<color name="tg_selected_bg">#1EC2DCF2</color>
|
||||
|
||||
</resources>
|
Reference in New Issue
Block a user