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 #2581: Marquee auto restart issue #4392

Merged
merged 56 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
56 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
20e93e4
Fix #2581 Marquee restarts automatically in certain scenarios.
KevinGitonga Jun 10, 2022
841a35e
Fix #2581 Marquee restarts automatically in certain scenarios.
KevinGitonga Jun 13, 2022
f82b874
Fix #2581 Marquee restarts automatically in certain scenarios.
KevinGitonga Jun 10, 2022
008333c
Fix #2581 Marquee restarts automatically in certain scenarios.
KevinGitonga Jun 13, 2022
d4f6dd5
Merge remote-tracking branch 'origin/fix-marquee-auto-restart-issue' …
KevinGitonga Jun 14, 2022
3e99863
Revert "Fix #4186 Undo changes on line wrap as advised by code review…
KevinGitonga Jun 14, 2022
4a60eac
Revert "Fix #4186 Add changes to code as suggested on code review."
KevinGitonga Jun 14, 2022
94222cf
Revert "Fix #4186 Uncheck all selection on developer options not work…
KevinGitonga Jun 14, 2022
c8b74e8
Insert timer in OnClick listener to enable unselect during subsequent…
KevinGitonga Jun 15, 2022
ab46619
Introduce custom translation animation logic to fix issue with the co…
KevinGitonga Aug 18, 2022
962fb0f
Introduce custom translation animation logic to fix issue with the co…
KevinGitonga Aug 18, 2022
aad00e1
Fix some of the failing tests.
KevinGitonga Aug 19, 2022
0e4c837
Fix some of the failing tests.
KevinGitonga Aug 19, 2022
70892d7
Fix some of the failing tests, exclude MarqueeView from tests.
KevinGitonga Aug 19, 2022
40cb71f
Revert some of the changes.
KevinGitonga Aug 19, 2022
8c3143f
Merge branch 'oppia:develop' into fix-marquee-auto-restart-issue
KevinGitonga Aug 19, 2022
fae0685
Add MarqueeView to bazel list of custom views that import resources.
KevinGitonga Aug 22, 2022
4a463e5
Merge branch 'oppia:develop' into fix-marquee-auto-restart-issue
KevinGitonga Aug 22, 2022
091ff1a
Remove Marquee tests to fix some failures.
KevinGitonga Aug 22, 2022
c6a6871
Update exploration_activity.xml to fix failing tests.
KevinGitonga Aug 22, 2022
19847f2
Update exploration_activity.xml to fix failing tests.
KevinGitonga Aug 22, 2022
459f0e7
Fix failing tests.
KevinGitonga Aug 22, 2022
74413c2
Fix some of the failing tests.
KevinGitonga Aug 22, 2022
c0c0b28
Fix some of the failing tests.
KevinGitonga Aug 22, 2022
6f6c949
Fix some of the failing tests.
KevinGitonga Aug 22, 2022
f6feb0e
Fix some of failing test cases.
KevinGitonga Aug 24, 2022
d54b2d4
Update magic value textViewVirtualWidth to use the device width.
KevinGitonga Aug 24, 2022
0391003
Fix Buildifier issue with bazel.
KevinGitonga Aug 30, 2022
44a1eed
Update to use Library forked to oppia as advised.
KevinGitonga Sep 7, 2022
c79c66a
Fix custom res import issues.
KevinGitonga Sep 7, 2022
a307c20
Add binding adapters for "app:speed" and "app:pause".
KevinGitonga Sep 8, 2022
6106073
Revert to "app" from "marquee".
KevinGitonga Sep 8, 2022
4763e7c
Revert unnecessary file exemption.
KevinGitonga Sep 8, 2022
d246a06
Fix Nit.
KevinGitonga Sep 8, 2022
7444be8
Fix failing tests and revert from previous fix, which could not be us…
KevinGitonga Sep 12, 2022
6ce34d3
Merge branch 'oppia:develop' into fix-marquee-auto-restart-issue
KevinGitonga Sep 14, 2022
85d7dcd
Change to pass "app" and "speed" values in code.
KevinGitonga Sep 14, 2022
7fd4094
Fix import NIT.
KevinGitonga Sep 14, 2022
2c98b5e
Fix failing tests by updating Bazel config files to add Android-Marqu…
KevinGitonga Sep 15, 2022
e8b16c9
Fix buildifier issues after bazel file changes.
KevinGitonga Sep 15, 2022
59169e1
Revert tests for this feature and fix NITs.
KevinGitonga Sep 19, 2022
822606a
Migrate to Oppia's fork of AndroidMarquee-View remove ellipsize asser…
KevinGitonga Sep 20, 2022
727ad10
Change width to matchParent on exploration_activity.xml.
KevinGitonga Sep 20, 2022
a353e30
Merge branch 'develop' into fix-marquee-auto-restart-issue
KevinGitonga Sep 21, 2022
79e2e5b
Merge branch 'oppia:develop' into fix-marquee-auto-restart-issue
KevinGitonga Sep 22, 2022
7e4a505
Update speed and pause to animationSpeed and animationDelay respectiv…
KevinGitonga Sep 22, 2022
c89aadb
Change Bazel workspace config to point to Oppia's official fork.
KevinGitonga Sep 22, 2022
24782a3
Change to click on MarqueeView as it is parent to the ToolbarTitle on…
KevinGitonga Sep 23, 2022
d8fb232
Add indentations to layouts and shallow_since from CI logs.
KevinGitonga Sep 27, 2022
0aa662d
Revert shallow since.
KevinGitonga Sep 27, 2022
d3b5b6c
Update shallow since.
KevinGitonga Sep 27, 2022
58f10eb
Add class assertion tests.
KevinGitonga Sep 27, 2022
5f8afdd
Fix spacing NIT.
KevinGitonga Sep 27, 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,14 @@ class MarkChaptersCompletedFragmentPresenter @Inject constructor(
)
}
}
} else if (binding.isAllChecked == true) {
binding.isAllChecked = false
getMarkChaptersCompletedViewModel().getItemList().forEach { viewModel ->
if (viewModel is ChapterSummaryViewModel) {
if (!viewModel.checkIfChapterIsCompleted())
chapterUnselected(viewModel.chapterIndex, viewModel.nextStoryIndex)
}
}
}
}

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,18 @@ class MarkTopicsCompletedFragmentPresenter @Inject constructor(
}

