From 1b13812202031f0912f47a89c50ac6be684ed723 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Fri, 1 Jul 2022 12:16:10 +0200 Subject: [PATCH] solve klint warnings Signed-off-by: Marcel Hibbe --- .../talk/polls/adapters/PollResultViewHolder.kt | 2 +- .../talk/polls/repositories/PollRepositoryImpl.kt | 2 +- .../nextcloud/talk/polls/ui/PollResultsFragment.kt | 6 ++++-- .../com/nextcloud/talk/polls/ui/PollVoteFragment.kt | 12 ++++++++---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultViewHolder.kt b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultViewHolder.kt index 8ec4bd447..e8da7ceee 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultViewHolder.kt @@ -27,4 +27,4 @@ abstract class PollResultViewHolder( open val binding: ViewBinding ) : RecyclerView.ViewHolder(binding.root) { abstract fun bind(pollResultItem: PollResultItem, clickListener: PollResultItemClickListener) -} \ No newline at end of file +} diff --git a/app/src/main/java/com/nextcloud/talk/polls/repositories/PollRepositoryImpl.kt b/app/src/main/java/com/nextcloud/talk/polls/repositories/PollRepositoryImpl.kt index 20d924306..8de92deed 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/repositories/PollRepositoryImpl.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/repositories/PollRepositoryImpl.kt @@ -45,7 +45,7 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid options: List, resultMode: Int, maxVotes: - Int + Int ): Observable? { return ncApi.createPoll( credentials, diff --git a/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt b/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt index 64ed2d784..451a9058b 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/ui/PollResultsFragment.kt @@ -61,8 +61,10 @@ class PollResultsFragment : Fragment(), PollResultItemClickListener { super.onCreate(savedInstanceState) NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this) viewModel = ViewModelProvider(this, viewModelFactory)[PollResultsViewModel::class.java] - parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[PollMainViewModel::class - .java] + parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[ + PollMainViewModel::class + .java + ] user = arguments?.getParcelable(KEY_USER_ENTITY)!! } diff --git a/app/src/main/java/com/nextcloud/talk/polls/ui/PollVoteFragment.kt b/app/src/main/java/com/nextcloud/talk/polls/ui/PollVoteFragment.kt index 78462aa90..c26290720 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/ui/PollVoteFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/ui/PollVoteFragment.kt @@ -64,8 +64,10 @@ class PollVoteFragment : Fragment() { NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this) viewModel = ViewModelProvider(this, viewModelFactory)[PollVoteViewModel::class.java] - parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[PollMainViewModel::class - .java] + parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[ + PollMainViewModel::class + .java + ] roomToken = arguments?.getString(KEY_ROOM_TOKEN)!! pollId = arguments?.getString(KEY_POLL_ID)!! @@ -164,8 +166,10 @@ class PollVoteFragment : Fragment() { } private fun areSelectedOptionsDifferentToVotedOptions(): Boolean { - return !(viewModel.votedOptions.containsAll(viewModel.selectedOptions) && - viewModel.selectedOptions.containsAll(viewModel.votedOptions)) + return !( + viewModel.votedOptions.containsAll(viewModel.selectedOptions) && + viewModel.selectedOptions.containsAll(viewModel.votedOptions) + ) } private fun makeOptionBoldIfSelfVoted(button: CompoundButton, poll: Poll, index: Int) {