Status: Strikethrough the reply info if parent post isn't visible
This commit is contained in:
parent
3240ed3a2c
commit
f59c6d316c
|
@ -3,6 +3,7 @@ package com.keylesspalace.tusky.adapter;
|
|||
import static com.keylesspalace.tusky.viewdata.PollViewDataKt.buildDescription;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
@ -422,6 +423,10 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
|
|||
return;
|
||||
}
|
||||
Context context = replyInfo.getContext();
|
||||
if (status.getParentVisible() == false)
|
||||
replyInfo.setPaintFlags(replyInfo.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
|
||||
else
|
||||
replyInfo.setPaintFlags(replyInfo.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG));
|
||||
replyInfo.setText(context.getString(R.string.status_replied_to_format, replyToAccountAcct));
|
||||
replyInfo.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
|
|
@ -164,6 +164,7 @@ data class Status(
|
|||
data class PleromaStatus(
|
||||
@SerializedName("emoji_reactions") val emojiReactions: List<EmojiReaction>?,
|
||||
@SerializedName("in_reply_to_account_acct") val inReplyToAccountAcct: String?,
|
||||
@SerializedName("parent_visible") val parentVisible: Boolean?,
|
||||
)
|
||||
|
||||
data class Mention(
|
||||
|
|
|
@ -80,6 +80,9 @@ sealed class StatusViewData {
|
|||
val inReplyToAccountAcct: String?
|
||||
get() = status.pleroma?.inReplyToAccountAcct
|
||||
|
||||
val parentVisible: Boolean
|
||||
get() = status.pleroma?.parentVisible ?: true
|
||||
|
||||
val emojiReactions: List<EmojiReaction>?
|
||||
get() = status.actionableStatus.pleroma?.emojiReactions
|
||||
|
||||
|
|
Loading…
Reference in New Issue