binding.markTopicsCompletedAllCheckBoxContainer.setOnClickListener {
if (binding.isAllChecked == null || binding.isAllChecked == false)
binding.isAllChecked = true
binding.isAllChecked = !(binding.isAllChecked ?: false)
}

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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import org.oppia.android.app.story.storyitemviewmodel.StoryHeaderViewModel
import org.oppia.android.app.story.storyitemviewmodel.StoryItemViewModel
import org.oppia.android.app.topic.RouteToResumeLessonListener
import org.oppia.android.app.translation.AppLanguageResourceHandler
import org.oppia.android.app.utility.LifecycleSafeTimerFactory
import org.oppia.android.databinding.StoryChapterViewBinding
import org.oppia.android.databinding.StoryFragmentBinding
import org.oppia.android.databinding.StoryHeaderViewBinding
Expand All @@ -49,6 +50,7 @@ class StoryFragmentPresenter @Inject constructor(
private val explorationDataController: ExplorationDataController,
@DefaultResourceBucketName private val resourceBucketName: String,
@TopicHtmlParserEntityType private val entityType: String,
private val lifecycleSafeTimerFactory: LifecycleSafeTimerFactory,
private val resourceHandler: AppLanguageResourceHandler
) {
private val routeToExplorationListener = activity as RouteToExplorationListener
Expand Down Expand Up @@ -86,6 +88,12 @@ class StoryFragmentPresenter @Inject constructor(
binding.storyToolbarTitle.isSelected = true
}

lifecycleSafeTimerFactory.createTimer(25000).observe(fragment.viewLifecycleOwner) {
if (binding.storyToolbarTitle.isSelected) {
binding.storyToolbarTitle.isSelected = false
}
}

linearLayoutManager = LinearLayoutManager(activity.applicationContext)
linearSmoothScroller = createSmoothScroller()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.google.android.material.tabs.TabLayoutMediator
import org.oppia.android.R
import org.oppia.android.app.fragment.FragmentScope
import org.oppia.android.app.translation.AppLanguageResourceHandler
import org.oppia.android.app.utility.LifecycleSafeTimerFactory
import org.oppia.android.app.viewmodel.ViewModelProvider
import org.oppia.android.databinding.TopicFragmentBinding
import org.oppia.android.domain.oppialogger.OppiaLogger
Expand All @@ -24,6 +25,7 @@ class TopicFragmentPresenter @Inject constructor(
private val fragment: Fragment,
private val viewModelProvider: ViewModelProvider<TopicViewModel>,
private val oppiaLogger: OppiaLogger,
private val lifecycleSafeTimerFactory: LifecycleSafeTimerFactory,
@EnablePracticeTab private val enablePracticeTab: Boolean,
private val resourceHandler: AppLanguageResourceHandler
) {
Expand Down Expand Up @@ -61,6 +63,12 @@ class TopicFragmentPresenter @Inject constructor(
binding.topicToolbarTitle.isSelected = true
}

lifecycleSafeTimerFactory.createTimer(25000).observe(fragment.viewLifecycleOwner) {
if (binding.topicToolbarTitle.isSelected) {
binding.topicToolbarTitle.isSelected = false
}
}

val viewModel = getTopicViewModel()
viewModel.setInternalProfileId(internalProfileId)
viewModel.setTopicId(topicId)
Expand Down