@@ -0,0 +1,2198 @@
+package com.nestedworld.nestedworld.ui.fight.battle;%0A%0Aimport android.content.Context;%0Aimport android.support.annotation.NonNull;%0Aimport android.support.v4.content.ContextCompat;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.ArrayAdapter;%0Aimport android.widget.ImageView;%0Aimport android.widget.TextView;%0A%0Aimport com.bumptech.glide.Glide;%0Aimport com.nestedworld.nestedworld.R;%0Aimport com.nestedworld.nestedworld.database.models.Monster;%0A%0Aimport java.util.List;%0A%0Apublic class BattleMonsterAdapter extends ArrayAdapter%3CMonster%3E %7B%0A%0A    /*%0A    ** Constructor%0A     */%0A    public BattleMonsterAdapter(@NonNull final Context context, @NonNull final List%3CMonster%3E objects) %7B%0A        super(context, R.layout.item_fight_monster, objects);%0A    %7D%0A%0A    /*%0A    ** Life cycle%0A     */%0A    @NonNull%0A    @Override%0A    public View getView(int position, View convertView, @NonNull ViewGroup parent) %7B%0A%0A        View view = convertView;%0A%0A        //Check if and existing view is being reused, otherwise inflate the view%0A        if (view == null) %7B%0A            view = LayoutInflater.from(getContext()).inflate(R.layout.item_fight_monster, parent, false);%0A        %7D%0A%0A        //Get selectedMonster%0A        Monster monster = getItem(position);%0A        if (monster == null) %7B%0A            return view;%0A        %7D%0A%0A        populateView(view, monster);%0A%0A        return view;%0A    %7D%0A%0A    /*%0A    ** Internal method%0A     */%0A    private void populateView(@NonNull final View view, @NonNull final Monster monster) %7B%0A        //Populate name & lvl%0A        ((TextView) view.findViewById(R.id.textview_monster_name)).setText(monster.name);%0A%0A        //Display monster picture%0A        final ImageView imageViewMonster = (ImageView) view.findViewById(R.id.imageView_monster);%0A        Glide.with(getContext())%0A                .load(monster.sprite)%0A                .placeholder(R.drawable.default_monster)%0A                .centerCrop()%0A                .into(imageViewMonster);%0A%0A        //Add color shape around monster picture%0A        view.findViewById(R.id.imageView_monster_shape).setBackgroundColor(ContextCompat.getColor(getContext(), monster.getColorResource()));%0A    %7D%0A%0A%7D%0A

add monster adapter for fight