mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-15 08:45:04 +01:00
Use comparison operator rather than equals for enums in adapters
Fixes SPP_EQUALS_ON_ENUM issue from SpotBugs. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
969c08ea79
commit
fb0fe8587a
@ -145,8 +145,8 @@ public class ContactItem extends AbstractFlexibleItem<ContactItem.ContactItemVie
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (TextUtils.isEmpty(participant.getDisplayName()) &&
|
if (TextUtils.isEmpty(participant.getDisplayName()) &&
|
||||||
(participant.getType().equals(Participant.ParticipantType.GUEST) ||
|
(participant.getType() == Participant.ParticipantType.GUEST ||
|
||||||
participant.getType().equals(Participant.ParticipantType.USER_FOLLOWING_LINK))) {
|
participant.getType() == Participant.ParticipantType.USER_FOLLOWING_LINK)) {
|
||||||
holder.binding.nameText.setText(NextcloudTalkApplication
|
holder.binding.nameText.setText(NextcloudTalkApplication
|
||||||
.Companion
|
.Companion
|
||||||
.getSharedApplication()
|
.getSharedApplication()
|
||||||
@ -167,8 +167,8 @@ public class ContactItem extends AbstractFlexibleItem<ContactItem.ContactItemVie
|
|||||||
|
|
||||||
} else if (
|
} else if (
|
||||||
participant.getCalculatedActorType() == Participant.ActorType.GUESTS ||
|
participant.getCalculatedActorType() == Participant.ActorType.GUESTS ||
|
||||||
Participant.ParticipantType.GUEST.equals(participant.getType()) ||
|
participant.getType() == Participant.ParticipantType.GUEST ||
|
||||||
Participant.ParticipantType.GUEST_MODERATOR.equals(participant.getType())) {
|
participant.getType() == Participant.ParticipantType.GUEST_MODERATOR) {
|
||||||
|
|
||||||
String displayName;
|
String displayName;
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Conversation.ConversationType.ROOM_SYSTEM.equals(conversation.getType())) {
|
if (conversation.getType() == Conversation.ConversationType.ROOM_SYSTEM) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
|
||||||
Drawable[] layers = new Drawable[2];
|
Drawable[] layers = new Drawable[2];
|
||||||
|
@ -140,8 +140,8 @@ public class ParticipantItem extends AbstractFlexibleItem<ParticipantItem.Partic
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (TextUtils.isEmpty(participant.getDisplayName()) &&
|
if (TextUtils.isEmpty(participant.getDisplayName()) &&
|
||||||
(participant.getType().equals(Participant.ParticipantType.GUEST) ||
|
(participant.getType() == Participant.ParticipantType.GUEST ||
|
||||||
participant.getType().equals(Participant.ParticipantType.USER_FOLLOWING_LINK))) {
|
participant.getType() == Participant.ParticipantType.USER_FOLLOWING_LINK)) {
|
||||||
holder.binding.nameText.setText(NextcloudTalkApplication
|
holder.binding.nameText.setText(NextcloudTalkApplication
|
||||||
.Companion
|
.Companion
|
||||||
.getSharedApplication()
|
.getSharedApplication()
|
||||||
@ -170,8 +170,8 @@ public class ParticipantItem extends AbstractFlexibleItem<ParticipantItem.Partic
|
|||||||
holder.binding.avatarDraweeView.setImageResource(R.drawable.ic_circular_mail);
|
holder.binding.avatarDraweeView.setImageResource(R.drawable.ic_circular_mail);
|
||||||
}
|
}
|
||||||
} else if (participant.getCalculatedActorType() == Participant.ActorType.GUESTS ||
|
} else if (participant.getCalculatedActorType() == Participant.ActorType.GUESTS ||
|
||||||
Participant.ParticipantType.GUEST.equals(participant.getType()) ||
|
participant.getType() == Participant.ParticipantType.GUEST ||
|
||||||
Participant.ParticipantType.GUEST_MODERATOR.equals(participant.getType())) {
|
participant.getType() == Participant.ParticipantType.GUEST_MODERATOR) {
|
||||||
|
|
||||||
String displayName = NextcloudTalkApplication.Companion.getSharedApplication()
|
String displayName = NextcloudTalkApplication.Companion.getSharedApplication()
|
||||||
.getResources().getString(R.string.nc_guest);
|
.getResources().getString(R.string.nc_guest);
|
||||||
|
Loading…
Reference in New Issue
Block a user