UI binding can never be null

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-12-29 11:14:16 +01:00
parent 9ae722659f
commit b36195dc9a
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B

View File

@ -196,63 +196,61 @@ public class ParticipantItem extends AbstractFlexibleItem<ParticipantItem.Partic
holder.binding.videoCallIcon.setVisibility(View.GONE);
}
if (holder.binding.secondaryText != null) {
String userType = "";
String userType = "";
switch (new EnumParticipantTypeConverter().convertToInt(participant.getType())) {
case 1:
//userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_owner);
//break;
case 2:
case 6: // Guest moderator
switch (new EnumParticipantTypeConverter().convertToInt(participant.getType())) {
case 1:
//userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_owner);
//break;
case 2:
case 6: // Guest moderator
userType = NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_moderator);
break;
case 3:
userType = NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_user);
if (participant.getCalculatedActorType() == Participant.ActorType.GROUPS) {
userType = NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_moderator);
break;
case 3:
.getString(R.string.nc_group);
}
if (participant.getCalculatedActorType() == Participant.ActorType.CIRCLES) {
userType = NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_user);
if (participant.getCalculatedActorType() == Participant.ActorType.GROUPS) {
userType = NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_group);
}
if (participant.getCalculatedActorType() == Participant.ActorType.CIRCLES) {
userType = NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_circle);
}
break;
case 4:
userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest);
if (participant.getCalculatedActorType() == Participant.ActorType.EMAILS) {
userType = NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_email);
}
break;
case 5:
.getString(R.string.nc_circle);
}
break;
case 4:
userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest);
if (participant.getCalculatedActorType() == Participant.ActorType.EMAILS) {
userType = NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_following_link);
break;
default:
break;
}
.getString(R.string.nc_email);
}
break;
case 5:
userType = NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_following_link);
break;
default:
break;
}
if (!userType.equals(NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_user))) {
holder.binding.secondaryText.setText("(" + userType + ")");
}
if (!userType.equals(NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_user))) {
holder.binding.secondaryText.setText("(" + userType + ")");
}
}