mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-01-05 21:40:47 -06:00
chatkit padding fix for api 19
This commit is contained in:
@@ -774,6 +774,12 @@ public class MessagesListAdapter<MESSAGE extends IMessage>
|
||||
View bubble = v.findViewById(R.id.bubble);
|
||||
//bubble.setBackgroundResource(hasFocus ? R.drawable.shape_incoming_message_focused : R.drawable.shape_incoming_message);
|
||||
|
||||
// Save the current padding (API 19 fix)
|
||||
int paddingLeft = bubble.getPaddingLeft();
|
||||
int paddingTop = bubble.getPaddingTop();
|
||||
int paddingRight = bubble.getPaddingRight();
|
||||
int paddingBottom = bubble.getPaddingBottom();
|
||||
|
||||
if (hasFocus) {
|
||||
// Invert text and bg color
|
||||
Drawable originalBackground = messagesListStyle.getIncomingBubbleDrawable();
|
||||
@@ -785,6 +791,9 @@ public class MessagesListAdapter<MESSAGE extends IMessage>
|
||||
bubble.setBackground(originalBackground);
|
||||
}
|
||||
|
||||
// Restore the padding (API 19 fix)
|
||||
bubble.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);
|
||||
|
||||
if (hasFocus) {
|
||||
notifyMessageViewFocused(v, wrapper.item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user