solve klint warnings

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-07-01 12:16:10 +02:00 committed by Andy Scherzinger (Rebase PR Action)
parent 4c6e4b1c4c
commit 1b13812202
4 changed files with 14 additions and 8 deletions

View file

@ -27,4 +27,4 @@ abstract class PollResultViewHolder(
open val binding: ViewBinding open val binding: ViewBinding
) : RecyclerView.ViewHolder(binding.root) { ) : RecyclerView.ViewHolder(binding.root) {
abstract fun bind(pollResultItem: PollResultItem, clickListener: PollResultItemClickListener) abstract fun bind(pollResultItem: PollResultItem, clickListener: PollResultItemClickListener)
} }

View file

@ -45,7 +45,7 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid
options: List<String>, options: List<String>,
resultMode: Int, resultMode: Int,
maxVotes: maxVotes:
Int Int
): Observable<Poll>? { ): Observable<Poll>? {
return ncApi.createPoll( return ncApi.createPoll(
credentials, credentials,

View file

@ -61,8 +61,10 @@ class PollResultsFragment : Fragment(), PollResultItemClickListener {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this) NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this)
viewModel = ViewModelProvider(this, viewModelFactory)[PollResultsViewModel::class.java] viewModel = ViewModelProvider(this, viewModelFactory)[PollResultsViewModel::class.java]
parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[PollMainViewModel::class parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[
.java] PollMainViewModel::class
.java
]
user = arguments?.getParcelable(KEY_USER_ENTITY)!! user = arguments?.getParcelable(KEY_USER_ENTITY)!!
} }

View file

@ -64,8 +64,10 @@ class PollVoteFragment : Fragment() {
NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this) NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this)
viewModel = ViewModelProvider(this, viewModelFactory)[PollVoteViewModel::class.java] viewModel = ViewModelProvider(this, viewModelFactory)[PollVoteViewModel::class.java]
parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[PollMainViewModel::class parentViewModel = ViewModelProvider(requireParentFragment(), viewModelFactory)[
.java] PollMainViewModel::class
.java
]
roomToken = arguments?.getString(KEY_ROOM_TOKEN)!! roomToken = arguments?.getString(KEY_ROOM_TOKEN)!!
pollId = arguments?.getString(KEY_POLL_ID)!! pollId = arguments?.getString(KEY_POLL_ID)!!
@ -164,8 +166,10 @@ class PollVoteFragment : Fragment() {
} }
private fun areSelectedOptionsDifferentToVotedOptions(): Boolean { private fun areSelectedOptionsDifferentToVotedOptions(): Boolean {
return !(viewModel.votedOptions.containsAll(viewModel.selectedOptions) && return !(
viewModel.selectedOptions.containsAll(viewModel.votedOptions)) viewModel.votedOptions.containsAll(viewModel.selectedOptions) &&
viewModel.selectedOptions.containsAll(viewModel.votedOptions)
)
} }
private fun makeOptionBoldIfSelfVoted(button: CompoundButton, poll: Poll, index: Int) { private fun makeOptionBoldIfSelfVoted(button: CompoundButton, poll: Poll, index: Int) {