You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have written an expandable adapter but my childitems aren't showed. Only my groupitem is shown.
I debugged everything and my childs are there in my groupitem.
Created by senne on 04/03/2016.
*/
public class ExpandableListViewAdapter extends BaseExpandableListAdapter {
private static final String PICASSO_BASEURL = "http://wildfly-teamiip2kdgbe.rhcloud.com/";
private final LayoutInflater inflater;
private List items;
public ExpandableListViewAdapter(Context context){
inflater = LayoutInflater.from(context);
}
public void setData(List items){
this.items = items;
}
@OverRide
public ChildItem getChild(int groupPosition, int childPosition) {
return items.get(groupPosition).getChildren().get(childPosition);
}
I have written an expandable adapter but my childitems aren't showed. Only my groupitem is shown.
I debugged everything and my childs are there in my groupitem.
`package com.projects.wens.kandoeteami.organisation.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.projects.wens.kandoeteami.R;
import com.projects.wens.kandoeteami.organisation.data.ChildHolder;
import com.projects.wens.kandoeteami.organisation.data.ChildItem;
import com.projects.wens.kandoeteami.organisation.data.GroupHolder;
import com.projects.wens.kandoeteami.organisation.data.GroupItem;
import java.util.List;
/**
Created by senne on 04/03/2016.
*/
public class ExpandableListViewAdapter extends BaseExpandableListAdapter {
private static final String PICASSO_BASEURL = "http://wildfly-teamiip2kdgbe.rhcloud.com/";
private final LayoutInflater inflater;
private List items;
public ExpandableListViewAdapter(Context context){
inflater = LayoutInflater.from(context);
}
public void setData(List items){
this.items = items;
}
@OverRide
public ChildItem getChild(int groupPosition, int childPosition) {
return items.get(groupPosition).getChildren().get(childPosition);
}
@OverRide
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
GroupHolder holder;
GroupItem item = getGroup(groupPosition);
if (convertView == null){
holder = new GroupHolder();
convertView = inflater.inflate(R.layout.expandable_list_group, parent, false);
holder.title = (TextView) convertView.findViewById(R.id.expandable_title);
convertView.setTag(holder);
} else {
holder = (GroupHolder) convertView.getTag();
}
holder.title.setText(item.getTitle());
return convertView;
}
@OverRide
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
ChildHolder holder;
ChildItem item = getChild(groupPosition, childPosition);
TextView viewVoornaam;
TextView viewActernaam;
TextView viewOrganisator;
if (convertView == null){
holder = new ChildHolder();
convertView = (RelativeLayout)inflater.inflate(R.layout.expandable_list_item, parent, false);
}
}
@OverRide
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
@OverRide
public int getGroupCount() {
return items.size();
}
@OverRide
public int getChildrenCount(int groupPosition) {
return items.get(groupPosition).children.size();
}
@OverRide
public GroupItem getGroup(int groupPosition) {
return items.get(groupPosition);
}
@OverRide
public long getGroupId(int groupPosition) {
return groupPosition;
}
@OverRide
public boolean hasStableIds() {
return false;
}
@OverRide
public boolean isChildSelectable(int groupPosition, int childPosition) {
return false;
}
}
`
The text was updated successfully, but these errors were encountered: