-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3542440
commit 71147d3
Showing
26 changed files
with
153 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ | |
/build | ||
/captures | ||
.externalNativeBuild | ||
|
||
fastadapter/publish.gradle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/aizuzi/adapter/demo/viewholder/BaseViewHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.aizuzi.adapter.demo.viewholder; | ||
|
||
import android.view.View; | ||
import butterknife.ButterKnife; | ||
import com.zuzi.adapter.FastViewHolder; | ||
|
||
/** | ||
* @author liyi | ||
* create at 2018/4/28 | ||
**/ | ||
public abstract class BaseViewHolder<T> extends FastViewHolder<T> { | ||
|
||
public BaseViewHolder(View itemView) { | ||
super(itemView); | ||
} | ||
|
||
@Override protected void onCreate() { | ||
super.onCreate(); | ||
ButterKnife.bind(this, itemView); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 10 additions & 6 deletions
16
app/src/main/java/com/aizuzi/adapter/demo/viewholder/TextViewHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,31 @@ | ||
package com.aizuzi.adapter.demo.viewholder; | ||
|
||
import android.view.View; | ||
import android.widget.TextView; | ||
import com.aizuzi.adapter.FastBaseViewHolder; | ||
import com.aizuzi.adapter.demo.R; | ||
import com.zuzi.adapter.FastViewHolder; | ||
import com.zuzi.adapter.RecyclerItemLayoutId; | ||
|
||
/** | ||
* @author liyi | ||
* create at 2018/4/26 | ||
**/ | ||
public class TextViewHolder extends FastBaseViewHolder<String> { | ||
@RecyclerItemLayoutId(R.layout.item_text) | ||
public class TextViewHolder extends BaseViewHolder<String> { | ||
|
||
private TextView mTextView; | ||
|
||
public TextViewHolder(View itemView) { | ||
super(itemView); | ||
} | ||
|
||
@Override protected void onCreate() { | ||
super.onCreate(); | ||
mTextView = (TextView) findViewById(R.id.text_view); | ||
mTextView = findViewById(R.id.text_view); | ||
} | ||
|
||
@Override public void refreshItem(String bean) { | ||
mTextView.setText(bean); | ||
} | ||
|
||
@Override public int getLayoutId() { | ||
return R.layout.item_text; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
fastadapter/src/main/java/com/zuzi/adapter/FastViewHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.zuzi.adapter; | ||
|
||
import android.support.v7.widget.RecyclerView; | ||
import android.view.View; | ||
|
||
/** | ||
* @author liyi | ||
* create at 2018/4/25 | ||
**/ | ||
public abstract class FastViewHolder<T> extends RecyclerView.ViewHolder{ | ||
|
||
public FastViewHolder(View itemView) { | ||
super(itemView); | ||
} | ||
|
||
protected void onCreate(){ | ||
|
||
} | ||
|
||
public <T extends View> T findViewById(int id) { | ||
return itemView.findViewById(id); | ||
} | ||
|
||
public abstract void refreshItem(T bean); | ||
} |
2 changes: 1 addition & 1 deletion
2
...a/com/aizuzi/adapter/MultiItemEntity.java → ...ava/com/zuzi/adapter/MultiItemEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.aizuzi.adapter; | ||
package com.zuzi.adapter; | ||
|
||
/** | ||
* @author liyi | ||
|
Oops, something went wrong.