Skip to content

Commit

Permalink
4.2.0 release (#1085)
Browse files Browse the repository at this point in the history
* Update to kotlin 1.4.20 and remove kotlin android extensions

* Release 4.2.0
  • Loading branch information
elihart authored Nov 11, 2020
1 parent 3905f50 commit e647d96
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 69 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 4.2.0 (Nov 11, 2020)
- Add notify model changed method (#1063)
- Update to Kotlin 1.4.20-RC and remove dependency on kotlin-android-extensions

# 4.1.0 (Sept 17, 2020)
- Fix some synchronization issues with the parallel Epoxy processing option
- Add view visibility checks to EpoxyVisibilityItem and decouple RecyclerView #1052
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {

ext.KOTLIN_VERSION = "1.4.10"
ext.ANDROID_PLUGIN_VERSION = '4.0.1'
ext.KOTLIN_VERSION = "1.4.20-RC"
ext.ANDROID_PLUGIN_VERSION = '4.1.1'

repositories {
google()
Expand Down
5 changes: 1 addition & 4 deletions epoxy-adapter/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-parcelize'
apply plugin: "com.vanniktech.maven.publish"

android {
Expand All @@ -13,9 +13,6 @@ android {
consumerProguardFiles 'proguard-rules.pro'
}

androidExtensions {
experimental = true
}
testOptions.unitTests.includeAndroidResources = true

buildTypes.all { buildType ->
Expand Down
5 changes: 4 additions & 1 deletion epoxy-preloadersample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion rootProject.COMPILE_SDK_VERSION
Expand All @@ -16,6 +15,10 @@ android {

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildFeatures {
viewBinding true
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import android.content.Intent
import android.os.AsyncTask
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.airbnb.epoxy.preloadersample.databinding.ActivityMainBinding
import com.bumptech.glide.Glide
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

Expand Down Expand Up @@ -34,7 +34,8 @@ class MainActivity : AppCompatActivity() {
@SuppressLint("StaticFieldLeak")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

// Memory and disk cache is cleared to give accurate representation of load times
Glide.get(this).clearMemory()
Expand All @@ -45,14 +46,14 @@ class MainActivity : AppCompatActivity() {
}
}.execute()

button_no_preload.setOnClickListener {
binding.buttonNoPreload.setOnClickListener {
val intent = Intent(this, NoPreloadActivity::class.java)
intent.putExtra(IMAGES_LIST_TAG, images)

startActivity(intent)
}

button_preload.setOnClickListener {
binding.buttonPreload.setOnClickListener {
val intent = Intent(this, PreloadActivity::class.java)
intent.putExtra(IMAGES_LIST_TAG, images)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.airbnb.epoxy.preloadersample

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.list_activity.*
import com.airbnb.epoxy.preloadersample.databinding.ListActivityBinding

class NoPreloadActivity : AppCompatActivity() {

Expand All @@ -11,10 +11,13 @@ class NoPreloadActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.list_activity)
val binding = ListActivityBinding.inflate(layoutInflater)
setContentView(binding.root)

recycler_view.setHasFixedSize(true)
recycler_view.setController(controller)
binding.recyclerView.apply {
setController(controller)
setHasFixedSize(true)
}

controller.setFilterDuplicates(true)
controller.setData(images)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.airbnb.epoxy.addGlidePreloader
import com.airbnb.epoxy.glidePreloader
import com.airbnb.epoxy.preloadersample.databinding.ListActivityBinding
import com.bumptech.glide.Glide
import com.bumptech.glide.RequestBuilder
import com.bumptech.glide.RequestManager
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.bumptech.glide.request.RequestOptions
import com.bumptech.glide.signature.ObjectKey
import kotlinx.android.synthetic.main.list_activity.recycler_view

class PreloadActivity : AppCompatActivity() {

Expand All @@ -20,15 +20,17 @@ class PreloadActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.list_activity)
val binding = ListActivityBinding.inflate(layoutInflater)
setContentView(binding.root)

recycler_view.setHasFixedSize(true)
recycler_view.setController(controller)
val recyclerView = binding.recyclerView
recyclerView.setHasFixedSize(true)
recyclerView.setController(controller)

controller.setFilterDuplicates(true)
controller.setData(images)

recycler_view.addGlidePreloader(
recyclerView.addGlidePreloader(
Glide.with(this),
preloader = glidePreloader { requestManager, model: ImageModel_, _ ->
requestManager.loadImage(model.imageUrl, true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,47 +103,4 @@ public void testSimpleModelNoValidation() {
.and()
.generatesSources(generatedModel);
}

@Test
public void testFullyGeneratedModel() {
JavaFileObject packageInfo = JavaFileObjects
.forResource(GuavaPatch.patchResource("DataBindingConfig.java"));

JavaFileObject binding = JavaFileObjects
.forResource(GuavaPatch.patchResource("ModelWithDataBindingBinding.java"));

JavaFileObject generatedModel =
JavaFileObjects.forResource(GuavaPatch.patchResource("ModelWithDataBindingBindingModel_.java"));

assert_().about(javaSources())
.that(asList(packageInfo, binding, BR_CLASS, R))
.processedWith(processors())
.compilesWithoutError()
.and()
.generatesSources(generatedModel);
}

@Test
public void testFullyGeneratedModelWithoutDoNotHash() {
JavaFileObject packageInfo = JavaFileObjects
.forSourceString("EpoxyDataBindingConfig.java",
"package com.airbnb.epoxy;\n"
+ "@EpoxyDataBindingLayouts(value = {R.layout"
+ ".model_with_data_binding_without_donothash}, enableDoNotHash = false)\n"
+ "interface EpoxyDataBindingConfig {} "
);

JavaFileObject binding = JavaFileObjects
.forResource(GuavaPatch.patchResource("ModelWithDataBindingWithoutDonothashBinding.java"));

JavaFileObject generatedModel =
JavaFileObjects.forResource(GuavaPatch.patchResource("ModelWithDataBindingWithoutDonothashBindingModel_.java"));

assert_().about(javaSources())
.that(asList(packageInfo, binding, BR_CLASS, R))
.processedWith(processors())
.compilesWithoutError()
.and()
.generatesSources(generatedModel);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import java.lang.String;

/**
* Generated file. Do not modify! */
* Generated file. Do not modify!
*/
public class ModelWithDataBindingBindingModel_ extends DataBindingEpoxyModel implements GeneratedModel<DataBindingEpoxyModel.DataBindingHolder>, ModelWithDataBindingBindingModelBuilder {
private OnModelBoundListener<ModelWithDataBindingBindingModel_, DataBindingEpoxyModel.DataBindingHolder> onModelBoundListener_epoxyGeneratedModel;

Expand Down Expand Up @@ -49,7 +50,8 @@ public void handlePostBind(final DataBindingEpoxyModel.DataBindingHolder object,
* The listener will contribute to this model's hashCode state per the {@link
* com.airbnb.epoxy.EpoxyAttribute.Option#DoNotHash} rules.
* <p>
* You may clear the listener by setting a null value, or by calling {@link #reset()} */
* You may clear the listener by setting a null value, or by calling {@link #reset()}
*/
public ModelWithDataBindingBindingModel_ onBind(
OnModelBoundListener<ModelWithDataBindingBindingModel_, DataBindingEpoxyModel.DataBindingHolder> listener) {
onMutation();
Expand All @@ -71,7 +73,8 @@ public void unbind(DataBindingEpoxyModel.DataBindingHolder object) {
* The listener will contribute to this model's hashCode state per the {@link
* com.airbnb.epoxy.EpoxyAttribute.Option#DoNotHash} rules.
* <p>
* You may clear the listener by setting a null value, or by calling {@link #reset()} */
* You may clear the listener by setting a null value, or by calling {@link #reset()}
*/
public ModelWithDataBindingBindingModel_ onUnbind(
OnModelUnboundListener<ModelWithDataBindingBindingModel_, DataBindingEpoxyModel.DataBindingHolder> listener) {
onMutation();
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=4.1.0
VERSION_NAME=4.2.0
GROUP=com.airbnb.android
POM_DESCRIPTION=Epoxy is a system for composing complex screens with a ReyclerView in Android.
POM_URL=https://github.com/airbnb/epoxy
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 0 additions & 1 deletion kotlinsample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

android {

Expand Down

0 comments on commit e647d96

Please sign in to comment.