Very simple, I'm using list view from this tutorial and I have tried using AutoFitTextView and also AutoResizeTextView, I have made the row MATCH_PARENT for its width also height, I made the different TextViews MATCH_PARENT.
I even tried getting the screenWidth, subtracting it for the image width and making that result the width of the textView and then making it resize, and still doesn't work.
Here is my getView implemented in my CustomList class:
public View getView(int position, View view, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
View rowView= inflater.inflate(R.layout.list_single, null, true);
TableRow tbrow = (TableRow) rowView.findViewById(R.id.idTableRow1);
tbrow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT,TableRow.LayoutParams.MATCH_PARENT));
ImageView imageView = (ImageView) rowView.findViewById(R.id.img);
AutoResizeTextView tv = new AutoResizeTextView(context);
((TableRow)imageView.getParent()).addView(tv);
tv.setGravity(Gravity.CENTER);
tbrow.setGravity(Gravity.CENTER);
//Fix for android 4.0.4 versions and earlier
final String DOUBLE_BYTE_SPACE = "\u3000";
String fixString = "";
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR1
&& android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
fixString = DOUBLE_BYTE_SPACE;
}
tv.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT, 1f));
tv.setText(fixString + web[position] + fixString);
imageView.setImageDrawable(imageId[position]);
if(setParameters){
imageView.setLayoutParams(params);
}
return rowView;
}
Please I'm desperate in search of this, I have looked everywhere and none helped me...
Thanks in advance.