Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
fbsum committed Jan 4, 2018
1 parent c3e9da4 commit 0c9e896
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
24 changes: 24 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,27 @@ dependencies {
testCompile 'junit:junit:4.12'
provided 'com.android.support:recyclerview-v7:26.1.0'
}

// 打包源码jar
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}

// 打包文档jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ public final RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent) {

protected abstract RecyclerView.ViewHolder onCreateViewHolder(LayoutInflater layoutInflater, ViewGroup parent);

protected abstract void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder,
protected abstract void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh,
@NonNull T item,
@NonNull List<Object> payloads);

protected void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) {
protected void onViewRecycled(@NonNull RecyclerView.ViewHolder vh) {
}

protected boolean onFailedToRecycleView(@NonNull RecyclerView.ViewHolder holder) {
protected boolean onFailedToRecycleView(@NonNull RecyclerView.ViewHolder vh) {
return false;
}

protected void onViewAttachedToWindow(@NonNull RecyclerView.ViewHolder holder) {
protected void onViewAttachedToWindow(@NonNull RecyclerView.ViewHolder vh) {
}

protected void onViewDetachedFromWindow(RecyclerView.ViewHolder holder) {
protected void onViewDetachedFromWindow(RecyclerView.ViewHolder vh) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,32 +54,32 @@ public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType
}

@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
delegatesManager.onBindViewHolder(holder, items.get(position), null);
public void onBindViewHolder(RecyclerView.ViewHolder vh, int position) {
delegatesManager.onBindViewHolder(vh, items.get(position), null);
}

@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List<Object> payloads) {
delegatesManager.onBindViewHolder(holder, items.get(position), payloads);
public void onBindViewHolder(RecyclerView.ViewHolder vh, int position, List<Object> payloads) {
delegatesManager.onBindViewHolder(vh, items.get(position), payloads);
}

@Override
public void onViewRecycled(RecyclerView.ViewHolder holder) {
delegatesManager.onViewRecycled(holder);
public void onViewRecycled(RecyclerView.ViewHolder vh) {
delegatesManager.onViewRecycled(vh);
}

@Override
public boolean onFailedToRecycleView(RecyclerView.ViewHolder holder) {
return delegatesManager.onFailedToRecycleView(holder);
public boolean onFailedToRecycleView(RecyclerView.ViewHolder vh) {
return delegatesManager.onFailedToRecycleView(vh);
}

@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
delegatesManager.onViewAttachedToWindow(holder);
public void onViewAttachedToWindow(RecyclerView.ViewHolder vh) {
delegatesManager.onViewAttachedToWindow(vh);
}

@Override
public void onViewDetachedFromWindow(RecyclerView.ViewHolder holder) {
delegatesManager.onViewDetachedFromWindow(holder);
public void onViewDetachedFromWindow(RecyclerView.ViewHolder vh) {
delegatesManager.onViewDetachedFromWindow(vh);
}
}

0 comments on commit 0c9e896

Please sign in to comment.