I've done tons of searches my own for solving this situation, but didn't find anything so far, so i've made a workaround This workaround assumes that you know / can retrieve the width of your columns, and the height of your grid cell renderers (the dp size set in your layout xmls) You should insert a few more lines inside your ExpandableListAdapter s getChildView method: Override public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { ViewGroup item = getViewGroupChild(convertView, parent); GridView label = (GridView) item. FindViewById(ipvc.estg.placebook.R.id. Gridview); label.
SetAdapter(new GridAdapter(parent.getContext(), groupPosition+1)); // initialize the following variables (i've done it based on your layout // note: rowHeightDp is based on my grid_cell. Xml, that is the height i've // assigned to the items in the grid. Final int spacingDp = 10; final int colWidthDp = 50; final int rowHeightDp = 20; // convert the dp values to pixels final float COL_WIDTH = getBaseContext().getResources().
GetDisplayMetrics(). Density * colWidthDp; final float ROW_HEIGHT = getBaseContext().getResources(). GetDisplayMetrics().
Density * rowHeightDp; final float SPACING = getBaseContext().getResources(). GetDisplayMetrics(). Density * spacingDp; // calculate the column and row counts based on your display final int colCount = (int)Math.
Floor((parentView.getWidth() - (2 * SPACING)) / (COL_WIDTH + SPACING)); final int rowCount = (int)Math. Ceil((intValues.size() + 0d) / colCount); // calculate the height for the current grid final int GRID_HEIGHT = Math. Round(rowCount * (ROW_HEIGHT + SPACING)); // set the height of the current grid label.getLayoutParams().
Height = GRID_HEIGHT; return item; } With the addition above I was able to produce the following displayed layouts: and I hope it can help you as well.
I've done tons of searches my own for solving this situation, but didn't find anything so far, so i've made a workaround. This workaround assumes that you know / can retrieve the width of your columns, and the height of your grid cell renderers (the dp size set in your layout xmls). You should insert a few more lines inside your ExpandableListAdapter's getChildView method: @Override public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { ViewGroup item = getViewGroupChild(convertView, parent); GridView label = (GridView) item.
FindViewById(ipvc.estg.placebook.R.id. Gridview); label. SetAdapter(new GridAdapter(parent.getContext(), groupPosition+1)); // initialize the following variables (i've done it based on your layout // note: rowHeightDp is based on my grid_cell.
Xml, that is the height i've // assigned to the items in the grid. Final int spacingDp = 10; final int colWidthDp = 50; final int rowHeightDp = 20; // convert the dp values to pixels final float COL_WIDTH = getBaseContext().getResources(). GetDisplayMetrics().
Density * colWidthDp; final float ROW_HEIGHT = getBaseContext().getResources(). GetDisplayMetrics(). Density * rowHeightDp; final float SPACING = getBaseContext().getResources().
GetDisplayMetrics(). Density * spacingDp; // calculate the column and row counts based on your display final int colCount = (int)Math. Floor((parentView.getWidth() - (2 * SPACING)) / (COL_WIDTH + SPACING)); final int rowCount = (int)Math.
Ceil((intValues.size() + 0d) / colCount); // calculate the height for the current grid final int GRID_HEIGHT = Math. Round(rowCount * (ROW_HEIGHT + SPACING)); // set the height of the current grid label.getLayoutParams(). Height = GRID_HEIGHT; return item; } With the addition above I was able to produce the following displayed layouts: and I hope it can help you as well.
This work like a charm! Many thanks for your help :D – Zasuk Apr 21 at 12:43 You're welcome, happy coding further! ;) also +1 for the orig.
Question, let's hope others will find it useful as well – rekaszeru Apr 21 at 12:44.
GridView label = (GridView) item. // note: rowHeightDp is based on my grid_cell. // assigned to the items in the grid.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.