diff --git a/presentation/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java b/presentation/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java index ded66e5a8..ec8314d57 100644 --- a/presentation/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java +++ b/presentation/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java @@ -20,6 +20,7 @@ package com.nextcloud.talk.adapters.items; +import android.content.Context; import android.content.res.Resources; import android.graphics.drawable.BitmapDrawable; import android.text.TextUtils; @@ -54,12 +55,15 @@ public class UserItem extends AbstractFlexibleItem private Participant participant; private UserEntity userEntity; private GenericTextHeaderItem header; + private Context activityContext; public boolean isOnline = true; - public UserItem(Participant participant, UserEntity userEntity, GenericTextHeaderItem genericTextHeaderItem) { + public UserItem(Participant participant, UserEntity userEntity, + GenericTextHeaderItem genericTextHeaderItem, Context activityContext) { this.participant = participant; this.userEntity = userEntity; this.header = genericTextHeaderItem; + this.activityContext = activityContext; } @Override @@ -132,8 +136,7 @@ public class UserItem extends AbstractFlexibleItem if (adapter.hasFilter()) { FlexibleUtils.highlightText(holder.contactDisplayName, participant.getDisplayName(), - String.valueOf(adapter.getFilter(String.class)), NextcloudTalkApplication.Companion.getSharedApplication() - .getResources().getColor(R.color.colorPrimary)); + String.valueOf(adapter.getFilter(String.class)), activityContext.getResources().getColor(R.color.colorPrimary)); } holder.contactDisplayName.setText(participant.getDisplayName()); @@ -146,8 +149,7 @@ public class UserItem extends AbstractFlexibleItem if (TextUtils.isEmpty(participant.getSource()) || participant.getSource().equals("users")) { if (Participant.ParticipantType.GUEST.equals(participant.getType()) || Participant.ParticipantType.USER_FOLLOWING_LINK.equals(participant.getType())) { - String displayName = NextcloudTalkApplication.Companion.getSharedApplication() - .getResources().getString(R.string.nc_guest); + String displayName = NextcloudTalkApplication.Companion.getSharedApplication().getResources().getString(R.string.nc_guest); if (!TextUtils.isEmpty(participant.getDisplayName())) { displayName = participant.getDisplayName(); @@ -173,10 +175,10 @@ public class UserItem extends AbstractFlexibleItem } } else if ("groups".equals(participant.getSource())) { - holder.simpleDraweeView.getHierarchy().setImage(new BitmapDrawable(DisplayUtils.getRoundedBitmapFromVectorDrawableResource(NextcloudTalkApplication.Companion.getSharedApplication().getResources(), R.drawable.ic_people_group_white_24px)), 100, true); + holder.simpleDraweeView.getHierarchy().setImage(new BitmapDrawable(DisplayUtils.getRoundedBitmapFromVectorDrawableResource(activityContext.getResources(), R.drawable.ic_people_group_white_24px)), 100, true); } - Resources resources = NextcloudTalkApplication.Companion.getSharedApplication().getResources(); + Resources resources = activityContext.getResources(); if (header == null) { Participant.ParticipantFlags participantFlags = participant.getParticipantFlags(); @@ -184,7 +186,7 @@ public class UserItem extends AbstractFlexibleItem case NOT_IN_CALL: holder.voiceOrSimpleCallImageView.setVisibility(View.GONE); holder.videoCallImageView.setVisibility(View.GONE); - break; + //break; case IN_CALL: holder.voiceOrSimpleCallImageView.setBackground(resources.getDrawable(R.drawable.shape_call_bubble)); holder.voiceOrSimpleCallImageView.setVisibility(View.VISIBLE); @@ -239,7 +241,7 @@ public class UserItem extends AbstractFlexibleItem if (!holder.contactMentionId.getText().equals(userType)) { holder.contactMentionId.setText(userType); - holder.contactMentionId.setTextColor(NextcloudTalkApplication.Companion.getSharedApplication().getResources().getColor(R.color.colorPrimary)); + holder.contactMentionId.setTextColor(activityContext.getResources().getColor(R.color.colorPrimary)); } } } diff --git a/presentation/src/main/java/com/nextcloud/talk/controllers/ContactsController.java b/presentation/src/main/java/com/nextcloud/talk/controllers/ContactsController.java index 7dbf976d2..69ac81bc6 100644 --- a/presentation/src/main/java/com/nextcloud/talk/controllers/ContactsController.java +++ b/presentation/src/main/java/com/nextcloud/talk/controllers/ContactsController.java @@ -545,7 +545,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ participant.setUserId(sharee.getValue().getShareWith()); UserItem newContactItem = new UserItem(participant, currentUser, - userHeaderItems.get(headerTitle)); + userHeaderItems.get(headerTitle), getActivity()); if (!contactItems.contains(newContactItem)) { newUserItemList.add(newContactItem); @@ -582,7 +582,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ UserItem newContactItem = new UserItem(participant, currentUser, - userHeaderItems.get(headerTitle)); + userHeaderItems.get(headerTitle), getActivity()); if (!contactItems.contains(newContactItem)) { newUserItemList.add(newContactItem); diff --git a/presentation/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt b/presentation/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt index d06dd559f..e948788cd 100644 --- a/presentation/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt +++ b/presentation/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt @@ -384,7 +384,7 @@ class ConversationInfoController(args: Bundle) : BaseController(), FlexibleAdapt for (i in participants.indices) { participant = participants[i] - userItem = UserItem(participant, conversationUser, null) + userItem = UserItem(participant, conversationUser, null, activity) userItem.isOnline = !participant.sessionId.equals("0") if (!TextUtils.isEmpty(participant.userId) && participant.userId == conversationUser!!.userId) { ownUserItem = userItem diff --git a/presentation/src/main/res/drawable/ic_file_icon_black_24h.xml b/presentation/src/main/res/drawable/ic_file_icon_black_24h.xml deleted file mode 100644 index 2f5b6207f..000000000 --- a/presentation/src/main/res/drawable/ic_file_icon_black_24h.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - diff --git a/presentation/src/main/res/drawable/shape_call_bubble.xml b/presentation/src/main/res/drawable/shape_call_bubble.xml index c41afbad1..a54633594 100644 --- a/presentation/src/main/res/drawable/shape_call_bubble.xml +++ b/presentation/src/main/res/drawable/shape_call_bubble.xml @@ -23,7 +23,7 @@ - + diff --git a/presentation/src/main/res/drawable/shape_favorite_bubble.xml b/presentation/src/main/res/drawable/shape_favorite_bubble.xml index 70e102dbd..8818c776a 100644 --- a/presentation/src/main/res/drawable/shape_favorite_bubble.xml +++ b/presentation/src/main/res/drawable/shape_favorite_bubble.xml @@ -23,7 +23,7 @@ - + diff --git a/presentation/src/main/res/drawable/shape_lock_bubble.xml b/presentation/src/main/res/drawable/shape_lock_bubble.xml index 4233ed76a..47b5f97ce 100644 --- a/presentation/src/main/res/drawable/shape_lock_bubble.xml +++ b/presentation/src/main/res/drawable/shape_lock_bubble.xml @@ -23,7 +23,7 @@ - + diff --git a/presentation/src/main/res/drawable/shape_video_bubble.xml b/presentation/src/main/res/drawable/shape_video_bubble.xml index eb35cfc2e..21b43f669 100644 --- a/presentation/src/main/res/drawable/shape_video_bubble.xml +++ b/presentation/src/main/res/drawable/shape_video_bubble.xml @@ -23,7 +23,7 @@ - + diff --git a/presentation/src/main/res/drawable/shape_voice_bubble.xml b/presentation/src/main/res/drawable/shape_voice_bubble.xml index 851328b2d..218b75202 100644 --- a/presentation/src/main/res/drawable/shape_voice_bubble.xml +++ b/presentation/src/main/res/drawable/shape_voice_bubble.xml @@ -23,7 +23,7 @@ - + diff --git a/presentation/src/main/res/layout/rv_item_conversation_info_participant.xml b/presentation/src/main/res/layout/rv_item_conversation_info_participant.xml index ed0d32bb0..1269f8693 100644 --- a/presentation/src/main/res/layout/rv_item_conversation_info_participant.xml +++ b/presentation/src/main/res/layout/rv_item_conversation_info_participant.xml @@ -32,13 +32,21 @@ android:layout_centerVertical="true" android:layout_marginStart="@dimen/activity_horizontal_margin"> + + + android:visibility="visible" /> + android:visibility="visible" /> -