I have a ListView that has a custom ArrayAdapter with a custom XML row.
I am passing in objects and everything words fine. However, I want to repeat each row 5 times within the ArrayAdapter. In the adapter, I would like to make minor adjustments to each and the current setup it isn’t feasible to make adjustments prior to passing in to the adapter.
Is it possible to do this? I can’t seem to conjure up the correct search terms to find any hints.
There are two ways i know:
1. Add repeated items to the dataset multiple times. Since you are referencing to the same object it is pretty cheap.
f.e. if you have Foo object with 2 repetitions and Bar with no repetitions getCount should return (2 + 1) + 1. You also probably would like to count that values in the constructor or maybe when the data set changes to speed up ui a litle bit.