How can i give fromFegrees
, toDegrees
and android:color="#000000"
programmatically?
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item >
<rotate
android:fromDegrees="45"
android:toDegrees="45"
android:pivotX="-40%"
android:pivotY="87%" >
<shape
android:shape="rectangle" >
<stroke android:color="@android:color/transparent" android:width="10dp"/>
<solid
android:color="#000000" />
</shape>
</rotate>
</item>
</layer-list>
i am using this xml in background of view.
i have to create triangle programmatically. so need to create RotationDrawable programmatically.
Drag the dots to the edges of your desired photo or tap Auto. To rotate a photo 90 degrees, tap Rotate . To make minor adjustments to straighten the photo, use the dial above Rotate . To automatically straighten the photo, tap Auto.
Launch the app and tap on the "+" icon present at the bottom-right corner of the app. Now, select the "Image Gallery" of your Android device. Select an image from the gallery that you want to reverse search.
Auto rotate is a feature on smartphones and tablets that matches the screen's orientation with the device's actual orientation. It uses the gyroscope to detect if a device is used vertically or horizontally, and changes the display setting to either portrait or landscape mode accordingly.
In android, Rotate animation is used to change the appearance and behavior of the objects over a particular interval of time. The Rotate animation will provide a better look and feel for our applications.
here's a nice solution for putting a rotated drawable for an imageView:
RotateAnimation anim = new RotateAnimation(0.0f, 360.0f , Animation.RELATIVE_TO_SELF, .5f, Animation.RELATIVE_TO_SELF, .5f);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(3000);
iv.setAnimation(anim);
iv.startAnimation(anim);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With