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

[Fragment] Replace bind with setOutput function. #319

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

Laimiux
Copy link
Collaborator

@Laimiux Laimiux commented Dec 11, 2023

What

Simplifying FeatureView by replacing bind function with a setOutput one.

@Laimiux Laimiux force-pushed the laimonas/formula-fragment-set-output branch from 9a5d94d to 46f395d Compare December 11, 2023 22:53


abstract class ComposeViewFactory<RenderModel> : ViewFactory<RenderModel> {

override fun create(inflater: LayoutInflater, container: ViewGroup?): FeatureView<RenderModel> {
val view = ComposeView(inflater.context)
var firstRender = true
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved in to formula fragment

@carrotkite
Copy link

carrotkite commented Dec 11, 2023

JaCoCo Code Coverage 79.39% ✅

Class Covered Meta Status
com/instacart/formula/android/FeatureView 100% 0%
com/instacart/formula/android/FormulaFragment 75% 0%
com/instacart/formula/android/ViewInstance 100% 0%

Generated by 🚫 Danger

val lifecycleCallbacks: FragmentLifecycleCallback? = null,
) {
class State<RenderModel>(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this State class anymore

/**
* Binds [FeatureView.State] to a [render] function.
*/
internal class FeatureViewBindFunction<RenderModel>(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore

Copy link
Collaborator

@alexanderbezverhni alexanderbezverhni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@Laimiux Laimiux merged commit 85664df into master Dec 12, 2023
5 checks passed
@Laimiux Laimiux deleted the laimonas/formula-fragment-set-output branch December 12, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants