From 5f0563aae35193646dd19aee8e126ba930d0f4b2 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Fri, 9 Aug 2024 12:38:19 +0200 Subject: [PATCH 1/2] fix strings for banning (use 'participant' instead 'actor') replace key ban_actor with ban_participant fix upper/lower case fix to use translation in ConversationInfoActivity instead hardcoded string Signed-off-by: Marcel Hibbe --- .../talk/conversationinfo/ConversationInfoActivity.kt | 2 +- app/src/main/res/layout/dialog_ban_actor.xml | 2 +- app/src/main/res/values/strings.xml | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt b/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt index dad95186b0..e2ec5ef8fb 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt @@ -1311,7 +1311,7 @@ class ConversationInfoActivity : items.add( BasicListItemWithImage( R.drawable.baseline_block_24, - "Ban Participant" + context.getString(R.string.ban_participant) ) ) } diff --git a/app/src/main/res/layout/dialog_ban_actor.xml b/app/src/main/res/layout/dialog_ban_actor.xml index 0bcf22574a..6bb6099257 100644 --- a/app/src/main/res/layout/dialog_ban_actor.xml +++ b/app/src/main/res/layout/dialog_ban_actor.xml @@ -16,7 +16,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/standard_margin" - android:text="@string/ban_actor" + android:text="@string/ban_participant" android:textSize="@dimen/md_title_textsize" /> Edited by %1$s Join conversation %1$s at %2$s Conversation settings - Show Banned Participants - Bans List + Ban participant + Show banned participants + Bans list Unban - Internal Note - Ban Actor + Internal note Ban Show ban reason - Error occured when unbanning actor + Error occurred when unbanning participant From 94fbdb25acfab4c75daa213e22acc406847fb811 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Fri, 9 Aug 2024 12:58:53 +0200 Subject: [PATCH 2/2] rename layouts for banning Signed-off-by: Marcel Hibbe --- .../talk/conversationinfo/ConversationInfoActivity.kt | 8 ++++---- .../{dialog_ban_actor.xml => dialog_ban_participant.xml} | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) rename app/src/main/res/layout/{dialog_ban_actor.xml => dialog_ban_participant.xml} (96%) diff --git a/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt b/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt index e2ec5ef8fb..b4ee2aeb0f 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt @@ -48,7 +48,7 @@ import com.nextcloud.talk.conversationinfo.viewmodel.ConversationInfoViewModel import com.nextcloud.talk.conversationinfoedit.ConversationInfoEditActivity import com.nextcloud.talk.data.user.model.User import com.nextcloud.talk.databinding.ActivityConversationInfoBinding -import com.nextcloud.talk.databinding.DialogBanActorBinding +import com.nextcloud.talk.databinding.DialogBanParticipantBinding import com.nextcloud.talk.events.EventStatus import com.nextcloud.talk.extensions.loadConversationAvatar import com.nextcloud.talk.extensions.loadNoteToSelfAvatar @@ -1375,7 +1375,7 @@ class ConversationInfoActivity : private fun MaterialDialog.handleBan(participant: Participant) { val apiVersion = ApiUtils.getConversationApiVersion(conversationUser, intArrayOf(ApiUtils.API_V4, 1)) - val binding = DialogBanActorBinding.inflate(layoutInflater) + val binding = DialogBanParticipantBinding.inflate(layoutInflater) val actorTypeConverter = EnumActorTypeConverter() val dialog = MaterialAlertDialogBuilder(context) .setView(binding.root) @@ -1391,13 +1391,13 @@ class ConversationInfoActivity : banActor( actorTypeConverter.convertToString(participant.actorType!!), participant.actorId!!, - binding.banActorEdit.text.toString() + binding.banParticipantEdit.text.toString() ) removeAttendeeFromConversation(apiVersion, participant) dialog.dismiss() } binding.buttonClose.setOnClickListener { dialog.dismiss() } - viewThemeUtils.material.colorTextInputLayout(binding.banActorEditLayout) + viewThemeUtils.material.colorTextInputLayout(binding.banParticipantEditLayout) viewThemeUtils.material.colorMaterialButtonPrimaryFilled(binding.buttonBan) viewThemeUtils.material.colorMaterialButtonText(binding.buttonClose) dialog.show() diff --git a/app/src/main/res/layout/dialog_ban_actor.xml b/app/src/main/res/layout/dialog_ban_participant.xml similarity index 96% rename from app/src/main/res/layout/dialog_ban_actor.xml rename to app/src/main/res/layout/dialog_ban_participant.xml index 6bb6099257..0e70695aef 100644 --- a/app/src/main/res/layout/dialog_ban_actor.xml +++ b/app/src/main/res/layout/dialog_ban_participant.xml @@ -24,7 +24,7 @@ android:layout_height="wrap_content" />