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 #2658, #299: Replace builder() with Factory in SingleTypeBuilder and MultiTypeBuilder #4412

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3162713
Replace builder() with Factory in SingleTypeBuilder and MultiTypeBuil…
KevinGitonga Jul 1, 2022
33dba86
Fix failing tests after refactor, Create Fragment for DragDropTestAct…
KevinGitonga Jul 5, 2022
0a1a5b3
Inject the BindableAdapter.kt factory into the fragment and listview …
KevinGitonga Jul 5, 2022
ee9f243
Inject the BindableAdapter.kt factory into the fragment and listview …
KevinGitonga Jul 5, 2022
955557c
Inject the BindableAdapter.kt factory into the fragment and listview …
KevinGitonga Jul 5, 2022
455f673
Inject the BindableAdapter.kt factory into the fragment and listview …
KevinGitonga Jul 5, 2022
8a5d74f
Add 'androidx.work:work-testing:2.4.0' in androidTestImplementation t…
KevinGitonga Jul 6, 2022
e75cf57
Fix lint formatting issue in updated files.
KevinGitonga Jul 6, 2022
6d72ea9
Fix some of the failing tests after fixing #2658.
KevinGitonga Jul 12, 2022
e92b113
Fix some of the failing tests after fixing #2658.
KevinGitonga Jul 13, 2022
9e1bec0
Fix more failing tests for #2658.
KevinGitonga Jul 13, 2022
e270424
Refactor StatePlayerRecyclerViewAssembler.kt to inject MultiTypeAdapt…
KevinGitonga Jul 14, 2022
459a9a5
Fix failing tests due to missed refactor of QuestionPlayerFragmentPre…
KevinGitonga Jul 14, 2022
f9105ac
Merge branch 'oppia:develop' into enable_dagger_graph_access_for_bind…
KevinGitonga Jul 15, 2022
20c1ff3
More updates as part of refactoring for issue #2658.
KevinGitonga Jul 18, 2022
dfed2cb
Refactor PromotedStoryListView.kt BindableAdapterTest.kt classes to p…
KevinGitonga Jul 19, 2022
6fb1198
Fix issues as advised by code review.
KevinGitonga Jul 21, 2022
8699b2b
Fix issue causing some of failing tests.
KevinGitonga Jul 21, 2022
912bdcd
Fix issue causing some of failing tests.
KevinGitonga Jul 22, 2022
816d626
Revert unused resources, to fix Static check test failure.
KevinGitonga Jul 25, 2022
2d4652a
Add KDocs to implemented public functions, to fix KDocs Static check …
KevinGitonga Jul 25, 2022
be4d3b9
Add exemption for test to DragDropTestFragmentPresenter and DragDropT…
KevinGitonga Jul 25, 2022
4ef20fa
Fix nits and updates as advised during code review.
KevinGitonga Jul 26, 2022
cea5a19
Fix nits and updates as advised during code review.
KevinGitonga Jul 27, 2022
89418ac
Fix nits and updates as advised during code review.
KevinGitonga Jul 27, 2022
7b5e7fe
Updates issues as advised on code review, fix some of the failing tests.
KevinGitonga Jul 28, 2022
d026b12
Fix failing tests.
KevinGitonga Aug 1, 2022
d4d1127
Merge branch 'oppia:develop' into enable_dagger_graph_access_for_bind…
KevinGitonga Aug 1, 2022
b784db5
Fix more failing tests by reverting DragDropSortInteractionView.kt an…
KevinGitonga Aug 1, 2022
86cdf12
Update multiple field namings for consistency as advised by code revi…
KevinGitonga Aug 1, 2022
6c9a6c4
Fix failing tests and revert from previous fix, which could not be us…
KevinGitonga Aug 11, 2022
6432c23
Fix out-of-order binding for selection, drop/drop.
BenHenning Sep 22, 2022
9f838d6
Merge branch 'develop' into update-pr-4412
BenHenning Sep 22, 2022
5a8d7cf
Post-merge fixes.
BenHenning Sep 22, 2022
28df931
Merge branch 'develop' into update-to-latest-develop
BenHenning Sep 22, 2022
af07301
Merge pull request #2 from BenHenning/update-to-latest-develop
KevinGitonga Sep 23, 2022
1e93378
Merge branch 'update-to-latest-develop' into update-pr-4412
BenHenning Sep 24, 2022
1b1f0a5
Merge branch 'enable_dagger_graph_access_for_bindable_adapter' of htt…
BenHenning Sep 24, 2022
a4d482d
Merge branch 'develop' into enable_dagger_graph_access_for_bindable_a…
KevinGitonga Sep 26, 2022
414bf8a
Merge pull request #1 from BenHenning/update-pr-4412
KevinGitonga Sep 26, 2022
8ff532b
Fix lint issues after resolving merge conflicts on CI and add lessons…
KevinGitonga Sep 26, 2022
69603ff
Revert deleted deltas.
KevinGitonga Sep 29, 2022
c8eb1d6
Remove lessons_chapter_view.xml since it is no longer required.
KevinGitonga Oct 3, 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 @@ -53,7 +53,6 @@ class DragDropSortInteractionView @JvmOverloads constructor(
@Inject
lateinit var viewBindingShim: ViewBindingShim

@Inject
lateinit var singleTypeBuilderFactory: BindableAdapter.SingleTypeBuilder.Factory

private lateinit var entityId: String
Expand All @@ -76,6 +75,7 @@ class DragDropSortInteractionView @JvmOverloads constructor(
// this more efficiently and cleanly than always relying on notifying of potential changes in the adapter when the
// type is set (plus the type ought to be permanent).
this.isMultipleItemsInSamePositionAllowed = isAllowed
singleTypeBuilderFactory = BindableAdapter.SingleTypeBuilder.Factory(Fragment())
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
adapter = createAdapter()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ class SelectionInteractionView @JvmOverloads constructor(
@Inject
lateinit var bindingInterface: ViewBindingShim

@Inject
lateinit var singleTypeBuilderFactory: BindableAdapter.SingleTypeBuilder.Factory

private lateinit var entityId: String
private lateinit var writtenTranslationContext: WrittenTranslationContext

override fun onAttachedToWindow() {
super.onAttachedToWindow()

val viewComponentFactory = FragmentManager.findFragment<Fragment>(this) as ViewComponentFactory
val viewComponent = viewComponentFactory.createViewComponent(this) as ViewComponentImpl
viewComponent.inject(this)
Expand All @@ -65,6 +63,7 @@ class SelectionInteractionView @JvmOverloads constructor(
// this more efficiently and cleanly than always relying on notifying of potential changes in the adapter when the
// type is set (plus the type ought to be permanent).
this.selectionItemInputType = selectionItemInputType
singleTypeBuilderFactory = BindableAdapter.SingleTypeBuilder.Factory(Fragment())
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
adapter = createAdapter()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,7 @@ class BindableAdapter<T : Any> internal constructor(
setViewModel(binding, transformViewModel(data))
// Attaching lifecycleOwner before view model initialization can sometimes cause a
// NullPointerException because data might not be attached to the views yet.
// Skip attaching Lifecycle when StateFragment is created as this is causing NPE, yet to find fix.
val currentFragment = getLifecycleOwner()?.javaClass?.simpleName.toString()
if (currentFragment != "QuestionPlayerFragment" && currentFragment != "StateFragment") {
binding.lifecycleOwner = getLifecycleOwner()
}
binding.lifecycleOwner = getLifecycleOwner()
}
}
}
Expand Down