package com.zatackcoder.viewholderpatternwithbaseadapter;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        List<Item> items = new ArrayList<>();
        Random random = new Random();
        for(int i = 1; i <= 2000; i++) {
            items.add(new Item("Item " + i, random.nextInt(1000)));
        }

        ListView listView = findViewById(R.id.list_view);
        listView.setAdapter(new MyBaseAdapter(this, items));
    }
}
