Skip to content

Commit

Permalink
Added reference to Adapter in HyperViewHolder
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Sep 6, 2016
1 parent 6521d1c commit 07846ab
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions hypercube/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1414
versionName "1.4.14"
versionCode 1415
versionName "1.4.15"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public void onBindViewHolder(VH holder, int position) {

protected void onBind(VH holder, T item) {
if(holder instanceof HyperViewHolder){
((HyperViewHolder)holder).bindItem(item);
((HyperViewHolder)holder).bindItem(this,item);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {

protected void onBind(VH holder, T item) {
if (holder instanceof HyperViewHolder) {
((HyperViewHolder) holder).bindItem(item);
((HyperViewHolder) holder).bindItem(this,item);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@
public abstract class HyperViewHolder<T> extends RecyclerView.ViewHolder {


public RecyclerView.Adapter getAdapter() {
return adapter;
}

private RecyclerView.Adapter adapter;

public HyperViewHolder(View itemView) {
super(itemView);
}

public void bindItem(Object item){
public void bindItem(RecyclerView.Adapter adapter, Object item){
this.adapter = adapter;
bind((T)item);
}

Expand Down

0 comments on commit 07846ab

Please sign in to comment.