mirror of
https://github.com/yuliskov/SmartTube.git
synced 2025-08-06 11:59:40 +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.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.graphics.drawable.LayerDrawable;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
@ -30,6 +31,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.LayoutRes;
|
import androidx.annotation.LayoutRes;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.graphics.drawable.DrawableCompat;
|
import androidx.core.graphics.drawable.DrawableCompat;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@ -770,20 +772,17 @@ public class MessagesListAdapter<MESSAGE extends IMessage>
|
|||||||
// Change background of the focused message
|
// Change background of the focused message
|
||||||
// NOTE: you can have only one focus listener
|
// NOTE: you can have only one focus listener
|
||||||
View bubble = v.findViewById(R.id.bubble);
|
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);
|
//bubble.setBackgroundResource(hasFocus ? R.drawable.shape_incoming_message_focused : R.drawable.shape_incoming_message);
|
||||||
|
|
||||||
if (hasFocus) {
|
if (hasFocus) {
|
||||||
// Invert text and bg color
|
// Invert text and bg color
|
||||||
Drawable originalBackground = messagesListStyle.getIncomingBubbleDrawable();
|
Drawable originalBackground = messagesListStyle.getIncomingBubbleDrawable();
|
||||||
DrawableCompat.setTint(originalBackground, messagesListStyle.getIncomingTextColor()); // keep original shape
|
Drawable shapeBackground = ContextCompat.getDrawable(bubble.getContext(), R.drawable.shape_incoming_message_focused);
|
||||||
bubble.setBackground(originalBackground);
|
bubble.setBackground(new LayerDrawable(new Drawable[]{originalBackground, shapeBackground}));
|
||||||
text.setTextColor(Helpers.invertColor(messagesListStyle.getIncomingTextColor()));
|
|
||||||
} else {
|
} else {
|
||||||
// Revert to original
|
// Revert to original
|
||||||
Drawable originalBackground = messagesListStyle.getIncomingBubbleDrawable();
|
Drawable originalBackground = messagesListStyle.getIncomingBubbleDrawable();
|
||||||
bubble.setBackground(originalBackground);
|
bubble.setBackground(originalBackground);
|
||||||
text.setTextColor(messagesListStyle.getIncomingTextColor());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasFocus) {
|
if (hasFocus) {
|
||||||
|
@ -29,6 +29,6 @@
|
|||||||
<color name="dialog_date_text">@color/warm_grey_two</color>
|
<color name="dialog_date_text">@color/warm_grey_two</color>
|
||||||
<color name="dialog_unread_text">@color/white</color>
|
<color name="dialog_unread_text">@color/white</color>
|
||||||
<color name="dialog_unread_bubble">@color/dark_mint</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>
|
</resources>
|
@ -19,7 +19,8 @@
|
|||||||
<color name="leanback">#0096A6</color>
|
<color name="leanback">#0096A6</color>
|
||||||
<color name="semi_transparent">#64000000</color>
|
<color name="semi_transparent">#64000000</color>
|
||||||
<color name="live_chat_bg">#90000000</color>
|
<color name="live_chat_bg">#90000000</color>
|
||||||
<color name="comments_bg">#904D4D4D</color>
|
<color name="comments_bg">#90303030</color>
|
||||||
|
<color name="comments_bg_pressed">#903E3E3E</color>
|
||||||
<color name="semi_grey">#64282828</color>
|
<color name="semi_grey">#64282828</color>
|
||||||
<color name="grey">#282828</color>
|
<color name="grey">#282828</color>
|
||||||
<color name="dimming">#D0000000</color>
|
<color name="dimming">#D0000000</color>
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
app:incomingAvatarWidth="30dp"
|
app:incomingAvatarWidth="30dp"
|
||||||
app:incomingAvatarHeight="30dp"
|
app:incomingAvatarHeight="30dp"
|
||||||
app:incomingDefaultBubbleColor="@color/comments_bg"
|
app:incomingDefaultBubbleColor="@color/comments_bg"
|
||||||
|
app:incomingDefaultBubblePressedColor="@color/comments_bg_pressed"
|
||||||
app:incomingTextColor="@color/white"
|
app:incomingTextColor="@color/white"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user