QuiltViewLibrary icon indicating copy to clipboard operation
QuiltViewLibrary copied to clipboard

Display a defaul Image when the image is loading

Open cloudshooterhuman opened this issue 11 years ago • 5 comments

I need to display an indication that the image is onLoading so my solution is to setImageDrawable but didn't work.

This is what i had tried :

ArrayList<ImageView> images = new ArrayList<ImageView>(); for(final Photos photo : MainApplication.getPhotos()){ ImageView image = new ImageView(getActivity()); image.setImageDrawable(getActivity().getResources().getDrawable(R.drawable.default_image)); image.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), ImageDisplayerActivity.class);
                intent.putExtra("url",photo.getUrl() );
                getActivity().startActivity(intent);
            }
        });

cloudshooterhuman avatar Sep 19 '14 11:09 cloudshooterhuman

@selmanon use instead of using setImageDrawable try using:

image.setImageResource(R.drawable.default_image);

jacobmoncur avatar Sep 19 '14 14:09 jacobmoncur

@jacobmoncur thank you for the replay but nothing changed

cloudshooterhuman avatar Sep 19 '14 14:09 cloudshooterhuman

@selmanon can you ensure that the images are being added to the QuiltView?

jacobmoncur avatar Sep 19 '14 14:09 jacobmoncur

@jacobmoncur how ? btw, this is my whole code https://gist.github.com/selmanon/18e37f68c7f97e5bc15c

cloudshooterhuman avatar Sep 19 '14 14:09 cloudshooterhuman

@jacobmoncur Yeah all my images are displayed after download but nope the default image

cloudshooterhuman avatar Sep 19 '14 14:09 cloudshooterhuman