I have to create the Layout (in xml or in java) as like Below image :

But it should be repeated as per the Condition.
Suppose, if the Arraylist.size() is more then 2 then the whole layout should be repeated as such time.
is it possible?
if yes then let me know how it is possible.
I want to create such layout in verticle direction of the linear layout.
Thanks.
Edited:
with jin35 answer i have done like this:
private void doCalculationForMultipleEmployee() {
singleEmployee.setVisibility(View.GONE);
for (int i = 0; i<=tempEmployerList.size()-1; i++) {
View repeatedLayout = LayoutInflater.from(getApplicationContext()).inflate(R.layout.test);
((TextView)repeatedLayout.findViewById(R.id.list_title)).setText("Employee"+i);
// customize repeatedLayout with other data
myLinearLayout.addChild(repeatedLayout);
}
}
But i got syntex error at .inflate and at .addChild
Please help me for that.
Whats wrong with that ?
You should create xml file with
LinearLayoutand another xml with you “repeating” layout. Then in code for every part of data just use this: