From 0677a7d4b67ef228d65aa613e83bc44f910ccd0b Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Mon, 2 Oct 2023 16:41:30 +0200 Subject: [PATCH] remove unused resources + reformat Signed-off-by: Marcel Hibbe --- .../CreateConversationDialogFragment.kt | 23 +- .../RenameConversationDialogFragment.kt | 10 +- .../talk/utils/remapchat/RemapChatModel.kt | 12 - app/src/main/res/layout/activity_contacts.xml | 34 -- .../res/layout/activity_conversation_info.xml | 521 +++++++++--------- .../main/res/layout/controller_entry_menu.xml | 84 --- .../res/layout/controller_operations_menu.xml | 93 ---- .../res/layout/dialog_bottom_contacts.xml | 31 -- .../dialog_join_conversation_via_link.xml | 52 -- app/src/main/res/values/strings.xml | 26 +- 10 files changed, 275 insertions(+), 611 deletions(-) delete mode 100644 app/src/main/java/com/nextcloud/talk/utils/remapchat/RemapChatModel.kt delete mode 100644 app/src/main/res/layout/controller_entry_menu.xml delete mode 100644 app/src/main/res/layout/controller_operations_menu.xml delete mode 100644 app/src/main/res/layout/dialog_bottom_contacts.xml delete mode 100644 app/src/main/res/layout/dialog_join_conversation_via_link.xml diff --git a/app/src/main/java/com/nextcloud/talk/conversation/CreateConversationDialogFragment.kt b/app/src/main/java/com/nextcloud/talk/conversation/CreateConversationDialogFragment.kt index 900ed624c91..142dc6e2745 100644 --- a/app/src/main/java/com/nextcloud/talk/conversation/CreateConversationDialogFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/conversation/CreateConversationDialogFragment.kt @@ -118,8 +118,8 @@ class CreateConversationDialogFragment : DialogFragment() { .setTitle(resources.getString(R.string.nc_call_name)) // listener is null for now to avoid closing after button was clicked. // listener is set later in onStart - .setPositiveButton("create", null) - .setNegativeButton("cancel", null) + .setPositiveButton(R.string.nc_common_create, null) + .setNegativeButton(R.string.nc_common_dismiss, null) .setView(binding.root) viewThemeUtils.dialog.colorMaterialAlertDialogBackground(binding.root.context, dialogBuilder) @@ -133,8 +133,6 @@ class CreateConversationDialogFragment : DialogFragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - themeDialog() - setupListeners() setupStateObserver() @@ -178,21 +176,6 @@ class CreateConversationDialogFragment : DialogFragment() { } } - private fun themeDialog() { - // viewThemeUtils.platform.colorTextView(binding.pollQuestion) - // viewThemeUtils.platform.colorTextView(binding.pollOptions) - // viewThemeUtils.platform.colorTextView(binding.pollSettings) - // - // viewThemeUtils.material.colorTextInputLayout(binding.pollCreateQuestionTextInputLayout) - // - // viewThemeUtils.material.colorMaterialButtonText(binding.pollAddOptionsItem) - // viewThemeUtils.material.colorMaterialButtonText(binding.pollDismiss) - // viewThemeUtils.material.colorMaterialButtonPrimaryFilled(binding.pollCreateButton) - // - // viewThemeUtils.platform.themeCheckbox(binding.pollPrivatePollCheckbox) - // viewThemeUtils.platform.themeCheckbox(binding.pollMultipleAnswersCheckbox) - } - private fun setupListeners() { binding.smileyButton.setOnClickListener { emojiPopup?.toggle() } binding.textEdit.addTextChangedListener(object : TextWatcher { @@ -250,7 +233,7 @@ class CreateConversationDialogFragment : DialogFragment() { .setInputData(data.build()) .build() - WorkManager.getInstance().enqueue(addParticipantsToConversationWorker) + WorkManager.getInstance(requireContext()).enqueue(addParticipantsToConversationWorker) WorkManager.getInstance(requireContext()).getWorkInfoByIdLiveData(addParticipantsToConversationWorker.id) .observeForever { workInfo: WorkInfo? -> diff --git a/app/src/main/java/com/nextcloud/talk/conversation/RenameConversationDialogFragment.kt b/app/src/main/java/com/nextcloud/talk/conversation/RenameConversationDialogFragment.kt index 718ce715258..6c0d3f08c9a 100644 --- a/app/src/main/java/com/nextcloud/talk/conversation/RenameConversationDialogFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/conversation/RenameConversationDialogFragment.kt @@ -77,7 +77,7 @@ class RenameConversationDialogFragment : DialogFragment() { viewModel = ViewModelProvider(this, viewModelFactory)[RenameConversationViewModel::class.java] roomToken = arguments?.getString(KEY_ROOM_TOKEN)!! - initialName = arguments?.getString(INITIAL_NAME_TO_DISPLAY)!! + initialName = arguments?.getString(INITIAL_NAME)!! } @SuppressLint("InflateParams") @@ -88,8 +88,8 @@ class RenameConversationDialogFragment : DialogFragment() { .setTitle(resources.getString(R.string.nc_call_name)) // listener is null for now to avoid closing after button was clicked. // listener is set later in onStart - .setPositiveButton("rename", null) - .setNegativeButton("cancel", null) + .setPositiveButton(R.string.nc_rename_confirm, null) + .setNegativeButton(R.string.nc_common_dismiss, null) .setView(binding.root) viewThemeUtils.dialog.colorMaterialAlertDialogBackground(binding.root.context, dialogBuilder) @@ -214,13 +214,13 @@ class RenameConversationDialogFragment : DialogFragment() { companion object { private val TAG = RenameConversationDialogFragment::class.java.simpleName private const val KEY_ROOM_TOKEN = "keyRoomToken" - private const val INITIAL_NAME_TO_DISPLAY = "initialNameToDisplay" + private const val INITIAL_NAME = "initialName" @JvmStatic fun newInstance(roomTokenParam: String, initialName: String): RenameConversationDialogFragment { val args = Bundle() args.putString(KEY_ROOM_TOKEN, roomTokenParam) - args.putString(INITIAL_NAME_TO_DISPLAY, initialName) + args.putString(INITIAL_NAME, initialName) val fragment = RenameConversationDialogFragment() fragment.arguments = args return fragment diff --git a/app/src/main/java/com/nextcloud/talk/utils/remapchat/RemapChatModel.kt b/app/src/main/java/com/nextcloud/talk/utils/remapchat/RemapChatModel.kt deleted file mode 100644 index 6f4e42e4660..00000000000 --- a/app/src/main/java/com/nextcloud/talk/utils/remapchat/RemapChatModel.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.nextcloud.talk.utils.remapchat - -import android.os.Bundle -import com.bluelinelabs.conductor.ControllerChangeHandler -import com.bluelinelabs.conductor.Router - -data class RemapChatModel( - val router: Router, - val controllerChangeHandler: ControllerChangeHandler, - val chatControllerTag: String, - val bundle: Bundle -) diff --git a/app/src/main/res/layout/activity_contacts.xml b/app/src/main/res/layout/activity_contacts.xml index d52d22c1816..f318fce3026 100644 --- a/app/src/main/res/layout/activity_contacts.xml +++ b/app/src/main/res/layout/activity_contacts.xml @@ -178,40 +178,6 @@ android:textAppearance="@style/ListItem" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_conversation_info.xml b/app/src/main/res/layout/activity_conversation_info.xml index f25f8a84399..f92306cca54 100644 --- a/app/src/main/res/layout/activity_conversation_info.xml +++ b/app/src/main/res/layout/activity_conversation_info.xml @@ -75,36 +75,36 @@ android:orientation="vertical"> + android:id="@+id/conversation_info_name" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/standard_margin" + android:layout_marginTop="@dimen/standard_quarter_margin" + android:layout_marginEnd="@dimen/standard_margin" + android:animateLayoutChanges="true" + android:visibility="gone" + tools:visibility="visible"> - - - + + + - + - - - + android:id="@+id/add_to_favorites_button" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/standard_quarter_margin" + android:orientation="horizontal" + android:padding="@dimen/standard_half_padding" + android:visibility="gone" + tools:visibility="gone"> - + + - + + + + android:padding="@dimen/standard_padding" + android:text="@string/nc_shared_items" + android:textSize="@dimen/headline_text_size" + android:textStyle="bold" /> + + + + - - - - - - - - + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:gravity="center_vertical" + android:text="@string/nc_shared_items_description" + android:textSize="@dimen/two_line_primary_text_size" /> + + + + + android:padding="@dimen/standard_padding" + android:text="@string/nc_conversation_settings" + android:textSize="@dimen/headline_text_size" + android:textStyle="bold" /> + + - - - + android:inputType="none" + android:lines="1" + android:popupTheme="@style/ThemeOverlay.AppTheme.PopupMenu" + android:text="" /> - + + + + + + + + + + + + - + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:gravity="center_vertical" + android:text="@string/nc_participants_add" + android:textSize="@dimen/two_line_primary_text_size" /> + + + + + + + + + android:background="?android:attr/selectableItemBackground" + android:orientation="horizontal" + android:padding="@dimen/standard_padding"> + + - - - - - - - - - - - + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:gravity="center_vertical" + android:text="@string/nc_leave" + android:textColor="@color/design_default_color_error" + android:textSize="@dimen/two_line_primary_text_size" /> - + android:background="?android:attr/selectableItemBackground" + android:orientation="horizontal" + android:padding="@dimen/standard_padding"> + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + android:textSize="@dimen/two_line_primary_text_size" /> + + diff --git a/app/src/main/res/layout/controller_entry_menu.xml b/app/src/main/res/layout/controller_entry_menu.xml deleted file mode 100644 index 4c851cc3f0c..00000000000 --- a/app/src/main/res/layout/controller_entry_menu.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/controller_operations_menu.xml b/app/src/main/res/layout/controller_operations_menu.xml deleted file mode 100644 index b5e63641908..00000000000 --- a/app/src/main/res/layout/controller_operations_menu.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/dialog_bottom_contacts.xml b/app/src/main/res/layout/dialog_bottom_contacts.xml deleted file mode 100644 index cbccc2e9300..00000000000 --- a/app/src/main/res/layout/dialog_bottom_contacts.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - diff --git a/app/src/main/res/layout/dialog_join_conversation_via_link.xml b/app/src/main/res/layout/dialog_join_conversation_via_link.xml deleted file mode 100644 index 8c220581ef3..00000000000 --- a/app/src/main/res/layout/dialog_join_conversation_via_link.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3a8f666da7d..fb549b7d4e7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -49,6 +49,8 @@ How to translate with transifex: Set Dismiss Sorry, something went wrong! + Create + Settings @@ -190,20 +192,27 @@ How to translate with transifex: Do you really want to delete all messages in this conversation? All messages were deleted Rename conversation + Rename Delete conversation Delete Delete all If you delete the conversation, it will also be deleted for all other participants. New conversation - Join with a link List open conversations - Join via web Mark as read Mark as unread Add to favorites Remove from favorites + Added conversation %1$s to favorites + Removed conversation %1$s from favorites + Marked conversation %1$s as unread + Marked conversation %1$s as read + Deleted conversation %1$s + You left the conversation %1$s + Conversation %1$s was renamed + Forward to … @@ -279,15 +288,10 @@ How to translate with transifex: Important conversation Notifications in this conversation will override Do Not Disturb settings - - Sorry, something went wrong! - Target server does not support joining public conversations via mobile phones. You may attempt to join the conversation via web browser. OK, all done! OK Conversation name - Proceed Add emojis - Conversation link is not valid Join the conversation at %1$s/index.php/call/%2$s %1$s invitation \nPassword: %1$s @@ -707,12 +711,4 @@ How to translate with transifex: Calendar Error 429 Too Many Requests - Added conversation %1$s to favorites - Removed conversation %1$s from favorites - Marked conversation %1$s as unread - Marked conversation %1$s as read - Deleted conversation %1$s - You left the conversation %1$s - Conversation %1$s was renamed -