Expandable List GroupView's Arrow needs to be aligned with text not centered in View

yesu

New Member
I currently have defined a \[code\]ExpandableListView\[/code\] that will allow my second \[code\]GroupView\[/code\] list to contain a title above it. However This does not look appealing to the user because the flow of the expansion arrow is not aligned with the text but rather in the center of the view. Does anyone have any subquestions on what I could do to make this look more appealing? I need to have a header after the second group.
9lRGU.png
This code is what sets up my \[code\]GroupView\[/code\] in my custom adapter.\[code\]public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { TextView groupTitle = null; LayoutInflater layoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = null; if(groupPosition == 1){ v = layoutInflater.inflate(R.layout.custom_first_major_language_group_row, null); } else { v = layoutInflater.inflate(R.layout.custom_language_group_row, null); } groupTitle = (TextView) v.findViewById(R.id.text_element); String myText = this.getGroup(groupPosition).toString(); groupTitle.setText(myText); return v;}\[/code\]custom_language_group_row.xml\[code\]<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/text_element" android:layout_width="fill_parent" android:layout_height="48dip" android:textSize="20sp" android:textColor="#fff" android:layout_marginLeft="48dip" android:gravity="center_vertical" android:text = "Language Group Name"/></RelativeLayout>\[/code\]custom_first_major_language_group_row.xml\[code\]<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:textAppearance="?android:attr/textAppearanceMedium" android:text="Major Languages" android:textColor="#000" android:background="#fff" android:id="@+id/majorLanguageTitle" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_centerHorizontal="true"></TextView> <TextView android:id="@+id/text_element" android:layout_width="fill_parent" android:layout_height="48dip" android:textSize="20sp" android:textColor="#fff" android:layout_marginLeft="48dip" android:gravity="center_vertical" android:layout_below="@+id/majorLanguageTitle" android:text = "Language Group Name"/></RelativeLayout>\[/code\]If you have any ideas of how I can get the drop down arrow to align with the text it would be much appreciated.
 
Back
Top