Add bot indicator overlay to avatars (#1173)
* Add bot indicator overlay to avatars * Add bot overlay to account list in search view * Add preference for bot avatar overlay
This commit is contained in:
parent
63e4c1d4e0
commit
391cd12974
13 changed files with 115 additions and 34 deletions
|
@ -87,6 +87,7 @@ public abstract class StatusViewData {
|
|||
private final Card card;
|
||||
private final boolean isCollapsible; /** Whether the status meets the requirement to be collapse */
|
||||
final boolean isCollapsed; /** Whether the status is shown partially or fully */
|
||||
private final boolean isBot;
|
||||
|
||||
public Concrete(String id, Spanned content, boolean reblogged, boolean favourited,
|
||||
@Nullable String spoilerText, Status.Visibility visibility, List<Attachment> attachments,
|
||||
|
@ -95,7 +96,7 @@ public abstract class StatusViewData {
|
|||
Date createdAt, int reblogsCount, int favouritesCount, @Nullable String inReplyToId,
|
||||
@Nullable Status.Mention[] mentions, String senderId, boolean rebloggingEnabled,
|
||||
Status.Application application, List<Emoji> statusEmojis, List<Emoji> accountEmojis, @Nullable Card card,
|
||||
boolean isCollapsible, boolean isCollapsed) {
|
||||
boolean isCollapsible, boolean isCollapsed, boolean isBot) {
|
||||
this.id = id;
|
||||
if (Build.VERSION.SDK_INT == 23) {
|
||||
// https://github.com/tuskyapp/Tusky/issues/563
|
||||
|
@ -131,6 +132,7 @@ public abstract class StatusViewData {
|
|||
this.card = card;
|
||||
this.isCollapsible = isCollapsible;
|
||||
this.isCollapsed = isCollapsed;
|
||||
this.isBot = isBot;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
@ -179,6 +181,8 @@ public abstract class StatusViewData {
|
|||
return isShowingContent;
|
||||
}
|
||||
|
||||
public boolean isBot(){ return isBot; }
|
||||
|
||||
@Nullable
|
||||
public String getRebloggedAvatar() {
|
||||
return rebloggedAvatar;
|
||||
|
@ -277,6 +281,7 @@ public abstract class StatusViewData {
|
|||
isSensitive == concrete.isSensitive &&
|
||||
isExpanded == concrete.isExpanded &&
|
||||
isShowingContent == concrete.isShowingContent &&
|
||||
isBot == concrete.isBot &&
|
||||
reblogsCount == concrete.reblogsCount &&
|
||||
favouritesCount == concrete.favouritesCount &&
|
||||
rebloggingEnabled == concrete.rebloggingEnabled &&
|
||||
|
@ -402,6 +407,7 @@ public abstract class StatusViewData {
|
|||
private Card card;
|
||||
private boolean isCollapsible; /** Whether the status meets the requirement to be collapsed */
|
||||
private boolean isCollapsed; /** Whether the status is shown partially or fully */
|
||||
private boolean isBot;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
@ -435,6 +441,7 @@ public abstract class StatusViewData {
|
|||
card = viewData.getCard();
|
||||
isCollapsible = viewData.isCollapsible();
|
||||
isCollapsed = viewData.isCollapsed();
|
||||
isBot = viewData.isBot();
|
||||
}
|
||||
|
||||
public Builder setId(String id) {
|
||||
|
@ -497,6 +504,11 @@ public abstract class StatusViewData {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder setIsBot(boolean isBot) {
|
||||
this.isBot = isBot;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setUserFullName(String userFullName) {
|
||||
this.userFullName = userFullName;
|
||||
return this;
|
||||
|
@ -600,7 +612,7 @@ public abstract class StatusViewData {
|
|||
attachments, rebloggedByUsername, rebloggedAvatar, isSensitive, isExpanded,
|
||||
isShowingContent, userFullName, nickname, avatar, createdAt, reblogsCount,
|
||||
favouritesCount, inReplyToId, mentions, senderId, rebloggingEnabled, application,
|
||||
statusEmojis, accountEmojis, card, isCollapsible, isCollapsed);
|
||||
statusEmojis, accountEmojis, card, isCollapsible, isCollapsed, isBot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue