The setIndicatorBounds(int left, int right) is used to set the indicator bounds for the group view of an expandable list view.
DisplayMetrics metrics; int width; ExpandableListView expList;
metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); width = metrics.widthPixels;//this code for adjusting the group indicator intoright side of the viewexpList.setIndicatorBounds(width - GetDipsFromPixel(50), width - GetDipsFromPixel(10)); expList.setAdapter(new ExpAdapter(this));public int GetDipsFromPixel(float pixels) { // Get the screen's density scale final float scale = getResources().getDisplayMetrics().density; // Convert the dps to pixels, based on density scale return (int) (pixels * scale + 0.5f); }
This comment has been removed by a blog administrator.
ReplyDelete