0

I want to create a message Row with corners like this: Image1

But i Can't understand the meaning of (fromDegree,toDegree,pivotX,pivotY) in my code below to achieve it

here is an image of what i've searched for and found but can't fix: Image2

My drawable code:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

        <item android:start="10dp">
            <shape android:shape="rectangle"  >

                <corners android:bottomLeftRadius="10dip" android:bottomRightRadius="10dip" android:topRightRadius="10dip" />
                <solid android:color="@color/white"/>
            </shape>
        </item>

    <item android:bottom="0dp"
        android:top="0dp"
        android:gravity="start">
        <rotate
            android:fromDegrees="45"
            android:toDegrees="45"
            android:pivotX="135%"
            android:pivotY="15%">
         <shape android:shape="rectangle">
         <solid android:color="@color/white"/>
             <size android:height="10dp"
                 android:width="10dp"/>

         </shape>
        </rotate>
    </item>
</layer-list>

thanks in advance.

nick isra
  • 99
  • 1
  • 9

1 Answers1

0

From Answer on Stackoverflow

Pivot is the point around which it rotates (like putting a pin in a photo). If your 'from' and 'to' pivots aren't the same then you are not just rotating around a set point, you're rotating a bit, then changing the pins location and rotating a bit more for each step (causing a skew).

  • i searched everywhere, still i don't understand , i don't need an animation i just need it to be shaped like a triangle on the top left corner – nick isra Oct 16 '19 at 13:00