-
Notifications
You must be signed in to change notification settings - Fork 727
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve transformation of java types to kotlin for extensions (#331)
- Loading branch information
Showing
4 changed files
with
220 additions
and
13 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...egrationtest/src/main/java/com/airbnb/epoxy/integrationtest/ModelGroupWithAnnotation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.airbnb.epoxy.integrationtest; | ||
|
||
import com.airbnb.epoxy.EpoxyAttribute; | ||
import com.airbnb.epoxy.EpoxyModel; | ||
import com.airbnb.epoxy.EpoxyModelClass; | ||
import com.airbnb.epoxy.EpoxyModelGroup; | ||
|
||
import java.util.List; | ||
|
||
@EpoxyModelClass | ||
public abstract class ModelGroupWithAnnotation extends EpoxyModelGroup { | ||
@EpoxyAttribute int backgroundColor; | ||
|
||
public ModelGroupWithAnnotation(List<? extends EpoxyModel<?>> models) { | ||
super(R.layout.model_with_click_listener, models); | ||
} | ||
|
||
@Override | ||
public void bind(Holder holder) { | ||
super.bind(holder); | ||
holder.getRootView().setBackgroundColor(backgroundColor); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
epoxy-integrationtest/src/test/java/com/airbnb/epoxy/ModelGroupIntegrationTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.airbnb.epoxy | ||
|
||
import com.airbnb.epoxy.integrationtest.* | ||
import org.junit.* | ||
import org.junit.runner.* | ||
import org.robolectric.* | ||
import org.robolectric.annotation.* | ||
|
||
@RunWith(RobolectricTestRunner::class) | ||
@Config(constants = BuildConfig::class, sdk = intArrayOf(21)) | ||
class ModelGroupIntegrationTest { | ||
|
||
@Test | ||
fun modelGroupSubclassIsGenerated() { | ||
// Just checking that the generated class exists and compiles | ||
ModelGroupWithAnnotation_(listOf(Model_())) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters