; }
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/GroupModel.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | import androidx.annotation.LayoutRes
4 |
5 | /**
6 | * An [EpoxyModelGroup] usable in a DSL manner via the [group] extension.
7 | *
8 | * Example:
9 | * ```
10 | * group {
11 | * id("photos")
12 | * layout(R.layout.photo_grid)
13 | *
14 | * // add your models here, example:
15 | * for (photo in photos) {
16 | * imageView {
17 | * id(photo.id)
18 | * url(photo.url)
19 | * }
20 | * }
21 | * }
22 | * ```
23 | */
24 | @EpoxyModelClass
25 | abstract class GroupModel : EpoxyModelGroup, ModelCollector {
26 | constructor() : super()
27 | constructor(@LayoutRes layoutRes: Int) : super(layoutRes)
28 |
29 | override fun add(model: EpoxyModel<*>) {
30 | super.addModel(model)
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/HiddenEpoxyModel.java:
--------------------------------------------------------------------------------
1 |
2 | package com.airbnb.epoxy;
3 |
4 | import android.widget.Space;
5 |
6 | import com.airbnb.viewmodeladapter.R;
7 |
8 | /**
9 | * Used by the {@link EpoxyAdapter} as a placeholder for when {@link EpoxyModel#isShown()} is false.
10 | * Using a zero height and width {@link Space} view, as well as 0 span size, to exclude itself from
11 | * view.
12 | */
13 | class HiddenEpoxyModel extends EpoxyModel {
14 | @Override
15 | public int getDefaultLayout() {
16 | return R.layout.view_holder_empty_view;
17 | }
18 |
19 | @Override
20 | public int getSpanSize(int spanCount, int position, int itemCount) {
21 | return 0;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/IllegalEpoxyUsage.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class IllegalEpoxyUsage extends RuntimeException {
4 | public IllegalEpoxyUsage(String message) {
5 | super(message);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/InternalExposer.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | /**
4 | * Exposes package private things as internal so files in other packages can use them.
5 | */
6 |
7 | internal fun EpoxyViewHolder.objectToBindInternal() = objectToBind()
8 |
9 | internal fun EpoxyModel<*>.viewTypeInternal() = viewType
10 | internal fun BaseEpoxyAdapter.boundViewHoldersInternal() = boundViewHolders
11 | internal fun BaseEpoxyAdapter.getModelForPositionInternal(position: Int): EpoxyModel<*>? {
12 | return getModelForPosition(position)
13 | }
14 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/MainThreadExecutor.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import static com.airbnb.epoxy.EpoxyAsyncUtil.AYSNC_MAIN_THREAD_HANDLER;
4 | import static com.airbnb.epoxy.EpoxyAsyncUtil.MAIN_THREAD_HANDLER;
5 |
6 | class MainThreadExecutor extends HandlerExecutor {
7 | static final MainThreadExecutor INSTANCE = new MainThreadExecutor(false);
8 | static final MainThreadExecutor ASYNC_INSTANCE = new MainThreadExecutor(true);
9 |
10 | MainThreadExecutor(boolean async) {
11 | super(async ? AYSNC_MAIN_THREAD_HANDLER : MAIN_THREAD_HANDLER);
12 | }
13 | }
14 |
15 |
16 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/ModelCollector.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | /**
4 | * Interface used to collect models. Used by [EpoxyController]. It is also convenient to build DSL
5 | * helpers for carousel: @link https://github.com/airbnb/epoxy/issues/847.
6 | */
7 | @EpoxyBuildScope
8 | interface ModelCollector {
9 |
10 | fun add(model: EpoxyModel<*>)
11 | }
12 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/NoOpControllerHelper.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | /**
4 | * A {@link ControllerHelper} implementation for adapters with no {@link
5 | * com.airbnb.epoxy.AutoModel} usage.
6 | */
7 | class NoOpControllerHelper extends ControllerHelper {
8 |
9 | @Override
10 | public void resetAutoModels() {
11 | // No - Op
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/NoOpTimer.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | class NoOpTimer implements Timer {
4 | @Override
5 | public void start(String sectionName) {
6 |
7 | }
8 |
9 | @Override
10 | public void stop() {
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/OnModelBoundListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | /** Used to register an onBind callback with a generated model. */
4 | public interface OnModelBoundListener, V> {
5 | /**
6 | * This will be called immediately after a model was bound, with the model and view that were
7 | * bound together.
8 | *
9 | * @param model The model being bound
10 | * @param view The view that is being bound to the model
11 | * @param position The adapter position of the model
12 | */
13 | void onModelBound(T model, V view, int position);
14 | }
15 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/OnModelBuildFinishedListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import androidx.annotation.NonNull;
4 |
5 | /**
6 | * Used with {@link EpoxyController#addModelBuildListener(OnModelBuildFinishedListener)} to be
7 | * alerted to new model changes.
8 | */
9 | public interface OnModelBuildFinishedListener {
10 | /**
11 | * Called after {@link EpoxyController#buildModels()} has run and changes have been notified to
12 | * the adapter. This will be called even if no changes existed.
13 | */
14 | void onModelBuildFinished(@NonNull DiffResult result);
15 | }
16 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/OnModelClickListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.view.View;
4 |
5 | /** Used to register a click listener on a generated model. */
6 | public interface OnModelClickListener, V> {
7 | /**
8 | * Called when the view bound to the model is clicked.
9 | *
10 | * @param model The model that the view is bound to.
11 | * @param parentView The view bound to the model which received the click.
12 | * @param clickedView The view that received the click. This is either a child of the parentView
13 | * or the parentView itself
14 | * @param position The position of the model in the adapter.
15 | */
16 | void onClick(T model, V parentView, View clickedView, int position);
17 | }
18 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/OnModelLongClickListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.view.View;
4 |
5 | public interface OnModelLongClickListener, V> {
6 | /**
7 | * Called when the view bound to the model is clicked.
8 | *
9 | * @param model The model that the view is bound to.
10 | * @param parentView The view bound to the model which received the click.
11 | * @param clickedView The view that received the click. This is either a child of the parentView
12 | * or the parentView itself
13 | * @param position The position of the model in the adapter.
14 | */
15 | boolean onLongClick(T model, V parentView, View clickedView, int position);
16 | }
17 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/OnModelUnboundListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | /** Used to register an onUnbind callback with a generated model. */
4 | public interface OnModelUnboundListener, V> {
5 | /**
6 | * This will be called immediately after a model is unbound from a view, with the view and model
7 | * that were unbound.
8 | */
9 | void onModelUnbound(T model, V view);
10 | }
11 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/OnModelVisibilityStateChangedListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import com.airbnb.epoxy.VisibilityState.Visibility;
4 |
5 | /** Used to register an onVisibilityChanged callback with a generated model. */
6 | public interface OnModelVisibilityStateChangedListener, V> {
7 |
8 | /**
9 | * This will be called once the visibility changed.
10 | *
11 | * @param model The model being bound
12 | * @param view The view that is being bound to the model
13 | * @param visibilityState The new visibility
14 | *
15 | * @see VisibilityState
16 | */
17 | void onVisibilityStateChanged(T model, V view, @Visibility int visibilityState);
18 | }
19 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/StyleBuilderCallback.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | /**
4 | * Used for specifying dynamic styling for a view when creating a model. This is only used if the
5 | * view is set up to be styled with the Paris library.
6 | */
7 | public interface StyleBuilderCallback {
8 | void buildStyle(T builder);
9 | }
10 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/Timer.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | interface Timer {
4 | void start(String sectionName);
5 | void stop();
6 | }
7 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/preload/Preloadable.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.preload
2 |
3 | import android.view.View
4 |
5 | /**
6 | * Declares Views that should be preloaded. This can either be implemented by a custom view or by an [EpoxyHolder].
7 | *
8 | * The preloadable views can be recursive ie if [Preloadable.viewsToPreload] includes any views that are themselves Preloadable those nested
9 | * views will instead by used.
10 | */
11 | interface Preloadable {
12 | val viewsToPreload: List
13 | }
14 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/java/com/airbnb/epoxy/utils/utils.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.utils
2 |
3 | import android.content.Context
4 | import android.content.pm.ApplicationInfo
5 |
6 | @PublishedApi
7 | internal val Context.isDebuggable: Boolean
8 | get() = (applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE) != 0
9 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/res/layout/view_holder_empty_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/test/java/com/airbnb/epoxy/InsertedModel.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | class InsertedModel extends TestModel {
4 | static final InsertedModel INSTANCE = new InsertedModel();
5 |
6 | @Override
7 | public int getDefaultLayout() {
8 | return 0;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/epoxy-adapter/src/test/java/com/airbnb/epoxy/TestAdapter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | class TestAdapter extends EpoxyAdapter {
4 |
5 | TestAdapter() {
6 | enableDiffing();
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/epoxy-annotations/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-annotations/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java'
2 | apply plugin: 'org.jetbrains.kotlin.jvm'
3 | apply from: '../publishing.gradle'
4 |
5 | sourceCompatibility = rootProject.JAVA_SOURCE_VERSION
6 | targetCompatibility = rootProject.JAVA_TARGET_VERSION
7 |
8 | compileKotlin {
9 | kotlinOptions {
10 | jvmTarget = "1.8"
11 | }
12 | }
13 |
14 | dependencies {
15 | implementation rootProject.deps.androidAnnotations
16 | // Allow us to use android support library annotations (@LayoutRes) in this project.
17 | // Since this isn't an android module normally we couldn't access them otherwise.
18 | compileOnly rootProject.deps.androidRuntime
19 | }
20 |
--------------------------------------------------------------------------------
/epoxy-annotations/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=Epoxy annotations
2 | POM_ARTIFACT_ID=epoxy-annotations
3 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/epoxy-annotations/src/main/java/com/airbnb/epoxy/AutoModel.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * Used to annotate model fields in an EpoxyController. Model fields annotated with this should not
10 | * be assigned a value directly; a model will automatically be created for them. A stable ID will
11 | * also be generated and assigned to the model. This ID will be the same across all instances of the
12 | * adapter, so it can be used for saving state of a model.
13 | */
14 | @Target(ElementType.FIELD)
15 | @Retention(RetentionPolicy.CLASS)
16 | public @interface AutoModel {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/epoxy-annotations/src/main/java/com/airbnb/epoxy/EpoxyBuildScope.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | /**
4 | * Used to mark Epoxy model building DSLs so that when using generated kotlin extension functions
5 | * for building models you cannot incorrectly nest models and also don't see cluttered, incorrect
6 | * code completion suggestions.
7 | */
8 | @DslMarker
9 | annotation class EpoxyBuildScope
10 |
--------------------------------------------------------------------------------
/epoxy-annotations/src/main/java/com/airbnb/epoxy/OnViewRecycled.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * This can be used to annotate methods inside classes with a {@link com.airbnb.epoxy.ModelView}
10 | * annotation. Methods with this annotation will be called when the view is recycled by the
11 | * RecyclerView.
12 | */
13 | @Target(ElementType.METHOD)
14 | @Retention(RetentionPolicy.CLASS)
15 | public @interface OnViewRecycled {
16 | }
17 |
--------------------------------------------------------------------------------
/epoxy-annotations/src/main/java/com/airbnb/epoxy/TextProp.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | import androidx.annotation.StringRes;
9 |
10 | /**
11 | * A convenient replacement for {@link ModelProp} when the prop represents text.
12 | *
13 | * This can only be used when the setter parameter is a {@link CharSequence}
14 | *
15 | * This is the same as using {@link ModelProp} with the option {@link
16 | * com.airbnb.epoxy.ModelProp.Option#GenerateStringOverloads}
17 | */
18 | @Target({ElementType.METHOD, ElementType.FIELD})
19 | @Retention(RetentionPolicy.CLASS)
20 | public @interface TextProp {
21 |
22 | @StringRes int defaultRes() default 0;
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-compose/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/epoxy-compose/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-compose/consumer-rules.pro
--------------------------------------------------------------------------------
/epoxy-compose/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=Epoxy Compose Interop
2 | POM_ARTIFACT_ID=epoxy-compose
3 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/epoxy-compose/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/epoxy-compose/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/java/com/airbnb/epoxy/composeinterop/maverickssample/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.composeinterop.maverickssample
2 |
3 | import android.os.Bundle
4 | import androidx.appcompat.app.AppCompatActivity
5 |
6 | class MainActivity : AppCompatActivity() {
7 | override fun onCreate(savedInstanceState: Bundle?) {
8 | super.onCreate(savedInstanceState)
9 | setContentView(R.layout.activity_main)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/java/com/airbnb/epoxy/composeinterop/maverickssample/SampleApplication.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.composeinterop.maverickssample
2 |
3 | import android.app.Application
4 | import com.airbnb.mvrx.Mavericks
5 |
6 | class SampleApplication : Application() {
7 | override fun onCreate() {
8 | super.onCreate()
9 | Mavericks.initialize(this)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/drawable/header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composeinterop-maverickssample/src/main/res/drawable/header.png
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/layout/fragment_multi_key_compose_interop.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/layout/fragment_my.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composeinterop-maverickssample/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composeinterop-maverickssample/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composeinterop-maverickssample/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composeinterop-maverickssample/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composeinterop-maverickssample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/epoxy-composeinterop-maverickssample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MavericksExample
3 |
4 |
--------------------------------------------------------------------------------
/epoxy-composesample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/epoxy-composesample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/java/com/airbnb/epoxy/compose/sample/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.compose.sample
2 |
3 | import android.content.Intent
4 | import android.os.Bundle
5 | import android.view.View
6 | import androidx.appcompat.app.AppCompatActivity
7 |
8 | class MainActivity : AppCompatActivity() {
9 | override fun onCreate(savedInstanceState: Bundle?) {
10 | super.onCreate(savedInstanceState)
11 |
12 | setContentView(R.layout.activity_main)
13 |
14 | findViewById(R.id.button).setOnClickListener {
15 | startActivity(Intent(this, ComposableInteropActivity::class.java))
16 | }
17 |
18 | findViewById(R.id.button2).setOnClickListener {
19 | startActivity(Intent(this, EpoxyInteropActivity::class.java))
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/java/com/airbnb/epoxy/compose/sample/ui/theme/Color.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.compose.sample.ui.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | val Purple200 = Color(0xFFBB86FC)
6 | val Purple500 = Color(0xFF6200EE)
7 | val Purple700 = Color(0xFF3700B3)
8 | val Teal200 = Color(0xFF03DAC5)
9 |
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/java/com/airbnb/epoxy/compose/sample/ui/theme/Shape.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.compose.sample.ui.theme
2 |
3 | import androidx.compose.foundation.shape.RoundedCornerShape
4 | import androidx.compose.material.Shapes
5 | import androidx.compose.ui.unit.dp
6 |
7 | val Shapes = Shapes(
8 | small = RoundedCornerShape(4.dp),
9 | medium = RoundedCornerShape(4.dp),
10 | large = RoundedCornerShape(0.dp)
11 | )
12 |
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/drawable/header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composesample/src/main/res/drawable/header.png
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/layout/activity_composable_interop.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/layout/activity_epoxy_interop.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composesample/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composesample/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composesample/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composesample/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composesample/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composesample/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composesample/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composesample/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composesample/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-composesample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/epoxy-composesample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Epoxy Compose Sample
3 |
--------------------------------------------------------------------------------
/epoxy-databinding/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-databinding/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=Epoxy Data Binding Support
2 | POM_ARTIFACT_ID=epoxy-databinding
3 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/epoxy-databinding/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/epoxy-glide-preloader/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-glide-preloader/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=Epoxy Glide Preloading
2 | POM_ARTIFACT_ID=epoxy-glide-preloading
3 | POM_PACKAGING=jar
4 |
--------------------------------------------------------------------------------
/epoxy-glide-preloader/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/eli_hart/tools/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/AdapterWithFieldAssigned.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest;
2 |
3 | import com.airbnb.epoxy.AutoModel;
4 | import com.airbnb.epoxy.EpoxyController;
5 |
6 | public class AdapterWithFieldAssigned extends EpoxyController {
7 |
8 | @AutoModel Model_ model1 = new Model_();
9 |
10 | @Override
11 | protected void buildModels() {
12 | add(model1);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/AdapterWithIdChanged.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest;
2 |
3 | import com.airbnb.epoxy.AutoModel;
4 | import com.airbnb.epoxy.EpoxyController;
5 |
6 | public class AdapterWithIdChanged extends EpoxyController {
7 |
8 | @AutoModel Model_ model1 = new Model_();
9 |
10 | @Override
11 | protected void buildModels() {
12 | add(model1.id(23));
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/BasicAutoModelsAdapter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest;
2 |
3 | import com.airbnb.epoxy.AutoModel;
4 | import com.airbnb.epoxy.EpoxyController;
5 |
6 | public class BasicAutoModelsAdapter extends EpoxyController {
7 |
8 | @AutoModel Model_ model1;
9 | @AutoModel Model_ model2;
10 |
11 | @Override
12 | protected void buildModels() {
13 | add(model1.id(1));
14 | add(model2.id(2));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/ControllerWithAutoModel.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest;
2 |
3 | import com.airbnb.epoxy.AutoModel;
4 | import com.airbnb.epoxy.EpoxyController;
5 |
6 | public class ControllerWithAutoModel extends EpoxyController {
7 |
8 | @AutoModel Model_ model;
9 |
10 | @Override
11 | protected void buildModels() {
12 | add(model);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/ControllerWithoutImplicityAdding.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest;
2 |
3 | import com.airbnb.epoxy.AutoModel;
4 | import com.airbnb.epoxy.EpoxyController;
5 |
6 | public class ControllerWithoutImplicityAdding extends EpoxyController {
7 | @AutoModel Model_ model1;
8 |
9 | @Override
10 | protected void buildModels() {
11 | model1.value(3);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/EpoxyDataBindingConfig.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest;
2 |
3 | import com.airbnb.epoxy.EpoxyDataBindingLayouts;
4 | import com.airbnb.epoxy.EpoxyDataBindingPattern;
5 |
6 | @EpoxyDataBindingPattern(rClass = R.class, layoutPrefix = "view_holder")
7 | @EpoxyDataBindingLayouts({R.layout.model_with_data_binding})
8 | interface EpoxyDataBindingConfig {}
9 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/Model.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest;
2 |
3 | import android.widget.TextView;
4 |
5 | import com.airbnb.epoxy.EpoxyAttribute;
6 | import com.airbnb.epoxy.EpoxyModel;
7 | import com.airbnb.epoxy.EpoxyModelClass;
8 |
9 | import androidx.annotation.NonNull;
10 |
11 | @EpoxyModelClass
12 | public abstract class Model extends EpoxyModel {
13 | @EpoxyAttribute public int value;
14 |
15 | @Override
16 | protected int getDefaultLayout() {
17 | return R.layout.model_with_click_listener;
18 | }
19 |
20 | @Override
21 | public void bind(@NonNull TextView view) {
22 | view.setText(String.valueOf(value));
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/ModelChangesDuringBind.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest;
2 |
3 | import android.view.View;
4 |
5 | import com.airbnb.epoxy.EpoxyAttribute;
6 | import com.airbnb.epoxy.EpoxyModel;
7 |
8 | import androidx.annotation.NonNull;
9 |
10 | public class ModelChangesDuringBind extends EpoxyModel {
11 | @EpoxyAttribute public int value;
12 |
13 | @Override
14 | protected int getDefaultLayout() {
15 | return R.layout.model_with_click_listener;
16 | }
17 |
18 | @Override
19 | public void bind(@NonNull View view) {
20 | super.bind(view);
21 | value = 3;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/ModelWithClickListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest;
2 |
3 | import android.view.View;
4 |
5 | import com.airbnb.epoxy.EpoxyAttribute;
6 | import com.airbnb.epoxy.EpoxyModel;
7 |
8 | import androidx.annotation.NonNull;
9 |
10 | public class ModelWithClickListener extends EpoxyModel {
11 |
12 | @EpoxyAttribute public View.OnClickListener clickListener;
13 |
14 | @Override
15 | protected int getDefaultLayout() {
16 | return R.layout.model_with_click_listener;
17 | }
18 |
19 | @Override
20 | public void bind(@NonNull View view) {
21 | view.setOnClickListener(clickListener);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/ModelWithLongClickListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest;
2 |
3 | import android.view.View;
4 |
5 | import com.airbnb.epoxy.EpoxyAttribute;
6 | import com.airbnb.epoxy.EpoxyModel;
7 |
8 | import androidx.annotation.NonNull;
9 |
10 | public class ModelWithLongClickListener extends EpoxyModel {
11 |
12 | @EpoxyAttribute View.OnLongClickListener clickListener;
13 |
14 | @Override
15 | protected int getDefaultLayout() {
16 | return R.layout.model_with_click_listener;
17 | }
18 |
19 | @Override
20 | public void bind(@NonNull View view) {
21 | view.setOnLongClickListener(clickListener);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/ModelWithNoGeneratedClass.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest;
2 |
3 | import android.view.View;
4 |
5 | import com.airbnb.epoxy.EpoxyAttribute;
6 | import com.airbnb.epoxy.EpoxyModel;
7 |
8 | // This class isn't used, but tests that a model is not generated for this and the processor and
9 | // generated code handles this and compiles correctly. A kotlin extension function should not be
10 | // generated
11 | public abstract class ModelWithNoGeneratedClass extends EpoxyModel {
12 | @EpoxyAttribute int value;
13 | }
14 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/TestActivity.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest
2 |
3 | import androidx.appcompat.app.AppCompatActivity
4 |
5 | /**
6 | * Empty activity used for view testing.
7 | */
8 | class TestActivity : AppCompatActivity()
9 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/ViewWithDelegate.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest
2 |
3 | import android.content.Context
4 | import android.view.View
5 | import com.airbnb.epoxy.ModelProp
6 | import com.airbnb.epoxy.ModelView
7 |
8 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_MATCH_HEIGHT)
9 | class ViewWithDelegate @JvmOverloads constructor(
10 | context: Context,
11 | implementation: InterfaceImplementation = InterfaceImplementation()
12 | ) : View(context), InterfaceWithModelProp by implementation
13 |
14 | interface InterfaceWithModelProp {
15 |
16 | @set:ModelProp
17 | var flag: Boolean
18 | }
19 |
20 | class InterfaceImplementation : InterfaceWithModelProp {
21 |
22 | override var flag: Boolean = false
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/java/com/airbnb/epoxy/integrationtest/autoaddautomodels/PackageConfig.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.integrationtest.autoaddautomodels;
2 |
3 | import com.airbnb.epoxy.PackageEpoxyConfig;
4 |
5 | @PackageEpoxyConfig(implicitlyAddAutoModels = true)
6 | public interface PackageConfig {
7 | }
8 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/res/layout/model_with_checked_change.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/res/layout/model_with_click_listener.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/res/layout/model_with_data_binding.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
13 |
14 |
15 |
20 |
21 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/res/layout/vertical_linear_group.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/res/layout/view_holder_databinding_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
13 |
14 |
15 |
20 |
21 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/res/layout/view_holder_nested_databinding_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/res/layout/view_holder_no_databinding.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/res/layout/view_with_annotations_for_integration_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/res/values/plurals.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @string/plural_test_string_one
5 |
6 |
7 | - @string/plural_test_string_with_args_one
8 |
9 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Epoxy Integration test
3 | String with args
4 | String with args %d
5 | plural test string one
6 | plural test string with args %d
7 |
8 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/test/java/com/airbnb/epoxy/DiffPayloadTestUtil.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Arrays;
5 | import java.util.List;
6 |
7 | class DiffPayloadTestUtil {
8 |
9 | static DiffPayload diffPayloadWithModels(EpoxyModel>... models) {
10 | List> epoxyModels = Arrays.asList(models);
11 | return new DiffPayload(epoxyModels);
12 | }
13 |
14 | static List payloadsWithDiffPayloads(DiffPayload... diffPayloads) {
15 | List payloads = Arrays.asList(diffPayloads);
16 | return new ArrayList(payloads);
17 | }
18 |
19 | static List payloadsWithChangedModels(EpoxyModel>... models) {
20 | return payloadsWithDiffPayloads(diffPayloadWithModels(models));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/test/java/com/airbnb/epoxy/ModelGroupIntegrationTest.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | import com.airbnb.epoxy.integrationtest.ModelGroupWithAnnotation_
4 | import com.airbnb.epoxy.integrationtest.Model_
5 | import org.junit.Test
6 | import org.junit.runner.RunWith
7 | import org.robolectric.RobolectricTestRunner
8 | import org.robolectric.annotation.Config
9 |
10 | @RunWith(RobolectricTestRunner::class)
11 | @Config(sdk = [21])
12 | class ModelGroupIntegrationTest {
13 |
14 | @Test
15 | fun modelGroupSubclassIsGenerated() {
16 | // Just checking that the generated class exists and compiles
17 | ModelGroupWithAnnotation_(listOf(Model_()))
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/epoxy-integrationtest/src/test/java/com/airbnb/epoxy/ModelViewDelegateTest.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | import com.airbnb.epoxy.integrationtest.ViewWithDelegateModel_
4 | import org.junit.Test
5 | import org.junit.runner.RunWith
6 | import org.robolectric.RobolectricTestRunner
7 | import org.robolectric.annotation.Config
8 |
9 | @RunWith(RobolectricTestRunner::class)
10 | @Config(sdk = [21])
11 | class ModelViewDelegateTest {
12 |
13 | @Test
14 | fun propMethodIsOnModel() {
15 | val model = ViewWithDelegateModel_()
16 | model.flag(true)
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/epoxy-kspsample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/epoxy-kspsample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/epoxy-kspsample/src/main/java/com/airbnb/epoxy/ksp/sample/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.ksp.sample
2 |
3 | import android.os.Bundle
4 | import androidx.appcompat.app.AppCompatActivity
5 | import com.airbnb.epoxy.EpoxyRecyclerView
6 | import com.airbnb.epoxy.ksp.sample.epoxyviews.headerView
7 |
8 | class MainActivity : AppCompatActivity() {
9 | override fun onCreate(savedInstanceState: Bundle?) {
10 | super.onCreate(savedInstanceState)
11 | setContentView(R.layout.activity_main)
12 |
13 | findViewById(R.id.epoxy_recycler_view).withModels {
14 | headerView {
15 | id("header")
16 | title("Hello World")
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/epoxy-kspsample/src/main/java/com/airbnb/epoxy/ksp/sample/epoxyviews/EpoxyConfig.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.ksp.sample.epoxyviews
2 |
3 | import com.airbnb.epoxy.ksp.sample.R
4 | import com.airbnb.paris.annotations.ParisConfig
5 |
6 | @ParisConfig(rClass = R::class)
7 | object EpoxyConfig
8 |
--------------------------------------------------------------------------------
/epoxy-kspsample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/epoxy-kspsample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Epoxy KSP Sample
3 |
--------------------------------------------------------------------------------
/epoxy-modelfactory/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-modelfactory/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply from: '../publishing.gradle'
3 |
4 | android {
5 |
6 | defaultConfig {
7 | // Using 16 here as it is the minimum version of Paris, which we are restricted to.
8 | minSdkVersion 16
9 | compileSdk rootProject.COMPILE_SDK_VERSION
10 | targetSdkVersion rootProject.TARGET_SDK_VERSION
11 | }
12 |
13 | compileOptions {
14 | sourceCompatibility JavaVersion.VERSION_1_8
15 | targetCompatibility JavaVersion.VERSION_1_8
16 | }
17 | }
18 |
19 | dependencies {
20 | implementation project(':epoxy-adapter')
21 | implementation rootProject.deps.paris
22 | implementation rootProject.deps.androidRecyclerView
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/epoxy-modelfactory/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=Epoxy Model Factory
2 | POM_ARTIFACT_ID=epoxy-modelfactory
3 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/epoxy-modelfactory/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Epoxy Model Factory Test
3 |
4 |
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/java/com/airbnb/epoxy/ParisConfig.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | import com.airbnb.epoxy.modelfactorytest.R
4 | import com.airbnb.paris.annotations.ParisConfig
5 |
6 | @ParisConfig(rClass = R::class)
7 | object ParisConfig
8 |
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/resources/BasicModelWithFinalAttribute.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class BasicModelWithFinalAttribute extends EpoxyModel {
4 | @EpoxyAttribute final int value;
5 |
6 | public BasicModelWithFinalAttribute() {
7 | value = 0;
8 | }
9 |
10 | @Override
11 | protected int getDefaultLayout() {
12 | return 0;
13 | }
14 | }
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/resources/CallbackPropModelView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.widget.FrameLayout;
5 | import androidx.annotation.Nullable;
6 |
7 | @ModelView(defaultLayout = 1)
8 | public class CallbackPropModelView extends FrameLayout {
9 |
10 | public CallbackPropModelView(Context context) {
11 | super(context);
12 | }
13 |
14 | @CallbackProp
15 | public void setOnClickListener(@Nullable OnClickListener listener) {
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/resources/GroupPropMultipleSupportedAttributeDifferentNameModelView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.widget.FrameLayout;
5 |
6 | import com.airbnb.epoxy.ModelProp.Option;
7 |
8 | @ModelView(defaultLayout = 1)
9 | public class GroupPropMultipleSupportedAttributeDifferentNameModelView extends FrameLayout {
10 |
11 | public GroupPropMultipleSupportedAttributeDifferentNameModelView(Context context) {
12 | super(context);
13 | }
14 |
15 | @ModelProp(group = "title")
16 | public void setTitleString(String title) {
17 |
18 | }
19 |
20 | @ModelProp(group = "title")
21 | public void setTitleInt(int title) {
22 |
23 | }
24 | }
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/resources/GroupPropMultipleSupportedAttributeSameNameModelView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.widget.FrameLayout;
5 |
6 | import com.airbnb.epoxy.ModelProp.Option;
7 |
8 | @ModelView(defaultLayout = 1)
9 | public class GroupPropMultipleSupportedAttributeSameNameModelView extends FrameLayout {
10 |
11 | public GroupPropMultipleSupportedAttributeSameNameModelView(Context context) {
12 | super(context);
13 | }
14 |
15 | @ModelProp(group = "title")
16 | public void setTitleString(String title) {
17 |
18 | }
19 |
20 | @ModelProp(group = "title")
21 | public void setTitleInt(int title) {
22 |
23 | }
24 | }
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/resources/GroupPropSingleSupportedAttributeModelView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.widget.FrameLayout;
5 |
6 | import com.airbnb.epoxy.ModelProp.Option;
7 |
8 | @ModelView(defaultLayout = 1)
9 | public class GroupPropSingleSupportedAttributeModelView extends FrameLayout {
10 |
11 | public GroupPropSingleSupportedAttributeModelView(Context context) {
12 | super(context);
13 | }
14 |
15 | @ModelProp
16 | public void setTitle(String title) {
17 |
18 | }
19 |
20 | @ModelProp({ Option.IgnoreRequireHashCode })
21 | public void setTitle(Object title) {
22 |
23 | }
24 | }
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/resources/ListSubtypeModelView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.widget.FrameLayout;
5 | import androidx.annotation.Nullable;
6 | import java.util.ArrayList;
7 |
8 | @ModelView(defaultLayout = 1)
9 | public class ListSubtypeModelView extends FrameLayout {
10 |
11 | public ListSubtypeModelView(Context context) {
12 | super(context);
13 | }
14 |
15 | @ModelProp
16 | public void setStringArrayList(ArrayList value) {
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/resources/ModelFactoryBaseModelView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.widget.FrameLayout;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class ModelFactoryBaseModelView extends FrameLayout {
8 |
9 | public ModelFactoryBaseModelView(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(String title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/resources/ModelFactoryBasicModelWithAttribute.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelFactoryBasicModelWithAttribute extends EpoxyModel {
4 | @EpoxyAttribute int value;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 | }
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/resources/StyleableModelView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.widget.FrameLayout;
5 |
6 | import com.airbnb.paris.annotations.Styleable;
7 |
8 | @Styleable
9 | @ModelView
10 | public class StyleableModelView extends FrameLayout {
11 |
12 | public StyleableModelView(Context context) {
13 | super(context);
14 | }
15 |
16 | @ModelProp
17 | public void setTitle(String title) {
18 |
19 | }
20 | }
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/resources/TextPropModelView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.widget.FrameLayout;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class TextPropModelView extends FrameLayout {
8 |
9 | public TextPropModelView(Context context) {
10 | super(context);
11 | }
12 |
13 | @TextProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-modelfactorytest/src/test/resources/test.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/epoxy-paging3/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-paging3/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=Epoxy Paging3 Support
2 | POM_ARTIFACT_ID=epoxy-paging3
3 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/epoxy-paging3/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/epoxy-paging3/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/epoxy-paging3/src/test/java/com/airbnb/epoxy/paging3/DummyItem.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.paging3
2 |
3 | import androidx.recyclerview.widget.DiffUtil
4 |
5 | /**
6 | * Dummy item for testing.
7 | */
8 | data class DummyItem(val id: Int, val value: String) {
9 | companion object {
10 | val DIFF_CALLBACK = object : DiffUtil.ItemCallback() {
11 | override fun areItemsTheSame(oldItem: DummyItem, newItem: DummyItem) = oldItem.id == newItem.id
12 |
13 | override fun areContentsTheSame(oldItem: DummyItem, newItem: DummyItem) = oldItem == newItem
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/epoxy-preloadersample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-preloadersample/gradle.properties:
--------------------------------------------------------------------------------
1 | # Remove once glide is updated to androidx
2 | android.enableJetifier=true
--------------------------------------------------------------------------------
/epoxy-preloadersample/src/main/java/com/airbnb/epoxy/preloadersample/ImagesController.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.preloadersample
2 |
3 | import com.airbnb.epoxy.TypedEpoxyController
4 |
5 | class ImagesController(private val isPreloading: Boolean) : TypedEpoxyController>() {
6 |
7 | override fun buildModels(data: Array) {
8 |
9 | data.forEachIndexed { index, url ->
10 |
11 | image {
12 | id("image_id_$url")
13 | imageUrl(url)
14 | text("Image Number: $index")
15 | preloading(this@ImagesController.isPreloading)
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/epoxy-preloadersample/src/main/res/layout/list_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/epoxy-preloadersample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/epoxy-preloadersample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | epoxy-preloadersample
3 |
4 | With Preload
5 | Without Preload
6 |
7 |
--------------------------------------------------------------------------------
/epoxy-preloadersample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/epoxy-processor/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-processor/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=Epoxy annotation processor
2 | POM_ARTIFACT_ID=epoxy-processor
3 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/epoxy-processor/src/main/java/com/airbnb/epoxy/processor/ControllerModelField.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.processor
2 |
3 | import com.squareup.javapoet.TypeName
4 |
5 | data class ControllerModelField(
6 | val fieldName: String,
7 | var typeName: TypeName,
8 | val packagePrivate: Boolean
9 | )
10 |
--------------------------------------------------------------------------------
/epoxy-processor/src/main/java/com/airbnb/epoxy/processor/EpoxyProcessorException.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.processor
2 |
3 | import androidx.room.compiler.processing.XElement
4 |
5 | internal class EpoxyProcessorException(
6 | message: String,
7 | cause: Throwable? = null,
8 | val element: XElement? = null
9 | ) : RuntimeException(message, cause)
10 |
--------------------------------------------------------------------------------
/epoxy-processor/src/main/java/com/airbnb/epoxy/processor/Extensions.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.processor
2 |
3 | internal fun String.lowerCaseFirstLetter(): String {
4 | if (isEmpty()) {
5 | return this
6 | }
7 |
8 | return Character.toLowerCase(get(0)) + substring(1)
9 | }
10 |
--------------------------------------------------------------------------------
/epoxy-processor/src/main/java/com/airbnb/epoxy/processor/GroupedAttribute.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.processor
2 |
3 | class GroupedAttribute(
4 | val attributeInfo: AttributeInfo,
5 | val group: GeneratedModelInfo.AttributeGroup
6 | )
7 |
--------------------------------------------------------------------------------
/epoxy-processor/src/main/java/com/airbnb/epoxy/processor/KClassNames.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.processor
2 |
3 | import com.squareup.kotlinpoet.ClassName
4 | import com.squareup.kotlinpoet.asClassName
5 |
6 | object KClassNames {
7 |
8 | // Annotations
9 | val DEPRECATED = Deprecated::class.asClassName()
10 | val KOTLIN_UNIT = ClassName.bestGuess("kotlin.Unit")
11 | }
12 |
--------------------------------------------------------------------------------
/epoxy-processor/src/main/java/com/airbnb/epoxy/processor/MultiParamAttribute.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.processor
2 |
3 | import com.squareup.javapoet.CodeBlock
4 | import com.squareup.javapoet.ParameterSpec
5 |
6 | /**
7 | * Allows an attribute to have multiple parameters in the model setter method. Those params are then
8 | * combined into a single object to be set on the attribute.
9 | *
10 | *
11 | * This is useful for things like
12 | * combining a StringRes and format arguments into a single string.
13 | */
14 | interface MultiParamAttribute {
15 | val params: List
16 | /**
17 | * This code should combine the params into a single object which can then be set on the
18 | * attribute.
19 | */
20 | val valueToSetOnAttribute: CodeBlock
21 |
22 | fun varargs(): Boolean
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider:
--------------------------------------------------------------------------------
1 | com.airbnb.epoxy.processor.EpoxyProcessorProvider
2 | com.airbnb.epoxy.processor.ControllerProcessorProvider
3 | com.airbnb.epoxy.processor.DataBindingProcessorProvider
4 | com.airbnb.epoxy.processor.ModelViewProcessorProvider
--------------------------------------------------------------------------------
/epoxy-processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor:
--------------------------------------------------------------------------------
1 | com.airbnb.epoxy.processor.EpoxyProcessor
2 | com.airbnb.epoxy.processor.ControllerProcessor
3 | com.airbnb.epoxy.processor.DataBindingProcessor
4 | com.airbnb.epoxy.processor.ModelViewProcessor
--------------------------------------------------------------------------------
/epoxy-processortest/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/main/java/com/airbnb/integrationtest/processortest/ProcessorTestModel.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.integrationtest.processortest;
2 |
3 | import android.view.View;
4 |
5 | import com.airbnb.epoxy.EpoxyAttribute;
6 | import com.airbnb.epoxy.processortest2.ProcessorTest2Model;
7 |
8 | public class ProcessorTestModel extends ProcessorTest2Model {
9 | @EpoxyAttribute public int publicValue;
10 | @EpoxyAttribute protected int protectedValue;
11 | @EpoxyAttribute int packagePrivateValue;
12 |
13 | @Override
14 | protected int getDefaultLayout() {
15 | return 0;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/main/java/com/airbnb/integrationtest/processortest/differentpackage/Model.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.integrationtest.processortest.differentpackage;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.integrationtest.processortest.ProcessorTestModel;
5 |
6 | public class Model extends ProcessorTestModel {
7 | @EpoxyAttribute int subclassValue;
8 | }
9 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/main/res/layout/model_with_data_binding_without_donothash.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
13 |
14 |
15 |
21 |
22 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Processor Test
3 |
4 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/java/com/airbnb/epoxy/GuavaPatch.kt:
--------------------------------------------------------------------------------
1 | @file:JvmName("GuavaPatch")
2 | package com.airbnb.epoxy
3 |
4 | import java.io.File
5 | import java.net.URL
6 |
7 | /**
8 | * Since AGP 3.6.0, the class-loader behavior has been modified.
9 | * Unfortunately Guava (via compile-testing) uses a class-loader based mechanism
10 | * which is valid on JVM but not supposed to be supported on Android.
11 | * As the project paths are simple enough, we can hardcode them for now.
12 | */
13 | fun String.patchResource(): URL =
14 | File("build/intermediates/sourceFolderJavaResources/debug/$this").toURI().toURL()
15 |
16 | fun File.unpatchResource(): File = File(
17 | canonicalPath.replace(
18 | "build/intermediates/sourceFolderJavaResources/debug/",
19 | "src/test/resources/"
20 | )
21 | )
22 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/AbstractEpoxyModelWithView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.view.View;
4 | import android.view.ViewGroup;
5 |
6 | import com.airbnb.epoxy.EpoxyModelClass;
7 | import com.airbnb.epoxy.EpoxyModelWithView;
8 |
9 | import androidx.annotation.NonNull;
10 |
11 | @EpoxyModelClass
12 | public abstract class AbstractEpoxyModelWithView extends EpoxyModelWithView {
13 | @Override
14 | public View buildView(@NonNull ViewGroup parent) {
15 | return new View(parent.getContext());
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/AbstractModelWithHolder.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.view.View;
4 | import androidx.annotation.NonNull;
5 |
6 | @EpoxyModelClass
7 | public abstract class AbstractModelWithHolder
8 | extends EpoxyModelWithHolder {
9 | @EpoxyAttribute int value;
10 |
11 | @Override
12 | protected int getDefaultLayout() {
13 | return 0;
14 | }
15 |
16 | static class Holder extends EpoxyHolder {
17 |
18 | protected void bindView(@NonNull View itemView) {
19 |
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/AutoLayoutModelView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
7 | public class AutoLayoutModelView extends View {
8 |
9 | public AutoLayoutModelView(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | void setValue(int value) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/AutoLayoutModelViewManualLayoutParams.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.view.ViewGroup.LayoutParams;
6 |
7 | import com.airbnb.epoxy.ModelView.Size;
8 |
9 | @ModelView(autoLayout = Size.MANUAL)
10 | public class AutoLayoutModelViewManualLayoutParams extends View {
11 |
12 | public AutoLayoutModelViewManualLayoutParams(Context context) {
13 | super(context);
14 | setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
15 | }
16 |
17 | @ModelProp
18 | void setValue(int value) {
19 |
20 | }
21 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/AutoLayoutModelViewMatchParent.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.ModelView.Size;
7 |
8 | @ModelView(autoLayout = Size.MATCH_WIDTH_MATCH_HEIGHT)
9 | public class AutoLayoutModelViewMatchParent extends View {
10 |
11 | public AutoLayoutModelViewMatchParent(Context context) {
12 | super(context);
13 | }
14 |
15 | @ModelProp
16 | void setValue(int value) {
17 |
18 | }
19 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/AutoModelNotInAutoAdapter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.adapter;
2 |
3 | import com.airbnb.epoxy.AutoModel;
4 | import com.airbnb.epoxy.BasicModelWithAttribute_;
5 |
6 | public class AutoModelNotInAutoAdapter {
7 |
8 | @AutoModel BasicModelWithAttribute_ modelWithAttribute_;
9 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/AutoModelNotOnModelField.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.adapter;
2 |
3 | import com.airbnb.epoxy.AutoModel;
4 | import com.airbnb.epoxy.EpoxyController;
5 |
6 | public class AutoModelNotOnModelField extends EpoxyController {
7 |
8 | @AutoModel String value;
9 |
10 | @Override
11 | protected void buildModels() {
12 |
13 | }
14 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/BaseModelView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.widget.FrameLayout;
5 |
6 | @ModelView(defaultLayout = 1, baseModelClass = TestBaseModel.class)
7 | public class BaseModelView extends FrameLayout {
8 |
9 | public BaseModelView(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setClickListener(String title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/BasicModelWithAttribute.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class BasicModelWithAttribute extends EpoxyModel {
4 | @EpoxyAttribute int value;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ControllerProcessorTest/controllerWithAutoModel/BasicModelWithAttribute.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | open class BasicModelWithAttribute : EpoxyModel() {
4 | @EpoxyAttribute
5 | var value = 0
6 |
7 | override fun getDefaultLayout(): Int {
8 | return 0
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ControllerProcessorTest/controllerWithAutoModel/ControllerWithAutoModel.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.adapter
2 |
3 | import android.view.View
4 | import com.airbnb.epoxy.AutoModel
5 | import com.airbnb.epoxy.BasicModelWithAttribute_
6 | import com.airbnb.epoxy.EpoxyController
7 | import com.airbnb.epoxy.processortest2.ProcessorTest2Model
8 |
9 | class ControllerWithAutoModel : EpoxyController() {
10 | @AutoModel
11 | lateinit var modelWithAttribute1: BasicModelWithAttribute_
12 |
13 | @AutoModel
14 | lateinit var modelWithAttribute2: BasicModelWithAttribute_
15 |
16 | @AutoModel
17 | lateinit var modelFromClassPath: ProcessorTest2Model
18 |
19 | protected override fun buildModels() {}
20 | }
21 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ControllerWithAutoModel.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.adapter;
2 |
3 | import com.airbnb.epoxy.AutoModel;
4 | import com.airbnb.epoxy.BasicModelWithAttribute_;
5 | import com.airbnb.epoxy.EpoxyController;
6 |
7 | public class ControllerWithAutoModel extends EpoxyController {
8 |
9 | @AutoModel BasicModelWithAttribute_ modelWithAttribute1;
10 | @AutoModel BasicModelWithAttribute_ modelWithAttribute2;
11 |
12 | @Override
13 | protected void buildModels() {
14 |
15 | }
16 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ControllerWithAutoModelAndImplicitAdding.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.adapter;
2 |
3 | import com.airbnb.epoxy.AutoModel;
4 | import com.airbnb.epoxy.BasicModelWithAttribute_;
5 | import com.airbnb.epoxy.EpoxyController;
6 |
7 | public class ControllerWithAutoModelAndImplicitAdding extends EpoxyController {
8 |
9 | @AutoModel BasicModelWithAttribute_ modelWithAttribute1;
10 | @AutoModel BasicModelWithAttribute_ modelWithAttribute2;
11 |
12 | @Override
13 | protected void buildModels() {
14 |
15 | }
16 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ControllerWithAutoModelWithSuperClass.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.adapter;
2 |
3 | import com.airbnb.epoxy.AutoModel;
4 | import com.airbnb.epoxy.BasicModelWithAttribute_;
5 | import com.airbnb.epoxy.EpoxyController;
6 |
7 | public class ControllerWithAutoModelWithSuperClass extends EpoxyController {
8 |
9 | @AutoModel BasicModelWithAttribute_ modelWithAttribute1;
10 | @AutoModel BasicModelWithAttribute_ modelWithAttribute2;
11 |
12 | @Override
13 | protected void buildModels() {
14 |
15 | }
16 |
17 | public static class SubControllerWithAutoModelWithSuperClass extends ControllerWithAutoModelWithSuperClass {
18 |
19 | @AutoModel BasicModelWithAttribute_ modelWithAttribute3;
20 |
21 | @Override
22 | protected void buildModels() {
23 |
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ControllerWithAutoModelWithoutValidation.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.adapter;
2 |
3 | import com.airbnb.epoxy.AutoModel;
4 | import com.airbnb.epoxy.BasicModelWithAttribute_;
5 | import com.airbnb.epoxy.EpoxyController;
6 |
7 | public class ControllerWithAutoModelWithoutValidation extends EpoxyController {
8 |
9 | @AutoModel BasicModelWithAttribute_ modelWithAttribute1;
10 | @AutoModel BasicModelWithAttribute_ modelWithAttribute2;
11 |
12 | @Override
13 | protected void buildModels() {
14 |
15 | }
16 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/DataBindingConfig.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | @EpoxyDataBindingLayouts({R.layout.model_with_data_binding})
4 | interface EpoxyDataBindingConfig {}
5 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/DoNotHashView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.ModelProp.Option;
7 |
8 | @ModelView(defaultLayout = 1)
9 | public class DoNotHashView extends View {
10 |
11 | public DoNotHashView(Context context) {
12 | super(context);
13 | }
14 |
15 | @ModelProp(options = Option.DoNotHash)
16 | public void setTitle(CharSequence title) {
17 |
18 | }
19 |
20 | @ModelProp(options = Option.DoNotHash)
21 | public void setClickListener(View.OnClickListener title) {
22 |
23 | }
24 |
25 | @ModelProp
26 | public void normalProp(CharSequence title) {
27 |
28 | }
29 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/EpoxyModelGroupWithAnnotations.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import java.util.Collection;
4 |
5 | @EpoxyModelClass
6 | public class EpoxyModelGroupWithAnnotations extends EpoxyModelGroup {
7 |
8 | public EpoxyModelGroupWithAnnotations(int layoutRes, Collection extends EpoxyModel>> models) {
9 | super(layoutRes, models);
10 | }
11 |
12 | @EpoxyAttribute int value;
13 | }
14 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/GenerateDefaultLayoutMethod.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | @EpoxyModelClass(layout = 1)
4 | public abstract class GenerateDefaultLayoutMethod extends EpoxyModel {
5 | @EpoxyAttribute int value;
6 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/GenerateDefaultLayoutMethodNextParentLayout.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class GenerateDefaultLayoutMethodNextParentLayout {
4 |
5 | @EpoxyModelClass
6 | public static abstract class NoLayout extends WithLayout {
7 | @EpoxyAttribute int value;
8 | }
9 |
10 | @EpoxyModelClass
11 | public static abstract class StillNoLayout extends WithLayout {
12 |
13 | }
14 |
15 | @EpoxyModelClass(layout = 1)
16 | public static abstract class WithLayout extends EpoxyModel {
17 |
18 | }
19 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/GenerateDefaultLayoutMethodNoLayout.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | @EpoxyModelClass
4 | public abstract class GenerateDefaultLayoutMethodNoLayout extends EpoxyModel {
5 | @EpoxyAttribute int value;
6 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/GenerateDefaultLayoutMethodParentLayout.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class GenerateDefaultLayoutMethodParentLayout {
4 |
5 | @EpoxyModelClass
6 | public static abstract class NoLayout extends WithLayout {
7 | @EpoxyAttribute int value;
8 | }
9 |
10 | @EpoxyModelClass(layout = 1)
11 | public static abstract class WithLayout extends EpoxyModel {
12 |
13 | }
14 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/GenerateDefaultLayoutMethodParentStillNoLayout.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class GenerateDefaultLayoutMethodParentStillNoLayout {
4 |
5 | @EpoxyModelClass
6 | public static abstract class NoLayout extends StillNoLayout {
7 | @EpoxyAttribute int value;
8 | }
9 |
10 | @EpoxyModelClass
11 | public static abstract class StillNoLayout extends EpoxyModel {
12 |
13 | }
14 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/GridSpanCountView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1, fullSpan = false)
7 | public class GridSpanCountView extends View {
8 |
9 | public GridSpanCountView(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setClickListener(String title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/IgnoreRequireHashCodeView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.ModelProp.Option;
7 |
8 | @ModelView(defaultLayout = 1)
9 | public class IgnoreRequireHashCodeView extends View {
10 |
11 | public IgnoreRequireHashCodeView(Context context) {
12 | super(context);
13 | }
14 |
15 | @ModelProp(options = Option.IgnoreRequireHashCode)
16 | public void setClickListener(View.OnClickListener title) {
17 |
18 | }
19 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelAsInnerClass.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelAsInnerClass {
4 |
5 | class InnerClass extends EpoxyModel {
6 | @EpoxyAttribute int valueInt;
7 |
8 | @Override
9 | protected int getDefaultLayout() {
10 | return 0;
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelConfigRequireHashCodeAllowsMarkedAttributes.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyAttribute.Option;
5 | import com.airbnb.epoxy.EpoxyModel;
6 |
7 | public class ModelConfigRequireHashCodeAllowsMarkedAttributes extends EpoxyModel {
8 |
9 | public static class ClassWithoutHashCode {
10 |
11 | }
12 |
13 | @EpoxyAttribute(Option.IgnoreRequireHashCode) ClassWithoutHashCode classWithoutHashCode;
14 |
15 | @Override
16 | protected int getDefaultLayout() {
17 | return 0;
18 | }
19 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelConfigRequireHashCodeCharSequencePasses.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelConfigRequireHashCodeCharSequencePasses extends EpoxyModel {
4 |
5 | @EpoxyAttribute CharSequence charSequence;
6 |
7 | @Override
8 | protected int getDefaultLayout() {
9 | return 0;
10 | }
11 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelConfigRequireHashCodeInterfaceWithHashCodePasses.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelConfigRequireHashCodeInterfaceWithHashCodePasses extends EpoxyModel {
4 |
5 | interface MyInterface {
6 | int hashCode();
7 | }
8 |
9 | @EpoxyAttribute MyInterface myInterfaceImplementation;
10 |
11 | @Override
12 | protected int getDefaultLayout() {
13 | return 0;
14 | }
15 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelConfigSubPackageOverridesParent.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest.sub;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 |
6 | public class ModelConfigSubPackageOverridesParent extends EpoxyModel {
7 |
8 | public static class ClassWithoutHashCode {
9 |
10 | }
11 |
12 | @EpoxyAttribute ClassWithoutHashCode classWithoutHashCode;
13 |
14 | @Override
15 | protected int getDefaultLayout() {
16 | return 0;
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelDoNotHash.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute.Option;
4 |
5 | public class ModelDoNotHash extends EpoxyModel {
6 | @EpoxyAttribute int value;
7 | @EpoxyAttribute({Option.DoNotHash}) int value2;
8 | @EpoxyAttribute({Option.DoNotHash}) String value3;
9 |
10 | @Override
11 | protected int getDefaultLayout() {
12 | return 0;
13 | }
14 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelDoNotUseInToString.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute.Option;
4 |
5 | public class ModelDoNotUseInToString extends EpoxyModel {
6 | @EpoxyAttribute int value;
7 | @EpoxyAttribute({Option.DoNotUseInToString}) int value2;
8 | @EpoxyAttribute({Option.DoNotUseInToString}) String value3;
9 |
10 | @Override
11 | protected int getDefaultLayout() {
12 | return 0;
13 | }
14 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelForRProcessingTest.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | @EpoxyModelClass(layout = R.layout.res)
4 | public abstract class ModelForRProcessingTest extends EpoxyModel {
5 | @EpoxyAttribute int value;
6 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelForTestingDuplicateRValues.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import com.airbnb.epoxy.othermodule.R;
4 |
5 | @EpoxyModelClass(layout = R.layout.res_in_other_module)
6 | public abstract class ModelForTestingDuplicateRValues extends EpoxyModel {
7 | @EpoxyAttribute int value;
8 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelNoValidation.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelNoValidation extends EpoxyModel {
4 | @EpoxyAttribute int value;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelPackageWithNoConfigInheritsNearestParentConfig.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest.sub.sub;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 |
6 | public class ModelPackageWithNoConfigInheritsNearestParentConfig extends EpoxyModel {
7 |
8 | public static class ClassWithoutHashCode {
9 |
10 | }
11 |
12 | @EpoxyAttribute ClassWithoutHashCode classWithoutHashCode;
13 |
14 | @Override
15 | protected int getDefaultLayout() {
16 | return 0;
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelProcessorTest/testKotlinModel/Model.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | import android.view.View
4 | import androidx.annotation.DrawableRes
5 |
6 | @EpoxyModelClass
7 | abstract class Model : EpoxyModelWithHolder() {
8 | @EpoxyAttribute @DrawableRes
9 | var imageRes: Int = 0
10 |
11 | @EpoxyAttribute(EpoxyAttribute.Option.DoNotHash)
12 | var clickListener: View.OnClickListener? = null
13 |
14 | override fun getDefaultLayout(): Int = 0
15 |
16 | override fun bind(holder: Holder) {
17 | }
18 |
19 | override fun unbind(holder: Holder) {
20 | }
21 |
22 | class Holder : EpoxyHolder() {
23 | override fun bindView(itemView: View) {
24 |
25 | }
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelRequiresEqualsFailsBasicObject.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 |
6 | public class ModelRequiresEqualsFailsBasicObject extends EpoxyModel {
7 |
8 | public static class ClassWithHashCodeAndNotEquals {
9 |
10 | @Override
11 | public int hashCode() {
12 | return super.hashCode();
13 | }
14 | }
15 |
16 | @EpoxyAttribute ClassWithHashCodeAndNotEquals classWithoutHashCode;
17 |
18 | @Override
19 | protected int getDefaultLayout() {
20 | return 0;
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelRequiresHashCodeArrayFails.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 |
6 | public class ModelRequiresHashCodeArrayFails extends EpoxyModel {
7 | @EpoxyAttribute Object[] clickListener;
8 |
9 | @Override
10 | protected int getDefaultLayout() {
11 | return 0;
12 | }
13 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelRequiresHashCodeArraySucceeds.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 |
6 | public class ModelRequiresHashCodeArraySucceeds extends EpoxyModel {
7 | @EpoxyAttribute String[] clickListener;
8 |
9 | @Override
10 | protected int getDefaultLayout() {
11 | return 0;
12 | }
13 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelRequiresHashCodeAutoValueClassPasses.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 | import com.google.auto.value.AutoValue;
6 |
7 | public class ModelRequiresHashCodeAutoValueClassPasses extends EpoxyModel {
8 |
9 | @AutoValue
10 | public static abstract class AutoValueClass {
11 |
12 | }
13 |
14 | @EpoxyAttribute AutoValueClass autoValueClass;
15 |
16 | @Override
17 | protected int getDefaultLayout() {
18 | return 0;
19 | }
20 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelRequiresHashCodeEnumPasses.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 |
6 | public class ModelRequiresHashCodeEnumPasses extends EpoxyModel {
7 |
8 | public enum MyEnum {
9 | Value
10 | }
11 |
12 | @EpoxyAttribute MyEnum enumValue;
13 |
14 | @Override
15 | protected int getDefaultLayout() {
16 | return 0;
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelRequiresHashCodeFailsBasicObject.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 |
6 | public class ModelRequiresHashCodeFailsBasicObject extends EpoxyModel {
7 |
8 | public static class ClassWithoutHashCode {
9 |
10 | @Override
11 | public boolean equals(Object obj) {
12 | return super.equals(obj);
13 | }
14 | }
15 |
16 | @EpoxyAttribute ClassWithoutHashCode classWithoutHashCode;
17 |
18 | @Override
19 | protected int getDefaultLayout() {
20 | return 0;
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelRequiresHashCodeIterableFails.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 |
6 | import java.util.List;
7 |
8 | public class ModelRequiresHashCodeIterableFails extends EpoxyModel {
9 | @EpoxyAttribute List clickListener;
10 |
11 | @Override
12 | protected int getDefaultLayout() {
13 | return 0;
14 | }
15 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelRequiresHashCodeIterableSucceeds.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 |
6 | import java.util.List;
7 |
8 | public class ModelRequiresHashCodeIterableSucceeds extends EpoxyModel {
9 | @EpoxyAttribute List clickListener;
10 |
11 | @Override
12 | protected int getDefaultLayout() {
13 | return 0;
14 | }
15 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelReturningClassType.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import java.util.List;
4 |
5 | public class ModelReturningClassType extends EpoxyModel {
6 | @EpoxyAttribute int value;
7 |
8 | @Override
9 | protected int getDefaultLayout() {
10 | return 0;
11 | }
12 |
13 | public ModelReturningClassType classType(int classType) {
14 | return this;
15 | }
16 |
17 | public ModelReturningClassType classType(int param1, int param2) {
18 | return this;
19 | }
20 |
21 | public ModelReturningClassType list(List list) {
22 | return this;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelReturningClassTypeWithVarargs.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelReturningClassTypeWithVarargs extends EpoxyModel {
4 | @EpoxyAttribute int value;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 |
11 | public ModelReturningClassTypeWithVarargs classType(String... varargs) {
12 | return this;
13 | }
14 |
15 | public ModelReturningClassTypeWithVarargs classType(String first, String... varargs) {
16 | return this;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelViewSuperClass.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.ModelView.Size;
7 |
8 | @ModelView(autoLayout = Size.MATCH_WIDTH_MATCH_HEIGHT)
9 | public class ModelViewSuperClass extends View {
10 |
11 | public ModelViewSuperClass(Context context) {
12 | super(context);
13 | }
14 |
15 | @ModelProp
16 | void superClassValue(int value) {
17 |
18 | }
19 |
20 | @OnViewRecycled
21 | void onClear() {
22 |
23 | }
24 |
25 | @AfterPropsSet
26 | void afterProps() {
27 |
28 | }
29 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithAbstractClass.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public abstract class ModelWithAbstractClass extends EpoxyModel {
4 |
5 | @Override
6 | protected int getDefaultLayout() {
7 | return 0;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithAbstractClassAndAnnotation.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | @EpoxyModelClass
4 | public abstract class ModelWithAbstractClassAndAnnotation extends EpoxyModel {
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithAnnotatedClass.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | @EpoxyModelClass
4 | public class ModelWithAnnotatedClass extends EpoxyModel {
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithAnnotatedClassAndSuperAttributes.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithAnnotatedClassAndSuperAttributes extends EpoxyModel {
4 |
5 | @EpoxyAttribute int superValue;
6 |
7 | @Override
8 | protected int getDefaultLayout() {
9 | return 0;
10 | }
11 |
12 | @EpoxyModelClass
13 | public static class SubModelWithAnnotatedClassAndSuperAttributes
14 | extends ModelWithAnnotatedClassAndSuperAttributes {
15 |
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithAnnotation.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | @EpoxyModelClass
4 | @Deprecated
5 | public class ModelWithAnnotation extends EpoxyModel {
6 |
7 | @Override
8 | protected int getDefaultLayout() {
9 | return 0;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithCheckedChangeListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.view.View;
4 | import android.widget.CompoundButton;
5 |
6 | import com.airbnb.epoxy.EpoxyAttribute.Option;
7 |
8 | import static com.airbnb.epoxy.EpoxyAttribute.Option.DoNotHash;
9 |
10 | public class ModelWithCheckedChangeListener extends EpoxyModel {
11 | @EpoxyAttribute(DoNotHash) CompoundButton.OnCheckedChangeListener checkedListener;
12 |
13 | @Override
14 | protected int getDefaultLayout() {
15 | return 0;
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithConstructors.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithConstructors extends EpoxyModel {
4 | @EpoxyAttribute int valueInt;
5 |
6 | public ModelWithConstructors(long id, int valueInt) {
7 | super(id);
8 | this.valueInt = valueInt;
9 | }
10 |
11 | public ModelWithConstructors(int valueInt) {
12 | this.valueInt = valueInt;
13 | }
14 |
15 | public ModelWithConstructors() {
16 | }
17 |
18 | @Override
19 | protected int getDefaultLayout() {
20 | return 0;
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithFieldAnnotation.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import androidx.annotation.Nullable;
4 |
5 | public class ModelWithFieldAnnotation extends EpoxyModel {
6 | @EpoxyAttribute @Nullable String title;
7 |
8 | @Override
9 | protected int getDefaultLayout() {
10 | return 0;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithFinalClass.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public final class ModelWithFinalClass extends EpoxyModel {
4 | @EpoxyAttribute int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithFinalField.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithFinalField extends EpoxyModel {
4 | @EpoxyAttribute final int finalValueInt;
5 | @EpoxyAttribute int nonFinalValueInt;
6 |
7 | public ModelWithFinalField(long id, int valueInt) {
8 | super(id);
9 | this.finalValueInt = valueInt;
10 | }
11 |
12 | @Override
13 | protected int getDefaultLayout() {
14 | return 0;
15 | }
16 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithIntDef.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.models;
2 |
3 | import androidx.annotation.IntDef;
4 |
5 | import com.airbnb.epoxy.EpoxyAttribute;
6 | import com.airbnb.epoxy.EpoxyModel;
7 |
8 | import java.lang.annotation.Retention;
9 |
10 | import static java.lang.annotation.RetentionPolicy.SOURCE;
11 |
12 | public class ModelWithIntDef extends EpoxyModel {
13 |
14 | @Retention(SOURCE)
15 | @IntDef({TYPE_1})
16 | public @interface MyType {}
17 |
18 | public static final int TYPE_1 = 1;
19 |
20 | @EpoxyAttribute @MyType int type;
21 |
22 | @Override
23 | protected int getDefaultLayout() {
24 | return 0;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateFieldWithGetterWithParams.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateFieldWithGetterWithParams extends EpoxyModel {
4 | @EpoxyAttribute private int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 |
11 | public int getValueInt(int param) {
12 | return valueInt;
13 | }
14 |
15 | public void setValueInt(int valueInt) {
16 | this.valueInt = valueInt;
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateFieldWithIsPrefixGetter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateFieldWithIsPrefixGetter extends EpoxyModel {
4 | @EpoxyAttribute private boolean valueBoolean;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 |
11 | public boolean isValueBoolean() {
12 | return valueBoolean;
13 | }
14 |
15 | public void setValueBoolean(boolean valueBoolean) {
16 | this.valueBoolean = valueBoolean;
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateFieldWithPrivateGetter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateFieldWithPrivateGetter extends EpoxyModel {
4 | @EpoxyAttribute private int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 |
11 | private int getValueInt() {
12 | return valueInt;
13 | }
14 |
15 | public void setValueInt(int valueInt) {
16 | this.valueInt = valueInt;
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateFieldWithPrivateSetter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateFieldWithPrivateSetter extends EpoxyModel {
4 | @EpoxyAttribute private int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 |
11 | public int getValueInt() {
12 | return valueInt;
13 | }
14 |
15 | private void setValueInt(int valueInt) {
16 | this.valueInt = valueInt;
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateFieldWithSameAsFieldGetterAndSetterName.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateFieldWithSameAsFieldGetterAndSetterName extends EpoxyModel {
4 | @EpoxyAttribute private boolean isValue;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 |
11 | public boolean isValue() {
12 | return isValue;
13 | }
14 |
15 | public void setValue(boolean isValue) {
16 | this.isValue = isValue;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateFieldWithSettterWithoutParams.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateFieldWithSettterWithoutParams extends EpoxyModel {
4 | @EpoxyAttribute private int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 |
11 | public int getValueInt() {
12 | return valueInt;
13 | }
14 |
15 | public void setValueInt() {
16 | this.valueInt = 0;
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateFieldWithStaticGetter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateFieldWithStaticGetter extends EpoxyModel {
4 | @EpoxyAttribute private int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 |
11 | public static int getValueInt() {
12 | return 0;
13 | }
14 |
15 | public void setValueInt(int valueInt) {
16 | this.valueInt = valueInt;
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateFieldWithStaticSetter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateFieldWithStaticSetter extends EpoxyModel {
4 | @EpoxyAttribute private int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 |
11 | public int getValueInt() {
12 | return valueInt;
13 | }
14 |
15 | public static void setValueInt(int valueInt) {
16 |
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateFieldWithoutGetter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateFieldWithoutGetter extends EpoxyModel {
4 | @EpoxyAttribute private int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 |
11 | public void setValueInt(int valueInt) {
12 | this.valueInt = valueInt;
13 | }
14 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateFieldWithoutGetterAndSetter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateFieldWithoutGetterAndSetter extends EpoxyModel {
4 | @EpoxyAttribute private int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateFieldWithoutSetter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateFieldWithoutSetter extends EpoxyModel {
4 | @EpoxyAttribute private int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 |
11 | public int getValueInt() {
12 | return valueInt;
13 | }
14 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateInnerClass.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithPrivateInnerClass extends EpoxyModel {
4 |
5 | @Override
6 | protected int getDefaultLayout() {
7 | return 0;
8 | }
9 |
10 | private static class Test extends EpoxyModel {
11 | @EpoxyAttribute int value;
12 |
13 | @Override
14 | protected int getDefaultLayout() {
15 | return 0;
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithPrivateViewClickListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.view.View;
4 | import android.view.View.OnClickListener;
5 |
6 | import com.airbnb.epoxy.EpoxyAttribute.Option;
7 |
8 | import static com.airbnb.epoxy.EpoxyAttribute.Option.DoNotHash;
9 |
10 | public class ModelWithPrivateViewClickListener extends EpoxyModel {
11 | @EpoxyAttribute(DoNotHash) private View.OnClickListener clickListener;
12 |
13 | @Override
14 | protected int getDefaultLayout() {
15 | return 0;
16 | }
17 |
18 | public OnClickListener getClickListener() {
19 | return clickListener;
20 | }
21 |
22 | public void setClickListener(OnClickListener clickListener) {
23 | this.clickListener = clickListener;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithStaticField.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithStaticField extends EpoxyModel {
4 | @EpoxyAttribute static int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithSuper.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithSuper extends EpoxyModel {
4 | @EpoxyAttribute int valueInt;
5 |
6 | public ModelWithSuper valueInt(int valueInt) {
7 | this.valueInt = valueInt;
8 | return this;
9 | }
10 |
11 | @Override
12 | protected int getDefaultLayout() {
13 | return 0;
14 | }
15 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithSuperAttributes.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithSuperAttributes extends EpoxyModel {
4 |
5 | @EpoxyAttribute int superValue;
6 |
7 | @Override
8 | protected int getDefaultLayout() {
9 | return 0;
10 | }
11 |
12 | public static class SubModelWithSuperAttributes extends ModelWithSuperAttributes {
13 | @EpoxyAttribute int subValue;
14 | }
15 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithType.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithType extends EpoxyModel {
4 |
5 | @EpoxyAttribute int value;
6 |
7 | @Override
8 | protected int getDefaultLayout() {
9 | return 0;
10 | }
11 |
12 | @Override
13 | public boolean equals(Object o) {
14 | if (this == o) {
15 | return true;
16 | }
17 | if (!(o instanceof ModelWithType_)) {
18 | return false;
19 | }
20 | if (!super.equals(o)) {
21 | return false;
22 | }
23 |
24 | ModelWithType that = (ModelWithType) o;
25 |
26 | return value == that.value;
27 | }
28 |
29 | @Override
30 | public int hashCode() {
31 | int result = super.hashCode();
32 | result = 31 * result + value;
33 | return result;
34 | }
35 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithVarargsConstructors.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithVarargsConstructors extends EpoxyModel {
4 | @EpoxyAttribute int valueInt;
5 | @EpoxyAttribute String[] varargs;
6 |
7 | public ModelWithVarargsConstructors(String... varargs) {
8 | this.varargs = varargs;
9 | }
10 |
11 | public ModelWithVarargsConstructors(int valueInt, String... varargs) {
12 | this.valueInt = valueInt;
13 | this.varargs = varargs;
14 | }
15 |
16 | @Override
17 | protected int getDefaultLayout() {
18 | return 0;
19 | }
20 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithViewClickListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.view.View;
4 |
5 | import com.airbnb.epoxy.EpoxyAttribute.Option;
6 |
7 | import static com.airbnb.epoxy.EpoxyAttribute.Option.DoNotHash;
8 |
9 | public class ModelWithViewClickListener extends EpoxyModel {
10 | @EpoxyAttribute(DoNotHash) View.OnClickListener clickListener;
11 |
12 | @Override
13 | protected int getDefaultLayout() {
14 | return 0;
15 | }
16 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithViewLongClickListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.view.View;
4 |
5 | import com.airbnb.epoxy.EpoxyAttribute.Option;
6 |
7 | import static com.airbnb.epoxy.EpoxyAttribute.Option.DoNotHash;
8 |
9 | public class ModelWithViewLongClickListener extends EpoxyModel {
10 | @EpoxyAttribute(DoNotHash) View.OnLongClickListener clickListener;
11 |
12 | @Override
13 | protected int getDefaultLayout() {
14 | return 0;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithoutEpoxyExtension.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithoutEpoxyExtension extends Object {
4 | @EpoxyAttribute int valueInt;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithoutHash.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithoutHash extends EpoxyModel {
4 | @EpoxyAttribute int value;
5 | @EpoxyAttribute(hash = false) int value2;
6 | @EpoxyAttribute(hash = false) String value3;
7 |
8 | @Override
9 | protected int getDefaultLayout() {
10 | return 0;
11 | }
12 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ModelWithoutSetter.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | public class ModelWithoutSetter extends EpoxyModel {
4 | @EpoxyAttribute(setter = false) int value;
5 |
6 | @Override
7 | protected int getDefaultLayout() {
8 | return 0;
9 | }
10 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/NullOnRecycleView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import androidx.annotation.Nullable;
5 | import android.view.View;
6 |
7 | import com.airbnb.epoxy.ModelProp.Option;
8 |
9 | @ModelView(defaultLayout = 1)
10 | public class NullOnRecycleView extends View {
11 |
12 | public NullOnRecycleView(Context context) {
13 | super(context);
14 | }
15 |
16 | @ModelProp(options = Option.NullOnRecycle)
17 | public void setTitle(@Nullable CharSequence title) {
18 |
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/NullOnRecycleView_throwsIfNotNullable.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import androidx.annotation.Nullable;
5 | import android.view.View;
6 |
7 | import com.airbnb.epoxy.ModelProp.Option;
8 |
9 | @ModelView(defaultLayout = 1)
10 | public class NullOnRecycleView_throwsIfNotNullable extends View {
11 |
12 | public NullOnRecycleView_throwsIfNotNullable(Context context) {
13 | super(context);
14 | }
15 |
16 | @ModelProp(options = Option.NullOnRecycle)
17 | public void setTitle(CharSequence title) {
18 |
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ObjectWithoutEqualsThrowsView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class ObjectWithoutEqualsThrowsView extends View {
8 |
9 | public ObjectWithoutEqualsThrowsView(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setClickListener(View.OnClickListener title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnViewRecycledView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnViewRecycledView extends View {
8 |
9 | public OnViewRecycledView(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnViewRecycled
19 | void onRecycled1() {
20 | // also testing package private works
21 | }
22 |
23 | @OnViewRecycled
24 | public void onRecycled2() {
25 |
26 | }
27 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnViewRecycledView_throwsIfHasParams.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnViewRecycledView_throwsIfHasParams extends View {
8 |
9 | public OnViewRecycledView_throwsIfHasParams(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnViewRecycled
19 | private void onRecycled1(int param) {
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnViewRecycledView_throwsIfPrivate.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnViewRecycledView_throwsIfPrivate extends View {
8 |
9 | public OnViewRecycledView_throwsIfPrivate(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnViewRecycled
19 | private void onRecycled1() {
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnViewRecycledView_throwsIfStatic.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnViewRecycledView_throwsIfStatic extends View {
8 |
9 | public OnViewRecycledView_throwsIfStatic(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnViewRecycled
19 | static void onRecycled1() {
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnVisibilityChangedView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnVisibilityChangedView extends View {
8 |
9 | public OnVisibilityChangedView(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnVisibilityChanged
19 | void onVisibilityChanged1(float ph, float pw, int vh, int vw) {
20 | // also testing package private works
21 | }
22 |
23 | @OnVisibilityChanged
24 | public void onVisibilityChanged2(float ph, float pw, int vh, int vw) {
25 |
26 | }
27 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnVisibilityChangedView_throwsIfInvalidParams.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnVisibilityChangedView_throwsIfInvalidParams extends View {
8 |
9 | public OnVisibilityChangedView_throwsIfInvalidParams(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnVisibilityChanged
19 | public void onVisibilityChanged(boolean ph, boolean pw, int vh, int vw) {
20 |
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnVisibilityChangedView_throwsIfNoParams.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnVisibilityChangedView_throwsIfNoParams extends View {
8 |
9 | public OnVisibilityChangedView_throwsIfNoParams(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnVisibilityChanged
19 | void onVisibilityChanged() {
20 |
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnVisibilityChangedView_throwsIfPrivate.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnVisibilityChangedView_throwsIfPrivate extends View {
8 |
9 | public OnVisibilityChangedView_throwsIfPrivate(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnVisibilityChanged
19 | private void onVisibilityChanged(float ph, float pw, int vh, int vw) {
20 |
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnVisibilityChangedView_throwsIfStatic.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnVisibilityChangedView_throwsIfStatic extends View {
8 |
9 | public OnVisibilityChangedView_throwsIfStatic(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnVisibilityChanged
19 | static void onVisibilityChanged(float ph, float pw, int vh, int vw) {
20 |
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnVisibilityStateChangedView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnVisibilityStateChangedView extends View {
8 |
9 | public OnVisibilityStateChangedView(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnVisibilityStateChanged
19 | void onVisibilityStateChanged1(int s) {
20 | // also testing package private works
21 | }
22 |
23 | @OnVisibilityStateChanged
24 | public void onVisibilityStateChanged2(int s) {
25 |
26 | }
27 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnVisibilityStateChangedView_throwsIfInvalidParams.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnVisibilityStateChangedView_throwsIfInvalidParams extends View {
8 |
9 | public OnVisibilityStateChangedView_throwsIfInvalidParams(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnVisibilityStateChanged
19 | public void onVisibilityStateChanged(boolean s) {
20 |
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnVisibilityStateChangedView_throwsIfNoParams.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnVisibilityStateChangedView_throwsIfNoParams extends View {
8 |
9 | public OnVisibilityStateChangedView_throwsIfNoParams(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnVisibilityStateChanged
19 | void onVisibilityStateChanged() {
20 |
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnVisibilityStateChangedView_throwsIfPrivate.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnVisibilityStateChangedView_throwsIfPrivate extends View {
8 |
9 | public OnVisibilityStateChangedView_throwsIfPrivate(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnVisibilityStateChanged
19 | private void onVisibilityStateChanged(int s) {
20 |
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/OnVisibilityStateChangedView_throwsIfStatic.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class OnVisibilityStateChangedView_throwsIfStatic extends View {
8 |
9 | public OnVisibilityStateChangedView_throwsIfStatic(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 |
18 | @OnVisibilityStateChanged
19 | static void onVisibilityStateChanged(int s) {
20 |
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/PropDefaultsView_throwsForNonFinalValue.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import androidx.annotation.Nullable;
5 | import android.view.View;
6 |
7 | @ModelView(defaultLayout = 1)
8 | public class PropDefaultsView_throwsForNonFinalValue extends View {
9 | static int PRIMITIVE_DEFAULT = 23;
10 |
11 | public PropDefaultsView_throwsForNonFinalValue(Context context) {
12 | super(context);
13 | }
14 | @ModelProp(defaultValue = "PRIMITIVE_DEFAULT")
15 | public void primitiveWithExplicitDefault(int title) {
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/PropDefaultsView_throwsForNonStaticValue.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import androidx.annotation.Nullable;
5 | import android.view.View;
6 |
7 | @ModelView(defaultLayout = 1)
8 | public class PropDefaultsView_throwsForNonStaticValue extends View {
9 | final int PRIMITIVE_DEFAULT = 23;
10 |
11 | public PropDefaultsView_throwsForNonStaticValue(Context context) {
12 | super(context);
13 | }
14 | @ModelProp(defaultValue = "PRIMITIVE_DEFAULT")
15 | public void primitiveWithExplicitDefault(int title) {
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/PropDefaultsView_throwsForNotFound.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class PropDefaultsView_throwsForNotFound extends View {
8 |
9 | public PropDefaultsView_throwsForNotFound(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp(defaultValue = "PRIMITIVE_DEFAULT")
14 | public void primitiveWithExplicitDefault(int title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/PropDefaultsView_throwsForPrivateValue.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class PropDefaultsView_throwsForPrivateValue extends View {
8 | private static final int PRIMITIVE_DEFAULT = 23;
9 |
10 | public PropDefaultsView_throwsForPrivateValue(Context context) {
11 | super(context);
12 | }
13 |
14 | @ModelProp(defaultValue = "PRIMITIVE_DEFAULT")
15 | public void primitiveWithExplicitDefault(int title) {
16 |
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/PropDefaultsView_throwsForWrongType.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class PropDefaultsView_throwsForWrongType extends View {
8 | static final String PRIMITIVE_DEFAULT = 23;
9 |
10 | public PropDefaultsView_throwsForWrongType(Context context) {
11 | super(context);
12 | }
13 |
14 | @ModelProp(defaultValue = "PRIMITIVE_DEFAULT")
15 | public void primitiveWithExplicitDefault(int title) {
16 |
17 | }
18 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/Prop_throwsIfMultipleParams.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class Prop_throwsIfMultipleParams extends View {
8 |
9 | public Prop_throwsIfMultipleParams(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle(CharSequence title, int prop) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/Prop_throwsIfNoParams.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class Prop_throwsIfNoParams extends View {
8 |
9 | public Prop_throwsIfNoParams(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setTitle() {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/Prop_throwsIfPrivate.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class Prop_throwsIfPrivate extends View {
8 |
9 | public Prop_throwsIfPrivate(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | private void setTitle(CharSequence title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/Prop_throwsIfStatic.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class Prop_throwsIfStatic extends View {
8 |
9 | public Prop_throwsIfStatic(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public static void setTitle(CharSequence title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/RequireAbstractModelFailsClassWithAttribute.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 |
6 | public class RequireAbstractModelFailsClassWithAttribute extends EpoxyModel {
7 |
8 | @EpoxyAttribute String value;
9 |
10 | @Override
11 | protected int getDefaultLayout() {
12 | return 0;
13 | }
14 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/RequireAbstractModelFailsEpoxyModelClass.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyModel;
4 | import com.airbnb.epoxy.EpoxyModelClass;
5 |
6 | @EpoxyModelClass
7 | public class RequireAbstractModelFailsEpoxyModelClass extends EpoxyModel {
8 |
9 | @Override
10 | protected int getDefaultLayout() {
11 | return 0;
12 | }
13 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/RequireAbstractModelPassesClassWithAttribute.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyAttribute;
4 | import com.airbnb.epoxy.EpoxyModel;
5 |
6 | public abstract class RequireAbstractModelPassesClassWithAttribute extends EpoxyModel {
7 |
8 | @EpoxyAttribute String value;
9 |
10 | @Override
11 | protected int getDefaultLayout() {
12 | return 0;
13 | }
14 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/RequireAbstractModelPassesEpoxyModelClass.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.configtest;
2 |
3 | import com.airbnb.epoxy.EpoxyModel;
4 | import com.airbnb.epoxy.EpoxyModelClass;
5 |
6 | @EpoxyModelClass
7 | public abstract class RequireAbstractModelPassesEpoxyModelClass extends EpoxyModel {
8 |
9 | @Override
10 | protected int getDefaultLayout() {
11 | return 0;
12 | }
13 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/SavedStateView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1, saveViewState = true)
7 | public class SavedStateView extends View {
8 |
9 | public SavedStateView(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setClickListener(String title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/StringOverloads_throwsIfNotCharSequence.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class StringOverloads_throwsIfNotCharSequence extends View {
8 |
9 | public StringOverloads_throwsIfNotCharSequence(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp(options = ModelProp.Option.GenerateStringOverloads)
14 | public void setTitle(String title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestAfterBindPropsSuperView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public abstract class TestAfterBindPropsSuperView extends View {
8 |
9 | public TestAfterBindPropsSuperView(Context context) {
10 | super(context);
11 | }
12 |
13 | @ModelProp
14 | public void setFlagSuper(boolean flag) {
15 |
16 | }
17 |
18 | @AfterPropsSet
19 | public void afterFlagSetSuper() {
20 |
21 | }
22 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestAfterBindPropsView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 |
5 | @ModelView(defaultLayout = 1)
6 | public class TestAfterBindPropsView extends TestAfterBindPropsSuperView {
7 |
8 | public TestAfterBindPropsView(Context context) {
9 | super(context);
10 | }
11 |
12 | @ModelProp
13 | public void setFlag(boolean flag) {
14 |
15 | }
16 |
17 | @AfterPropsSet
18 | public void afterFlagSet() {
19 |
20 | }
21 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestCallbackPropMustBeNullableView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class TestCallbackPropMustBeNullableView extends View {
8 |
9 | public TestCallbackPropMustBeNullableView(Context context) {
10 | super(context);
11 | }
12 |
13 | @CallbackProp
14 | public void setListener(View.OnClickListener clickListener) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestCallbackPropView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import androidx.annotation.Nullable;
5 | import android.view.View;
6 |
7 | @ModelView(defaultLayout = 1)
8 | public class TestCallbackPropView extends View {
9 |
10 | public TestCallbackPropView(Context context) {
11 | super(context);
12 | }
13 |
14 | @CallbackProp
15 | public void setListener(@Nullable View.OnClickListener clickListener) {
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropCallbackPropView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import androidx.annotation.Nullable;
5 | import android.view.View;
6 |
7 | import com.airbnb.epoxy.AfterPropsSet;
8 | import com.airbnb.epoxy.CallbackProp;
9 | import com.airbnb.epoxy.ModelView;
10 |
11 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
12 | public class TestFieldPropCallbackPropView extends View {
13 | @CallbackProp @Nullable OnClickListener value;
14 |
15 | public TestFieldPropCallbackPropView(Context context) {
16 | super(context);
17 | }
18 |
19 | @AfterPropsSet
20 | public void call() { }
21 | }
22 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropChildView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 |
5 | import com.airbnb.epoxy.ModelView;
6 | import com.airbnb.epoxy.TextProp;
7 |
8 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
9 |
10 | public class TestFieldPropChildView extends TestFieldPropParentView {
11 | @TextProp CharSequence textValue;
12 |
13 | public TestFieldPropChildView(Context context) {
14 | super(context);
15 | }
16 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropDoNotHashOptionView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.AfterPropsSet;
7 | import com.airbnb.epoxy.ModelProp;
8 | import com.airbnb.epoxy.ModelProp.Option;
9 | import com.airbnb.epoxy.ModelView;
10 |
11 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
12 |
13 | public class TestFieldPropDoNotHashOptionView extends View {
14 | @ModelProp(options = Option.DoNotHash) OnClickListener value;
15 |
16 | public TestFieldPropDoNotHashOptionView(Context context) {
17 | super(context);
18 | }
19 |
20 | @AfterPropsSet
21 | public void call() {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropGenerateStringOverloadsOptionView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.AfterPropsSet;
7 | import com.airbnb.epoxy.ModelProp;
8 | import com.airbnb.epoxy.ModelProp.Option;
9 | import com.airbnb.epoxy.ModelView;
10 |
11 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
12 |
13 | public class TestFieldPropGenerateStringOverloadsOptionView extends View {
14 | @ModelProp(options = Option.GenerateStringOverloads) CharSequence value;
15 |
16 | public TestFieldPropGenerateStringOverloadsOptionView(Context context) {
17 | super(context);
18 | }
19 |
20 | @AfterPropsSet
21 | public void call() {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropIgnoreRequireHashCodeOptionView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.AfterPropsSet;
7 | import com.airbnb.epoxy.ModelProp;
8 | import com.airbnb.epoxy.ModelProp.Option;
9 | import com.airbnb.epoxy.ModelView;
10 |
11 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
12 |
13 | public class TestFieldPropIgnoreRequireHashCodeOptionView extends View {
14 | @ModelProp(options = Option.IgnoreRequireHashCode) OnClickListener value;
15 |
16 | public TestFieldPropIgnoreRequireHashCodeOptionView(Context context) {
17 | super(context);
18 | }
19 |
20 | @AfterPropsSet
21 | public void call() {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropModelPropView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.AfterPropsSet;
7 | import com.airbnb.epoxy.ModelProp;
8 | import com.airbnb.epoxy.ModelView;
9 |
10 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
11 | public class TestFieldPropModelPropView extends View {
12 | @ModelProp int value;
13 |
14 | public TestFieldPropModelPropView(Context context) {
15 | super(context);
16 | }
17 |
18 | @AfterPropsSet
19 | public void call() { }
20 | }
21 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropNullOnRecycleOptionView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.AfterPropsSet;
7 | import com.airbnb.epoxy.ModelProp;
8 | import com.airbnb.epoxy.ModelProp.Option;
9 | import com.airbnb.epoxy.ModelView;
10 |
11 | import javax.annotation.Nullable;
12 |
13 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
14 |
15 | public class TestFieldPropNullOnRecycleOptionView extends View {
16 | @ModelProp(options = {Option.NullOnRecycle, Option.IgnoreRequireHashCode}) @Nullable
17 | OnClickListener value;
18 |
19 | public TestFieldPropNullOnRecycleOptionView(Context context) {
20 | super(context);
21 | }
22 |
23 | @AfterPropsSet
24 | public void call() {
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropParentView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.AfterPropsSet;
7 | import com.airbnb.epoxy.ModelProp;
8 | import com.airbnb.epoxy.ModelProp.Option;
9 | import com.airbnb.epoxy.ModelView;
10 |
11 | import javax.annotation.Nullable;
12 |
13 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
14 |
15 | public class TestFieldPropParentView extends View {
16 | @ModelProp(options = {Option.NullOnRecycle, Option.IgnoreRequireHashCode}) @Nullable OnClickListener value;
17 |
18 | public TestFieldPropParentView(Context context) {
19 | super(context);
20 | }
21 |
22 | @AfterPropsSet
23 | public void call() {
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropStringOverloadsIfNotCharSequenceView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.AfterPropsSet;
7 | import com.airbnb.epoxy.ModelProp;
8 | import com.airbnb.epoxy.ModelProp.Option;
9 | import com.airbnb.epoxy.ModelView;
10 |
11 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
12 |
13 | public class TestFieldPropStringOverloadsIfNotCharSequenceView extends View {
14 | @ModelProp(options = Option.GenerateStringOverloads) OnClickListener value;
15 |
16 | public TestFieldPropStringOverloadsIfNotCharSequenceView(Context context) {
17 | super(context);
18 | }
19 |
20 | @AfterPropsSet
21 | public void call() {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropTextPropView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 |
4 | import android.content.Context;
5 | import android.view.View;
6 |
7 | import com.airbnb.epoxy.AfterPropsSet;
8 | import com.airbnb.epoxy.ModelView;
9 | import com.airbnb.epoxy.TextProp;
10 |
11 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
12 | public class TestFieldPropTextPropView extends View {
13 | @TextProp CharSequence value;
14 |
15 | public TestFieldPropTextPropView(Context context) {
16 | super(context);
17 | }
18 |
19 | @AfterPropsSet
20 | public void call() { }
21 | }
22 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropThrowsIfPrivateView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.AfterPropsSet;
7 | import com.airbnb.epoxy.ModelProp;
8 | import com.airbnb.epoxy.ModelProp.Option;
9 | import com.airbnb.epoxy.ModelView;
10 |
11 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
12 |
13 | public class TestFieldPropThrowsIfPrivateView extends View {
14 | @ModelProp private String value;
15 |
16 | public TestFieldPropThrowsIfPrivateView(Context context) {
17 | super(context);
18 | }
19 |
20 | @AfterPropsSet
21 | public void call() {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestFieldPropThrowsIfStaticView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.AfterPropsSet;
7 | import com.airbnb.epoxy.ModelProp;
8 | import com.airbnb.epoxy.ModelProp.Option;
9 | import com.airbnb.epoxy.ModelView;
10 |
11 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
12 |
13 | public class TestFieldPropThrowsIfStaticView extends View {
14 | @ModelProp public static String value;
15 |
16 | public TestFieldPropThrowsIfStaticView(Context context) {
17 | super(context);
18 | }
19 |
20 | @AfterPropsSet
21 | public void call() {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestNullStringOverloadsView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import androidx.annotation.Nullable;
5 | import android.view.View;
6 |
7 | @ModelView(defaultLayout = 1)
8 | public class TestNullStringOverloadsView extends View {
9 |
10 | public TestNullStringOverloadsView(Context context) {
11 | super(context);
12 | }
13 |
14 | @ModelProp(options = ModelProp.Option.GenerateStringOverloads)
15 | public void setTitle(@Nullable CharSequence title) {
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestTextPropIfNotCharSequenceView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.airbnb.epoxy.AfterPropsSet;
7 | import com.airbnb.epoxy.ModelProp;
8 | import com.airbnb.epoxy.ModelProp.Option;
9 | import com.airbnb.epoxy.ModelView;
10 |
11 | @ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
12 |
13 | public class TestTextPropIfNotCharSequenceView extends View {
14 | @TextProp OnClickListener value;
15 |
16 | public TestTextPropIfNotCharSequenceView(Context context) {
17 | super(context);
18 | }
19 |
20 | @AfterPropsSet
21 | public void call() {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestTextPropMustBeCharSequenceView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class TestTextPropMustBeCharSequenceView extends View {
8 |
9 | public TestTextPropMustBeCharSequenceView(Context context) {
10 | super(context);
11 | }
12 |
13 | @TextProp
14 | public void setTitle(String title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TestTextPropView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class TestTextPropView extends View {
8 |
9 | public TestTextPropView(Context context) {
10 | super(context);
11 | }
12 |
13 | @TextProp
14 | public void setTitle(CharSequence title) {
15 |
16 | }
17 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TextPropDefaultView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import androidx.annotation.Nullable;
5 | import android.view.View;
6 |
7 | @ModelView(defaultLayout = 1)
8 | public class TextPropDefaultView extends View {
9 |
10 | public TextPropDefaultView(Context context) {
11 | super(context);
12 | }
13 |
14 | @TextProp(defaultRes = R.string.string_resource_value)
15 | public void textWithDefault(CharSequence title) {
16 |
17 | }
18 |
19 | @TextProp(defaultRes = R.string.string_resource_value)
20 | public void nullableTextWithDefault(@Nullable CharSequence title) {
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/TextPropDefaultView_throwsForNonStringRes.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import androidx.annotation.Nullable;
5 | import android.view.View;
6 |
7 | @ModelView(defaultLayout = 1)
8 | public class TextPropDefaultView_throwsForNonStringRes extends View {
9 |
10 | public TextPropDefaultView_throwsForNonStringRes(Context context) {
11 | super(context);
12 | }
13 |
14 | @TextProp(defaultRes = R.layout.res)
15 | public void textWithDefault(CharSequence title) {
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ViewProcessorTest/annotationsAreCopied/SourceView.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | import android.content.Context
4 | import android.view.View
5 | import android.view.View.OnClickListener
6 |
7 | @Deprecated("some message")
8 | @ModelView(
9 | autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
10 | )
11 | class SourceView(context: Context) : View(context) {
12 |
13 | @ModelProp
14 | fun foo(bar: Int) {}
15 |
16 | }
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ViewProcessorTest/annotationsAreCopied_java/SourceView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy;
2 |
3 | import android.content.Context;
4 | import android.widget.FrameLayout;
5 |
6 | @ModelView(defaultLayout = 1)
7 | public class SourceView extends FrameLayout {
8 |
9 | public SourceView(Context context) {
10 | super(context);
11 | }
12 |
13 | @SuppressWarnings("unused")
14 | @ModelProp String sectionId;
15 | }
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ViewProcessorTest/inheritingAttributesWorksCorrectlyJavaClassPath/SourceView.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | import android.content.Context
4 | import android.view.View
5 | import com.airbnb.epoxy.processortest2.ProcessorTest2Model
6 |
7 | @ModelView(
8 | autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
9 | baseModelClass = ProcessorTest2Model::class
10 | )
11 | class SourceView(context: Context) : View(context) {
12 |
13 | var sectionId: String? = null
14 | @ModelProp set
15 | }
16 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ViewProcessorTest/inheritingAttributesWorksCorrectlyJavaSources/SourceView.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | import android.content.Context
4 | import android.view.View
5 |
6 | @ModelView(
7 | autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
8 | baseModelClass = AirEpoxyModel::class
9 | )
10 | class SourceView(context: Context) : BaseView(context) {
11 |
12 | var sectionId: String? = null
13 | @ModelProp set
14 | }
15 |
16 | @ModelView(autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT)
17 | open class BaseView(context: Context) : View(context) {
18 |
19 | @ModelProp
20 | fun baseViewProp(prop: Int) {
21 | }
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ViewProcessorTest/testManyTypes/EpoxyModelViewProcessorKotlinExtensions.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("DEPRECATION")
2 |
3 | package com.airbnb.epoxy
4 |
5 | import kotlin.Suppress
6 | import kotlin.Unit
7 |
8 | public inline
9 | fun ModelCollector.testManyTypesView(modelInitializer: TestManyTypesViewModelBuilder.() -> Unit):
10 | Unit {
11 | add(
12 | TestManyTypesViewModel_().apply {
13 | modelInitializer()
14 | }
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ViewProcessorTest/testManyTypes/ksp/EpoxyModelViewProcessorKotlinExtensions.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("DEPRECATION")
2 |
3 | package com.airbnb.epoxy
4 |
5 | import kotlin.Suppress
6 | import kotlin.Unit
7 |
8 | public inline
9 | fun ModelCollector.testManyTypesView(modelInitializer: TestManyTypesViewModelBuilder.() -> Unit):
10 | Unit {
11 | add(
12 | TestManyTypesViewModel_().apply {
13 | modelInitializer()
14 | }
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/ViewProcessorTest/wildcardHandling/SourceView.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | import android.content.Context
4 | import android.view.View
5 | import android.view.View.OnClickListener
6 |
7 | @ModelView(
8 | autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT,
9 | baseModelClass = AirEpoxyModel::class
10 | )
11 | class SourceView(context: Context) : View(context) {
12 |
13 | @CallbackProp
14 | fun setKeyedListener(listener: KeyedListener<*, OnClickListener>?) {}
15 |
16 | }
17 |
18 | data class KeyedListener(val identifier: Key, val listener: Listener)
19 |
--------------------------------------------------------------------------------
/epoxy-processortest/src/test/resources/testModelWithHolderGeneratesNewHolderMethod/AbstractModelWithHolder.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy
2 |
3 | import android.view.View
4 |
5 | @EpoxyModelClass
6 | abstract class AbstractModelWithHolder : EpoxyModelWithHolder() {
7 | @EpoxyAttribute
8 | var value = 0
9 |
10 | override fun getDefaultLayout(): Int {
11 | return 0
12 | }
13 | }
14 |
15 | class Holder : EpoxyHolder() {
16 | override fun bindView(itemView: View) {}
17 | }
18 |
--------------------------------------------------------------------------------
/epoxy-processortest2/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-processortest2/README.md:
--------------------------------------------------------------------------------
1 | This module only exists to test that models that are subclassed in a different module still inherit
2 | their superclasses attributes correctly.
--------------------------------------------------------------------------------
/epoxy-processortest2/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 |
5 | defaultConfig {
6 | minSdkVersion rootProject.MIN_SDK_VERSION
7 | compileSdk rootProject.COMPILE_SDK_VERSION
8 | targetSdkVersion rootProject.TARGET_SDK_VERSION
9 | }
10 |
11 | compileOptions {
12 | sourceCompatibility JavaVersion.VERSION_1_8
13 | targetCompatibility JavaVersion.VERSION_1_8
14 | }
15 | }
16 |
17 | dependencies {
18 | implementation project(':epoxy-adapter')
19 | implementation project(':epoxy-annotations')
20 | }
21 |
--------------------------------------------------------------------------------
/epoxy-processortest2/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/epoxy-processortest2/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Epoxy Processor Test 2
3 |
4 |
--------------------------------------------------------------------------------
/epoxy-sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/epoxy-sample/epoxy_sample_app.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-sample/epoxy_sample_app.gif
--------------------------------------------------------------------------------
/epoxy-sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/eli_hart/tools/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/epoxy-sample/sample_touch.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/epoxy-sample/sample_touch.gif
--------------------------------------------------------------------------------
/epoxy-sample/src/main/java/com/airbnb/epoxy/sample/EpoxyConfig.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.sample;
2 |
3 | import com.airbnb.epoxy.EpoxyDataBindingLayouts;
4 | import com.airbnb.epoxy.PackageModelViewConfig;
5 |
6 | @PackageModelViewConfig(rClass = R.class)
7 | @EpoxyDataBindingLayouts(R.layout.button)
8 | interface EpoxyConfig {}
9 |
10 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/java/com/airbnb/epoxy/sample/models/BaseView.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.sample.models;
2 |
3 | import android.content.Context;
4 |
5 | import com.airbnb.epoxy.ModelProp;
6 | import com.airbnb.epoxy.ModelView;
7 |
8 | import androidx.appcompat.widget.AppCompatTextView;
9 |
10 | @ModelView
11 | public abstract class BaseView extends AppCompatTextView {
12 |
13 | public BaseView(Context context) {
14 | super(context);
15 | }
16 |
17 | @ModelProp
18 | public void setVerticalPadding(CharSequence tex) {
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/java/com/airbnb/epoxy/sample/models/SimpleAnimatorListener.java:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.sample.models;
2 |
3 | import android.animation.Animator;
4 | import android.animation.Animator.AnimatorListener;
5 |
6 | public class SimpleAnimatorListener implements AnimatorListener {
7 | @Override
8 | public void onAnimationStart(Animator animation) {
9 |
10 | }
11 |
12 | @Override
13 | public void onAnimationEnd(Animator animation) {
14 |
15 | }
16 |
17 | @Override
18 | public void onAnimationCancel(Animator animation) {
19 |
20 | }
21 |
22 | @Override
23 | public void onAnimationRepeat(Animator animation) {
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/java/com/airbnb/epoxy/sample/models/TestModel1.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.sample.models
2 |
3 | import android.view.View
4 | import com.airbnb.epoxy.EpoxyAttribute
5 | import com.airbnb.epoxy.EpoxyModel
6 | import com.airbnb.epoxy.EpoxyModelClass
7 | import com.airbnb.epoxy.sample.R
8 |
9 | @EpoxyModelClass(layout = R.layout.model_color)
10 | abstract class TestModel1 : EpoxyModel() {
11 |
12 | @EpoxyAttribute var num: Int = 0
13 | @EpoxyAttribute var num2: Int = 0
14 | @EpoxyAttribute var num3: Int = 0
15 | @EpoxyAttribute var num4: Int = 0
16 | @EpoxyAttribute var num5: Int = 0
17 | }
18 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/java/com/airbnb/epoxy/sample/models/TestModel2.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.sample.models
2 |
3 | import android.view.View
4 | import com.airbnb.epoxy.EpoxyAttribute
5 | import com.airbnb.epoxy.EpoxyModel
6 | import com.airbnb.epoxy.EpoxyModelClass
7 | import com.airbnb.epoxy.sample.R
8 |
9 | @EpoxyModelClass(layout = R.layout.model_color)
10 | abstract class TestModel2 : EpoxyModel() {
11 |
12 | @EpoxyAttribute
13 | var num: Int = 0
14 | @EpoxyAttribute
15 | var num2: Int = 0
16 | @EpoxyAttribute
17 | var num3: Int = 0
18 | @EpoxyAttribute
19 | var num4: Int = 0
20 | @EpoxyAttribute
21 | var num5: Int = 0
22 | }
23 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/java/com/airbnb/epoxy/sample/models/TestModel3.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.sample.models
2 |
3 | import android.view.View
4 | import com.airbnb.epoxy.EpoxyAttribute
5 | import com.airbnb.epoxy.EpoxyModel
6 | import com.airbnb.epoxy.EpoxyModelClass
7 | import com.airbnb.epoxy.sample.R
8 |
9 | @EpoxyModelClass(layout = R.layout.model_color)
10 | abstract class TestModel3 : EpoxyModel() {
11 |
12 | @EpoxyAttribute
13 | var num: Int = 0
14 | @EpoxyAttribute
15 | var num2: Int = 0
16 | @EpoxyAttribute
17 | var num3: Int = 0
18 | @EpoxyAttribute
19 | var num4: Int = 0
20 | @EpoxyAttribute
21 | var num5: Int = 0
22 | }
23 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/java/com/airbnb/epoxy/sample/models/TestModel4.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.sample.models
2 |
3 | import android.view.View
4 | import com.airbnb.epoxy.EpoxyAttribute
5 | import com.airbnb.epoxy.EpoxyModel
6 | import com.airbnb.epoxy.EpoxyModelClass
7 | import com.airbnb.epoxy.sample.R
8 |
9 | @EpoxyModelClass(layout = R.layout.model_color)
10 | abstract class TestModel4 : EpoxyModel() {
11 |
12 | @EpoxyAttribute
13 | var num: Int = 0
14 | @EpoxyAttribute
15 | var num2: Int = 0
16 | @EpoxyAttribute
17 | var num3: Int = 0
18 | @EpoxyAttribute
19 | var num4: Int = 0
20 | @EpoxyAttribute
21 | var num5: Int = 0
22 | }
23 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/java/com/airbnb/epoxy/sample/models/TestModel5.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.sample.models
2 |
3 | import android.view.View
4 | import com.airbnb.epoxy.EpoxyAttribute
5 | import com.airbnb.epoxy.EpoxyModel
6 | import com.airbnb.epoxy.EpoxyModelClass
7 | import com.airbnb.epoxy.sample.R
8 |
9 | @EpoxyModelClass(layout = R.layout.model_color)
10 | abstract class TestModel5 : EpoxyModel() {
11 |
12 | @EpoxyAttribute
13 | var num: Int = 0
14 | @EpoxyAttribute
15 | var num2: Int = 0
16 | @EpoxyAttribute
17 | var num3: Int = 0
18 | @EpoxyAttribute
19 | var num4: Int = 0
20 | @EpoxyAttribute
21 | var num5: Int = 0
22 | }
23 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/java/com/airbnb/epoxy/sample/models/TestModel6.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.sample.models
2 |
3 | import android.view.View
4 | import com.airbnb.epoxy.EpoxyAttribute
5 | import com.airbnb.epoxy.EpoxyModel
6 | import com.airbnb.epoxy.EpoxyModelClass
7 | import com.airbnb.epoxy.sample.R
8 |
9 | @EpoxyModelClass(layout = R.layout.model_color)
10 | abstract class TestModel6 : EpoxyModel() {
11 |
12 | @EpoxyAttribute
13 | var num: Int = 0
14 | @EpoxyAttribute
15 | var num2: Int = 0
16 | @EpoxyAttribute
17 | var num3: Int = 0
18 | @EpoxyAttribute
19 | var num4: Int = 0
20 | @EpoxyAttribute
21 | var num5: Int = 0
22 | }
23 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/java/com/airbnb/epoxy/sample/models/TestModel7.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.sample.models
2 |
3 | import android.view.View
4 | import com.airbnb.epoxy.EpoxyAttribute
5 | import com.airbnb.epoxy.EpoxyModel
6 | import com.airbnb.epoxy.EpoxyModelClass
7 | import com.airbnb.epoxy.sample.R
8 |
9 | @EpoxyModelClass(layout = R.layout.model_color)
10 | abstract class TestModel7 : EpoxyModel() {
11 |
12 | @EpoxyAttribute
13 | var num: Int = 0
14 | @EpoxyAttribute
15 | var num2: Int = 0
16 | @EpoxyAttribute
17 | var num3: Int = 0
18 | @EpoxyAttribute
19 | var num4: Int = 0
20 | @EpoxyAttribute
21 | var num5: Int = 0
22 | }
23 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/res/drawable/ic_add_circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
10 |
14 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/res/drawable/ic_change.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
16 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/res/drawable/ic_delete.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
13 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/res/layout/button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
12 |
13 |
14 |
20 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/res/layout/model_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/res/layout/model_image_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/res/layout/number_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/epoxy-sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Epoxy Sample
3 | Epoxy
4 | Composing views with ease
5 | Add
6 | Clear
7 | Shuffle
8 | Change
9 |
10 |
--------------------------------------------------------------------------------
/epoxy-viewbinder/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/epoxy-viewbinder/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=Epoxy View Binder Support
2 | POM_ARTIFACT_ID=epoxy-viewbinder
3 | POM_PACKAGING=jar
--------------------------------------------------------------------------------
/epoxy-viewbinder/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/epoxy-viewbinder/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/epoxy-viewbinder/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/kotlinsample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/kotlinsample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/java/com/airbnb/epoxy/kotlinsample/EpoxyDataBindingPatterns.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.kotlinsample
2 |
3 | import com.airbnb.epoxy.EpoxyDataBindingPattern
4 |
5 | @EpoxyDataBindingPattern(rClass = R::class, layoutPrefix = "epoxy_layout")
6 | object EpoxyDataBindingPatterns
7 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/java/com/airbnb/epoxy/kotlinsample/models/ColoredSquareView.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.kotlinsample.models
2 |
3 | import android.content.Context
4 | import android.graphics.Color
5 | import android.util.AttributeSet
6 | import android.view.View
7 | import androidx.annotation.ColorInt
8 | import com.airbnb.epoxy.ModelProp
9 | import com.airbnb.epoxy.ModelView
10 | import com.airbnb.epoxy.kotlinsample.R
11 |
12 | @ModelView(defaultLayout = R.layout.colored_square_view)
13 | class ColoredSquareView @JvmOverloads constructor(
14 | context: Context,
15 | attrs: AttributeSet? = null,
16 | defStyleAttr: Int = 0
17 | ) : View(context, attrs, defStyleAttr) {
18 |
19 | @JvmOverloads
20 | @ModelProp
21 | fun color(@ColorInt color: Int = Color.RED) {
22 | setBackgroundColor(color)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/java/com/airbnb/epoxy/kotlinsample/models/DecoratedLinearGroupModel.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.kotlinsample.models
2 |
3 | import com.airbnb.epoxy.EpoxyModelClass
4 | import com.airbnb.epoxy.GroupModel
5 | import com.airbnb.epoxy.kotlinsample.R
6 |
7 | @EpoxyModelClass
8 | abstract class DecoratedLinearGroupModel : GroupModel(R.layout.decorated_linear_group)
9 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/java/com/airbnb/epoxy/kotlinsample/models/ItemDataClass.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.kotlinsample.models
2 |
3 | import android.widget.TextView
4 | import com.airbnb.epoxy.kotlinsample.R
5 | import com.airbnb.epoxy.kotlinsample.helpers.KotlinModel
6 |
7 | // This does not require annotations or annotation processing.
8 | // The data class is required to generated equals/hashcode which Epoxy needs for diffing.
9 | // Views are easily declared via property delegates
10 | data class ItemDataClass(
11 | val title: String
12 | ) : KotlinModel(R.layout.data_class_item) {
13 |
14 | val titleView by bind(R.id.title)
15 |
16 | override fun bind() {
17 | titleView.text = title
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/java/com/airbnb/epoxy/kotlinsample/models/ItemViewBindingDataClass.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.kotlinsample.models
2 |
3 | import com.airbnb.epoxy.kotlinsample.R
4 | import com.airbnb.epoxy.kotlinsample.databinding.DataClassViewBindingItemBinding
5 | import com.airbnb.epoxy.kotlinsample.helpers.ViewBindingKotlinModel
6 |
7 | // This does not require annotations or annotation processing.
8 | // The data class is required to generated equals/hashcode which Epoxy needs for diffing.
9 | // Views are easily declared via property delegates
10 | data class ItemViewBindingDataClass(
11 | val title: String
12 | ) : ViewBindingKotlinModel(R.layout.data_class_view_binding_item) {
13 | override fun DataClassViewBindingItemBinding.bind() {
14 | title.text = this@ItemViewBindingDataClass.title
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/java/com/airbnb/epoxy/kotlinsample/views/CarouselNoSnap.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.kotlinsample.views
2 |
3 | import android.content.Context
4 | import com.airbnb.epoxy.Carousel
5 | import com.airbnb.epoxy.ModelView
6 | import com.airbnb.epoxy.ModelView.Size
7 |
8 | @ModelView(saveViewState = true, autoLayout = Size.MATCH_WIDTH_WRAP_HEIGHT)
9 | class CarouselNoSnap(context: Context) : Carousel(context) {
10 |
11 | override fun getSnapHelperFactory(): Nothing? = null
12 | }
13 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/layout/activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
16 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/layout/carousel_custom_view_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/layout/colored_square_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/layout/custom_view_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/layout/data_class_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/layout/data_class_view_binding_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/layout/decorated_linear_group.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/layout/sticky_view_holder_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/layout/vertical_linear_group.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/layout/view_binding_holder_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/layout/view_holder_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/kotlinsample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/kotlinsample/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/kotlinsample/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/kotlinsample/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/kotlinsample/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/kotlinsample/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/kotlinsample/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/kotlinsample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/kotlinsample/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/kotlinsample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Kotlin Sample
3 |
4 |
--------------------------------------------------------------------------------
/kotlinsample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/kotlinsample/src/test/java/com/airbnb/epoxy/kotlinsample/ConstructorWithLambdaModel.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.kotlinsample
2 |
3 | import android.view.View
4 | import com.airbnb.epoxy.EpoxyHolder
5 | import com.airbnb.epoxy.EpoxyModelClass
6 | import com.airbnb.epoxy.EpoxyModelWithHolder
7 |
8 | @EpoxyModelClass(layout = R.layout.activity)
9 | abstract class KotlinConstructorSample(val listener: (someBool: Boolean, anotherInt: Int) -> Unit) :
10 | EpoxyModelWithHolder()
11 |
12 | class KotlinConstructorHolder() : EpoxyHolder() {
13 | override fun bindView(itemView: View) {
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/kotlinsample/src/test/java/com/airbnb/epoxy/kotlinsample/ConstructorWithoutLamdaModel.kt:
--------------------------------------------------------------------------------
1 | package com.airbnb.epoxy.kotlinsample
2 |
3 | import android.view.View
4 | import com.airbnb.epoxy.EpoxyAttribute
5 | import com.airbnb.epoxy.EpoxyHolder
6 | import com.airbnb.epoxy.EpoxyModelClass
7 | import com.airbnb.epoxy.EpoxyModelWithHolder
8 |
9 | @EpoxyModelClass(layout = R.layout.activity)
10 | abstract class KotlinNonConstructorSample() :
11 | EpoxyModelWithHolder() {
12 | @EpoxyAttribute
13 | lateinit var listener: ((boolean: Boolean) -> Unit)
14 | }
15 |
16 | class KotlinNonConstructorSampleHolder : EpoxyHolder() {
17 | override fun bindView(itemView: View) {
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/libs/rt.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/libs/rt.jar
--------------------------------------------------------------------------------
/libs/tools.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/airbnb/epoxy/c0813764351e4de97b7abd0694af5dad9db848f2/libs/tools.jar
--------------------------------------------------------------------------------
/reports/profile/css/style.css:
--------------------------------------------------------------------------------
1 |
2 | div.tab td.indentPath {
3 | padding-left: 3em;
4 | }
5 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':epoxy-adapter'
2 | include ':epoxy-sample'
3 | include ':epoxy-processor'
4 | include ':epoxy-annotations'
5 | include ':epoxy-processortest'
6 | include ':epoxy-processortest2'
7 | include ':epoxy-integrationtest'
8 | include ':epoxy-databinding'
9 | include ':epoxy-paging3'
10 | include ':kotlinsample'
11 | include ':epoxy-modelfactory'
12 | include ':epoxy-modelfactorytest'
13 | include ':epoxy-glide-preloader'
14 | include ':epoxy-preloadersample'
15 | include ':epoxy-viewbinder'
16 | include ':epoxy-compose'
17 | include ':epoxy-composesample'
18 | include ':epoxy-composeinterop-maverickssample'
19 | include ':epoxy-kspsample'
20 |
--------------------------------------------------------------------------------