From 07846abd7fe99677096298868997502a85570093 Mon Sep 17 00:00:00 2001 From: neurospeech Date: Tue, 6 Sep 2016 16:47:01 +0530 Subject: [PATCH] Added reference to Adapter in HyperViewHolder --- .idea/misc.xml | 2 +- hypercube/build.gradle | 4 ++-- .../com/neurospeech/hypercube/ui/AppArrayAdapter.java | 2 +- .../com/neurospeech/hypercube/ui/HeaderedAdapter.java | 2 +- .../com/neurospeech/hypercube/ui/HyperViewHolder.java | 8 +++++++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 5d19981..fbb6828 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/hypercube/build.gradle b/hypercube/build.gradle index e957e33..0e60dcc 100644 --- a/hypercube/build.gradle +++ b/hypercube/build.gradle @@ -25,8 +25,8 @@ android { defaultConfig { minSdkVersion 15 targetSdkVersion 23 - versionCode 1414 - versionName "1.4.14" + versionCode 1415 + versionName "1.4.15" } buildTypes { release { diff --git a/hypercube/src/main/java/com/neurospeech/hypercube/ui/AppArrayAdapter.java b/hypercube/src/main/java/com/neurospeech/hypercube/ui/AppArrayAdapter.java index 6b76ed7..f1b481b 100644 --- a/hypercube/src/main/java/com/neurospeech/hypercube/ui/AppArrayAdapter.java +++ b/hypercube/src/main/java/com/neurospeech/hypercube/ui/AppArrayAdapter.java @@ -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); } } diff --git a/hypercube/src/main/java/com/neurospeech/hypercube/ui/HeaderedAdapter.java b/hypercube/src/main/java/com/neurospeech/hypercube/ui/HeaderedAdapter.java index 82996c5..68ec0e9 100644 --- a/hypercube/src/main/java/com/neurospeech/hypercube/ui/HeaderedAdapter.java +++ b/hypercube/src/main/java/com/neurospeech/hypercube/ui/HeaderedAdapter.java @@ -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); } } diff --git a/hypercube/src/main/java/com/neurospeech/hypercube/ui/HyperViewHolder.java b/hypercube/src/main/java/com/neurospeech/hypercube/ui/HyperViewHolder.java index efcf926..9bc0cec 100644 --- a/hypercube/src/main/java/com/neurospeech/hypercube/ui/HyperViewHolder.java +++ b/hypercube/src/main/java/com/neurospeech/hypercube/ui/HyperViewHolder.java @@ -9,12 +9,18 @@ public abstract class HyperViewHolder 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); }