0

I have the following animation:

<set xmlns:android="http://schemas.android.com/apk/res/android">  
<translate android:fromYDelta="100%" android:toYDelta="0%" android:duration="1000" />
<translate android:fromXDelta="80%" android:toXDelta="0%" android:duration="1000" />
</set>

I use this to animate a new view to is showing up. This animation run from bottom to top and from right to left, but the animation is like rectangle. And i wana make it to be like a triangle

In other words i want the two points (X and Y) that makes the animation to be linked by a straight line.

1 Answers1

0

(Not enough rep to comment)

Is it important for it to be clickable as a triangle? What I mean is, couldn't you just load on the view a triangle-like Drawable image(there are many free icon packs around or you can create your own as .png)?

This way you SEE the triangle, while as an object is just a rectangle with a texture of a triangle. (As I don't think there is any implementation in AndroidSDK of a TriangularView, but I might be wrong!).

Another way is to use a shape drawable resource.

An easy example is how it was done by Sanket Kachhela in this post

https://stackoverflow.com/a/22043386/4482734

You could take it as a starting point.

Then again, much of this post was based on the idea you needed to interact with the Triangle, but I could be wrong and it has no meaning to do so.

Community
  • 1
  • 1
FrancescoC
  • 1,058
  • 10
  • 19