Skip to content

Commit

Permalink
Payload support.
Browse files Browse the repository at this point in the history
  • Loading branch information
hb committed May 22, 2018
1 parent 722994e commit cd473ca
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation project(':library')
/*implementation 'com.dc.easyadapter:easyadapter:1.2'*/

}
repositories {
mavenCentral()
Expand Down
Binary file added dclogo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Sat May 12 11:57:08 IST 2018
#Mon May 21 10:54:25 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
3 changes: 0 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "com.android.support:recyclerview-v7:27.1.1"
}

Expand Down
13 changes: 13 additions & 0 deletions library/src/main/java/easyadapter/dc/com/library/EasyAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ public void onCreatingHolder(@NonNull B binding, @NonNull EasyHolder holder) {

public abstract void onBind(@NonNull B binding, @NonNull M model);

public void onBind(@NonNull B binding, @NonNull M model, @NonNull List<Object> payloads) {
}


public final ArrayList<M> getData() {
return data;
Expand Down Expand Up @@ -211,6 +214,14 @@ public void onBindViewHolder(@NonNull EasyHolder holder, int position) {
}
}

@Override
public void onBindViewHolder(@NonNull EasyHolder holder, int position, @NonNull List<Object> payloads) {
super.onBindViewHolder(holder, position, payloads);
if (!holder.isLoadingView) {
onBind((B) holder.binding, data.get(position), payloads);
}
}

@Override
public int getItemCount() {
if (data == null) return 0;
Expand Down Expand Up @@ -472,4 +483,6 @@ public final void disableDataObserver() {
public final void enableDataObserver() {
data.addOnListChangedCallback(dataChangeObs);
}


}

0 comments on commit cd473ca

Please sign in to comment.