mirror of
https://github.com/yuliskov/SmartTube.git
synced 2025-05-17 19:35:54 +08:00
comments: bold header + seekbar focus fix
This commit is contained in:
@ -35,7 +35,7 @@ public interface IMessage {
|
||||
*
|
||||
* @return the message text
|
||||
*/
|
||||
String getText();
|
||||
CharSequence getText();
|
||||
|
||||
/**
|
||||
* Returns message author. See the {@link IUser} for more details
|
||||
|
@ -391,6 +391,12 @@ public class Utils {
|
||||
return spannable;
|
||||
}
|
||||
|
||||
public static CharSequence bold(CharSequence string) {
|
||||
SpannableString spannable = new SpannableString(string);
|
||||
spannable.setSpan(new StyleSpan(Typeface.BOLD), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
return spannable;
|
||||
}
|
||||
|
||||
public static CharSequence icon(Context context, int resId, int lineHeight) {
|
||||
SpannableString spannable = new SpannableString(" ");
|
||||
Drawable drawable = ContextCompat.getDrawable(context, resId);
|
||||
|
@ -255,6 +255,11 @@ public final class SeekBar extends View {
|
||||
mBarHeight / 2 + secondProgressPixels, height - verticalPadding);
|
||||
|
||||
mKnobx = radius + (int) progressPixels;
|
||||
|
||||
for (SeekBarRectangle seekBarRectangle : mSeekBarRectangles) {
|
||||
seekBarRectangle.rect.set(seekBarRectangle.rect.left, verticalPadding, seekBarRectangle.rect.right, height - verticalPadding);
|
||||
}
|
||||
|
||||
invalidate();
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.liskovsoft.smartyoutubetv2.tv.ui.widgets.chat;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import com.liskovsoft.mediaserviceinterfaces.data.ChatItem;
|
||||
import com.liskovsoft.mediaserviceinterfaces.data.CommentItem;
|
||||
import com.liskovsoft.smartyoutubetv2.common.app.models.data.Video;
|
||||
import com.liskovsoft.smartyoutubetv2.common.utils.Utils;
|
||||
import com.liskovsoft.youtubeapi.common.helpers.ServiceHelper;
|
||||
import com.stfalcon.chatkit.commons.models.IMessage;
|
||||
|
||||
@ -10,7 +12,7 @@ import java.util.Date;
|
||||
|
||||
public class ChatItemMessage implements IMessage {
|
||||
private String mId;
|
||||
private String mText;
|
||||
private CharSequence mText;
|
||||
private ChatItemAuthor mAuthor;
|
||||
private Date mCreatedAt;
|
||||
private String mNestedCommentsKey;
|
||||
@ -31,12 +33,12 @@ public class ChatItemMessage implements IMessage {
|
||||
ChatItemMessage message = new ChatItemMessage();
|
||||
message.mId = commentItem.getId();
|
||||
if (commentItem.getMessage() != null && !commentItem.getMessage().trim().isEmpty()) {
|
||||
message.mText = String.format("%s: %s",
|
||||
ServiceHelper.combineItems(" " + Video.TERTIARY_TEXT_DELIM + " ",
|
||||
commentItem.getAuthorName(),
|
||||
commentItem.getLikesCount(),
|
||||
commentItem.getPublishedDate()),
|
||||
commentItem.getMessage());
|
||||
String header = ServiceHelper.combineItems(
|
||||
" " + Video.TERTIARY_TEXT_DELIM + " ",
|
||||
commentItem.getAuthorName(),
|
||||
commentItem.getLikesCount(),
|
||||
commentItem.getPublishedDate());
|
||||
message.mText = TextUtils.concat(Utils.bold(header), "\n", commentItem.getMessage());
|
||||
}
|
||||
message.mAuthor = ChatItemAuthor.from(commentItem);
|
||||
message.mCreatedAt = new Date();
|
||||
@ -51,7 +53,7 @@ public class ChatItemMessage implements IMessage {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
public CharSequence getText() {
|
||||
return mText;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user