ActionBarSherlock
ActionBarSherlock copied to clipboard
Text does not wrap in navigation list dropdown item
I use custom navigation list dropdown item layout. However text is wrapper correcly in API 16, but not in API 10. See screenshots attached below.
I use the following dropdown item layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@android:id/text1"
style="?attr/spinnerDropDownItemStyle"
android:layout_width="match_parent"
android:layout_height="?attr/dropdownListPreferredItemHeight" />
</LinearLayout>
And my ArrayAdapter looks as following:
private class DropdownItemAdapter extends ArrayAdapter<String> implements SpinnerAdapter {
Activity activity;
private String[] labels = new String[] {"short1", "Very Very Longlonglong Longlonglong text text it sure is."};
public DropdownItemAdapter(Activity activity) {
super(activity, R.layout.sherlock_spinner_item, new String[] {"short1", "Very Very Longlonglong Longlonglong text text it sure is."});
this.activity = activity;
}
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.sample_spinner_dropdown_item, null);
TextView title = ((TextView) convertView.findViewById(android.R.id.text1));
title.setText(labels[position]);
return convertView;
}
}
Is this a bug or am I using layout or adapter in a wrong way?
How does it look on ICS?
On API 15 text also wraps.
Add a sample to the known-bugs project in the dev branch
Specifying width of layout_weight resulted in the same result. Will add sample to known-bugs project,
Pull request submitted.
Same thing for actionbar items, at least on split actionbar. Splitactionbar also clips on API10.