Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4186: Uncheck all selection on developer options not working #4383

Merged
merged 21 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0cff83a
Fix #4186 Uncheck all selection on developer options not working
KevinGitonga Jun 7, 2022
5295364
Fix #4186 Add changes to code as suggested on code review.
KevinGitonga Jun 8, 2022
ca5bca5
Fix #4186 Undo changes on line wrap as advised by code reviewer.
KevinGitonga Jun 9, 2022
11fac48
Merge branch 'oppia:develop' into fix-all-checkbox-uncheck-issue
KevinGitonga Jun 13, 2022
8882088
Add tests for #4186.
KevinGitonga Jul 6, 2022
13ce51c
Add tests for #4186, Undo changes on build.gradle.
KevinGitonga Jul 6, 2022
78b48a6
Update and makes changes as advised by code reviewer.
KevinGitonga Jul 7, 2022
f5c78ac
Update test names to deselect from unselect.
KevinGitonga Jul 7, 2022
3d1eddb
Fix broken tests after update.
KevinGitonga Jul 7, 2022
7b2a5f7
Move the 'scrollToPosition' call inside of 'verifyItemCheckedOnRecycl…
KevinGitonga Jul 8, 2022
dffc2ad
Merge branch 'oppia:develop' into fix-all-checkbox-uncheck-issue
KevinGitonga Jul 13, 2022
903012a
Add changes to run tests directly by removing unnecessary verificatio…
KevinGitonga Jul 13, 2022
3f86b8c
Updates tests and fix missed issues supposed to be updated.
KevinGitonga Jul 14, 2022
a0da3c6
Update tests to assert if Checkbox is actually Unchecked after unchec…
KevinGitonga Jul 15, 2022
1f7dd9e
Add testCoroutinesDispatchers.runCurrent() line to avoid MarkChapters…
KevinGitonga Jul 20, 2022
da0dbe5
Fix lint failing test, after update.
KevinGitonga Jul 20, 2022
7fbcff4
Merge branch 'develop' into update-pr-4383
BenHenning Sep 22, 2022
575f3cb
Fix broken view models.
BenHenning Sep 24, 2022
342bacc
Merge pull request #4 from BenHenning/update-4383-to-latest-develop
KevinGitonga Sep 26, 2022
1630af9
Merge branch 'update-4383-to-latest-develop' into update-pr-4383
BenHenning Sep 29, 2022
60b6e25
Merge pull request #3 from BenHenning/update-pr-4383
KevinGitonga Sep 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ class MarkChaptersCompletedFragmentPresenter @Inject constructor(
)
}
}
} else if (binding.isAllChecked == true) {
binding.isAllChecked = false
getMarkChaptersCompletedViewModel().getItemList().forEach { viewModel ->
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
if (viewModel is ChapterSummaryViewModel) {
if (!viewModel.checkIfChapterIsCompleted())
chapterUnselected(
viewModel.chapterIndex,
viewModel.nextStoryIndex
)
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ class MarkStoriesCompletedFragmentPresenter @Inject constructor(
}

binding.markStoriesCompletedAllCheckBoxContainer.setOnClickListener {
if (binding.isAllChecked == null || binding.isAllChecked == false)
if (binding.isAllChecked == null || binding.isAllChecked == false) {
binding.isAllChecked = true
} else if (binding.isAllChecked == true) {
binding.isAllChecked = false
}
}

binding.markStoriesCompletedAllCheckBox.setOnCheckedChangeListener { _, isChecked ->
Expand All @@ -74,6 +77,10 @@ class MarkStoriesCompletedFragmentPresenter @Inject constructor(
if (!viewModel.isCompleted)
storySelected(viewModel.storySummary.storyId)
}
} else {
getMarkStoriesCompletedViewModel().getStorySummaryMap().values.forEach { viewModel ->
if (!viewModel.isCompleted) storyUnselected(viewModel.storySummary.storyId)
}
}
bindingAdapter.notifyDataSetChanged()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,22 @@ class MarkTopicsCompletedFragmentPresenter @Inject constructor(
}

binding.markTopicsCompletedAllCheckBoxContainer.setOnClickListener {
if (binding.isAllChecked == null || binding.isAllChecked == false)
if (binding.isAllChecked == null || binding.isAllChecked == false) {
binding.isAllChecked = true
} else if (binding.isAllChecked == true) {
binding.isAllChecked = false
}
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
}

binding.markTopicsCompletedAllCheckBox.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
getMarkTopicsCompletedViewModel().getTopicList().forEach { viewModel ->
if (!viewModel.isCompleted) topicSelected(viewModel.topic.topicId)
}
} else {
getMarkTopicsCompletedViewModel().getTopicList().forEach { viewModel ->
if (!viewModel.isCompleted) topicUnselected(viewModel.topic.topicId)
}
}
bindingAdapter.notifyDataSetChanged()
}
Expand Down