Friday, December 1, 2017

TriangleLabelView

TriangleLabelView:

               In android, Normally we have use textview to show the text in the activity,but now TriangleLabelView is used to show the label in the any one of the corner in the layout, That is top left corner, top right corner likewise bottom left corner and bottom right corner. It show very differently and programmer easily implement using following ways.

Step 1:

Download the TriangleLabelView.java file from here
 Download TriangleLabelView.java

Step 2:
Place the Java File in your Package then Goto xml file


<com.androidvedha.external.TriangleLabelView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    app:backgroundColor="@color/yellow_900"
    app:corner="leftTop"
    app:labelBottomPadding="5dp"
    app:labelCenterPadding="0dp"
    app:labelTopPadding="10dp"
    app:primaryText="New"
    app:primaryTextColor="@color/yellow_500"
    app:primaryTextSize="16sp"
    app:secondaryText="01"
    app:secondaryTextColor="@color/yellow_100"
    app:secondaryTextSize="11sp" />


Step 3:

In onCreate() method do FindViewByID and then we can make click for the triangleLabelView using setOnClickListener method.

No comments:

Post a Comment