Rockin
Rockin

Reputation: 743

Hide groupIndicator of expandable listview based on listview positions

<ExpandableListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:groupIndicator="@drawable/group_indicator"
android:background="#ffffff"
/>

I have used an expandable list view with group Indicator... if in list view fourth position, there is no child for a group ...then it should not show the indicator in fourth position ...how to go with it

Upvotes: 2

Views: 2166

Answers (3)

grine4ka
grine4ka

Reputation: 2928

Try to set android:groupIndicator attribute of ExpandableListView a null value or transparent color. Something like android:groupIndicator="@android:color/transparent"

Upvotes: 2

Vineet Shukla
Vineet Shukla

Reputation: 24031

try like this:

public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
            ViewGroup parent) {
            convertView = newGroupView(isExpanded, parent);

            ImageView inidicatorImage = (ImageView) convertView.findViewById(R.id.explist_indicator);

            if( groupPosition == 4 ) {
                inidicatorImage .setVisibility( View.INVISIBLE );
            } else {
                inidicatorImage .setVisibility( View.VISIBLE );
            }


        return convertView;
    }

Upvotes: 1

Vineet Shukla
Vineet Shukla

Reputation: 24031

In yourAdapter -> getGroupView() set the visibility of the indicator image to invisible...

I did this thru custom adapter and setting my own indicator image....

Upvotes: 0

Related Questions