Skip to content

support inheritance across modules. Issue #808. - #1045

Open
stephanenicolas wants to merge 5 commits into
JakeWharton:masterfrom
stephanenicolas:sni/support-inheritance-in-modules
Open

support inheritance across modules. Issue #808.#1045
stephanenicolas wants to merge 5 commits into
JakeWharton:masterfrom
stephanenicolas:sni/support-inheritance-in-modules

Conversation

@stephanenicolas

@stephanenicolas stephanenicolas commented Aug 4, 2017

Copy link
Copy Markdown
Contributor

This PR:

  • fixes issue Generated ViewBinding doesn't extend from library module ViewBinding #808. The BK AP can use a super class that was already compiled in a different module. It checks for the view binder of such classes, and looks at some extra properties of the binder to ensure the subclasses are generated correctly (whether they need a context to bind views or not).
  • add a simple inheritance unit test. It uses a base class that is precompiled to simulate that the super class of a class under test could already have been compiled in a different module.
  • changes the sample (here, I am wondering how you guys do to change the sample before releasing..)

We would appreciate your feedback on this PR about both the idea of the solution and its implementation, tests, etc.

@stephanenicolas
stephanenicolas force-pushed the sni/support-inheritance-in-modules branch from 308ffdd to 664f760 Compare August 25, 2017 15:55
@stephanenicolas stephanenicolas changed the title support inheritance in modules support inheritance across modules Aug 26, 2017
@stephanenicolas stephanenicolas changed the title support inheritance across modules support inheritance across modules. Solves issue #808. Aug 26, 2017
@stephanenicolas stephanenicolas changed the title support inheritance across modules. Solves issue #808. support inheritance across modules. <br> Solves issue #808. Aug 26, 2017
@stephanenicolas stephanenicolas changed the title support inheritance across modules. <br> Solves issue #808. support inheritance across modules. Issue #808. Aug 26, 2017
@JakeWharton JakeWharton added this to the 9.0.0 milestone Oct 10, 2017
@tongngocdat

Copy link
Copy Markdown

shopquannamdangcap

} else {
BindingSet parentBinding = bindingMap.get(parentType);

// parent binding is null, let's try to find a previouly generated binding

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Typo in comment -> "previouly"

BindingSet.Builder parentBuilder = BindingSet.newBuilder(parentType);
if (hasViewBindings(parentType)) {
//add a fake field to the parent class so that it will indicate it has a view bindings.
//this is required for the subclass to generate a proper view binder

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

6 participants