Commit 74ce4155 authored by Daniel Wolf's avatar Daniel Wolf

Adjusted to new API

parent b808f63a
......@@ -12,6 +12,7 @@ import android.widget.TextView;
import com.frostnerd.dnschanger.R;
import com.frostnerd.dnschanger.database.DatabaseHelper;
import com.frostnerd.dnschanger.database.entities.DNSEntry;
import com.frostnerd.utils.adapters.BaseViewHolder;
import com.frostnerd.utils.adapters.DatabaseAdapter;
import com.frostnerd.utils.database.orm.statementoptions.queryoptions.OrderOption;
import com.frostnerd.utils.general.DesignUtil;
......@@ -177,7 +178,7 @@ public class DNSEntryAdapter extends DatabaseAdapter<DNSEntry, DNSEntryAdapter.V
if(wasNull) notifyDataSetChanged();
}
static class ViewHolder extends RecyclerView.ViewHolder {
static class ViewHolder extends BaseViewHolder {
private TextView textView, subText;
private ViewHolder(View itemView, int type) {
......@@ -191,6 +192,11 @@ public class DNSEntryAdapter extends DatabaseAdapter<DNSEntry, DNSEntryAdapter.V
super.finalize();
textView = subText = null;
}
@Override
protected void destroy() {
textView = subText = null;
}
}
public interface OnEntrySelected {
......
......@@ -14,6 +14,7 @@ import android.widget.TextView;
import com.frostnerd.dnschanger.R;
import com.frostnerd.dnschanger.database.DatabaseHelper;
import com.frostnerd.dnschanger.database.entities.DNSQuery;
import com.frostnerd.utils.adapters.BaseViewHolder;
import com.frostnerd.utils.adapters.DatabaseAdapter;
import com.frostnerd.utils.database.orm.parser.columns.Column;
import com.frostnerd.utils.database.orm.statementoptions.queryoptions.OrderOption;
......@@ -121,7 +122,7 @@ public class QueryLogAdapter extends DatabaseAdapter<DNSQuery, QueryLogAdapter.V
return new ViewHolder(layoutInflater.inflate(R.layout.row_query_log, parent, false));
}
static class ViewHolder extends RecyclerView.ViewHolder {
static class ViewHolder extends BaseViewHolder {
private TextView host, time;
private ViewHolder(View itemView) {
......@@ -130,6 +131,11 @@ public class QueryLogAdapter extends DatabaseAdapter<DNSQuery, QueryLogAdapter.V
host = itemView.findViewById(R.id.host);
}
@Override
protected void destroy() {
host = time = null;
}
@Override
protected void finalize() throws Throwable {
super.finalize();
......
......@@ -12,6 +12,7 @@ import android.widget.TextView;
import com.frostnerd.dnschanger.R;
import com.frostnerd.utils.adapters.BaseAdapter;
import com.frostnerd.utils.adapters.BaseViewHolder;
import com.frostnerd.utils.general.DesignUtil;
import org.xbill.DNS.DClass;
......@@ -87,7 +88,7 @@ public class QueryResultAdapter extends BaseAdapter<QueryResultAdapter.ViewHolde
return 5;
}
static class ViewHolder extends RecyclerView.ViewHolder {
static class ViewHolder extends BaseViewHolder{
private ViewHolder(int elementCount, Context context, LinearLayout itemView) {
super(itemView);
TextView text;
......@@ -96,5 +97,10 @@ public class QueryResultAdapter extends BaseAdapter<QueryResultAdapter.ViewHolde
itemView.addView(text);
}
}
@Override
protected void destroy() {
}
}
}
......@@ -15,6 +15,7 @@ import com.frostnerd.dnschanger.database.DatabaseHelper;
import com.frostnerd.dnschanger.database.entities.DNSRule;
import com.frostnerd.dnschanger.dialogs.NewRuleDialog;
import com.frostnerd.dnschanger.util.RuleImport;
import com.frostnerd.utils.adapters.BaseViewHolder;
import com.frostnerd.utils.adapters.DatabaseAdapter;
import com.frostnerd.utils.database.orm.parser.columns.Column;
import com.frostnerd.utils.database.orm.statementoptions.queryoptions.WhereCondition;
......@@ -100,7 +101,7 @@ public class RuleAdapter<T extends Activity &RuleImport.ImportStartedListener> e
return new ViewHolder(layoutInflater.inflate(R.layout.row_rule, parent, false));
}
static class ViewHolder extends RecyclerView.ViewHolder{
static class ViewHolder extends BaseViewHolder{
private TextView host, target;
private ViewHolder(View itemView) {
......@@ -109,6 +110,11 @@ public class RuleAdapter<T extends Activity &RuleImport.ImportStartedListener> e
target = itemView.findViewById(R.id.text3);
}
@Override
protected void destroy() {
host = target = null;
}
@Override
protected void finalize() throws Throwable {
super.finalize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment