Code example for View

Methods: findViewById, setPadding

0
 
        public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
                ViewGroup parent) {
            if (convertView == null) {
                convertView = View.inflate(mParent, android.R.layout.simple_list_item_1, null);
                convertView.setPadding(70, 0, 0, 0);
            } 
            TextView textView = (TextView)convertView.findViewById(android.R.id.text1);
            textView.setText(getGroup(groupPosition).label.toString());
            return convertView;
        } 
 
        public boolean isChildSelectable(int groupPosition, int childPosition) {
            return true; 
        } 
 
        public boolean hasStableIds() { 
            return true; 
        } 
 
    }