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); holder.binding.videoCallIcon.setVisibility(View.GONE);
} }
if (holder.binding.secondaryText != null) { String userType = "";
String userType = "";
switch (new EnumParticipantTypeConverter().convertToInt(participant.getType())) { switch (new EnumParticipantTypeConverter().convertToInt(participant.getType())) {
case 1: case 1:
//userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_owner); //userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_owner);
//break; //break;
case 2: case 2:
case 6: // Guest moderator 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 userType = NextcloudTalkApplication
.Companion .Companion
.getSharedApplication() .getSharedApplication()
.getString(R.string.nc_moderator); .getString(R.string.nc_group);
break; }
case 3: if (participant.getCalculatedActorType() == Participant.ActorType.CIRCLES) {
userType = NextcloudTalkApplication userType = NextcloudTalkApplication
.Companion .Companion
.getSharedApplication() .getSharedApplication()
.getString(R.string.nc_user); .getString(R.string.nc_circle);
if (participant.getCalculatedActorType() == Participant.ActorType.GROUPS) { }
userType = NextcloudTalkApplication break;
.Companion case 4:
.getSharedApplication() userType = NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest);
.getString(R.string.nc_group); if (participant.getCalculatedActorType() == Participant.ActorType.EMAILS) {
}
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:
userType = NextcloudTalkApplication userType = NextcloudTalkApplication
.Companion .Companion
.getSharedApplication() .getSharedApplication()
.getString(R.string.nc_following_link); .getString(R.string.nc_email);
break; }
default: break;
break; case 5:
} userType = NextcloudTalkApplication
.Companion
.getSharedApplication()
.getString(R.string.nc_following_link);
break;
default:
break;
}
if (!userType.equals(NextcloudTalkApplication if (!userType.equals(NextcloudTalkApplication
.Companion .Companion
.getSharedApplication() .getSharedApplication()
.getString(R.string.nc_user))) { .getString(R.string.nc_user))) {
holder.binding.secondaryText.setText("(" + userType + ")"); holder.binding.secondaryText.setText("(" + userType + ")");
}
} }
} }