Android: changing image rotation inside Recyclerview

Viewed 100

I have an recyclerView that displays images from firebase, for some reason some of these images were rotated when uploaded to firenase.

so i would like to knew how to rotate images inside the recycler.

this is part of my code that changes orientation, but the problem is thath it only works for first item inside the recyclerview and nothing else??? so any solution.

rotateRight.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                holder.itemView.setRotation(holder.itemView.getRotation() + 90);
            }
        });

        rotateLeft.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                holder.itemView.setRotation(holder.itemView.getRotation() + 180);
            }
        });
1 Answers

I solved it by making the rotate button inside the layout of the adapter, rather than it was inside the activity itself. now it workes well but i can't make the width after rotation to take entire screen height

Related