How to Add Image of a Parseuser Arraylist to a Parseobject Adapter

Asked

Viewed 130 times

1

Well, I’m trying to add a user image to my Listview for when publishing an item it puche the user image of the Parse in the Imageview, but I can’t because ArrayAdapter of Fragment where is the Listview is of ParseObject, and the image of ParseUser.

Follows the Adapter where I need to list images

package com.parse.starter.adapter;

public class OfertasAdapter extends ArrayAdapter {
    private Context context;
    private ArrayList publicacoes;
    private ArrayList recuperaDescricao;
    private ArrayList recuperaPrecoAtual;
    private ArrayList recuperaPrecoAntigo;

    public OfertasAdapter(Context c, ArrayList objects) {
        super(c, 0, objects);
        this.context = c;
        this.publicacoes = objects;
        this.recuperaDescricao = objects;
        this.recuperaPrecoAtual = objects;
        this.recuperaPrecoAntigo = objects;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = convertView;

        if (view == null) {

            //Inicializa objeto para montagem do layout
            LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);

            //Monta a view a partir do xml
            view = inflater.inflate(R.layout.lista_publicacoes, parent, false);
        }
            //Verifica se existe postagens
            if (publicacoes.size() > 0) {

                //Recupera componentes da tela
                ImageView imagemPostagem = (ImageView) view.findViewById(R.id.image_lista_publicacoes);
                TextView descricao = (TextView) view.findViewById(R.id.descricaoId);
                TextView precoAtual = (TextView) view.findViewById(R.id.precoAtualId);
                TextView precoAntigo = (TextView) view.findViewById(R.id.precoAntigoId);

                ParseObject parseObject = publicacoes.get(position);
                ParseObject parseObject1 = recuperaDescricao.get(position);
                ParseObject parseObject2 = recuperaPrecoAtual.get(position);
                ParseObject parseObject3 = recuperaPrecoAntigo.get(position);

                Picasso.with(context)
                .load( parseObject.getParseFile( "imagem" ).getUrl() )
                .fit()
                .into( imagemPostagem );

                /**Exibe o texto do Parse no Textview!!!*/

                descricao.setText(parseObject1.get("Nome").toString());

                precoAtual.setText(parseObject2.getString("precoatual"));

                precoAntigo.setText(parseObject3.getString("precoAntigo"));


            }


            return view;
        }

}

I need to place the images of Parseuser in the Picasso but as said this Adapter only works with ParseObjects. Anything else that’s missing to clarify the question let me know, hug.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.