I am rotating a FrameLayout which contains an Imageview with image.When I add another Imageview on that rotated FrameLayout than the added imageview also get rotates by default as usual.
To prevent this as I need the added ImageView not to be rotated,I rotate that ImageView at the reverse angle from FrameLayout.
I am rotating FrameLayout using below code:
(1)Rotate:
float angle = mainFrm.getRotation();
if (angle == 0) {
angle = 360;
}
angle = angle - 90;
mainFrm.setRotation(angle);
(2)Flip Vertical
float angle = mainFrm.getRotationX();
if (angle == 0) {
angle = 360;
}
angle = angle - 180;
mainFrm.setRotationX(angle);
(3)Flip Horizontal
float angle = mainFrm.getRotationY();
if (angle == 0) {
angle = 360;
}
angle = angle - 180;
mainFrm.setRotationY(angle);
I am rotating ImageView using following code:
if(mainFrm.getRotation()!=0)
{
iv.setRotation(-(mainFrm.getRotation()));
}
if(mainFrm.getRotationX()!=0)
{
iv.setRotationX(-(mainFrm.getRotationX()));
}
if(mainFrm.getRotationY()!=0)
{
iv.setRotationY(-(mainFrm.getRotationY()));
}
Now the issue I am facing is when I first rotate frame(270 degree),then flip it vertically(180 degree) and after add an ImageView to that rotated frame it rotates the ImageView as well.
Here I am attaching images as well. This is the issue
I need solution like this
Any help/suggestions will be highly appreciated.
Thanks in advance