Thursday, 28 December 2017

ImageView Shape


Step 1:

You have to do first :


compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'


Shape 1:   Bubble ImageView
<com.github.siyamed.shapeimageview.BubbleImageView
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:src="@drawable/neo"
    app:siArrowPosition="right"
    app:siSquare="false"/>


Shape 2:   Rounded ImageView
<com.github.siyamed.shapeimageview.RoundedImageView
    android:layout_width="200dp"
    android:layout_height="200dp"    android:src="@drawable/neo"
    app:siRadius="6dp"
    app:siBorderWidth="6dp"
    app:siBorderColor="@color/darkgray"
    app:siSquare="false"/>


Shape 3:   Circle ImageView
<com.github.siyamed.shapeimageview.CircularImageView
    android:layout_width="200dp"    android:layout_height="200dp"    android:src="@drawable/neo"
    app:siBorderWidth="6dp"
    app:siBorderColor="@color/darkgray"/>


Shape 4:   Diamond ImageView
<com.github.siyamed.shapeimageview.DiamondImageView
    android:layout_width="200dp"    android:layout_height="200dp"    android:layout_margin="8dp"
    android:src="@drawable/neo"
    app:siBorderWidth="8dp"
    app:siBorderColor="@color/darkgray"/>


Shape 5:   Pentagon ImageView
<com.github.siyamed.shapeimageview.PentagonImageView
android:layout_width="200dp" android:layout_height="200dp" android:src="@drawable/neo" app:siArrowPosition="right" app:siSquare="false"/>


Shape 6:   Xexagon ImageView
<com.github.siyamed.shapeimageview.HexagonImageView
    android:layout_width="200dp"    android:layout_height="200dp"    android:src="@drawable/neo"
    app:siArrowPosition="right"
    app:siSquare="false"/>


Shape 7:   Octogon ImageView
<com.github.siyamed.shapeimageview.OctogonImageView
    android:layout_width="200dp"    android:layout_height="200dp"    android:src="@drawable/neo"
    app:siArrowPosition="right"
    app:siSquare="false"/>


Shape 8:   Star ImageView
<com.github.siyamed.shapeimageview.StarImageView
    android:layout_width="200dp"    android:layout_height="200dp"    android:src="@drawable/neo"
    app:siArrowPosition="right"
    app:siSquare="false"/>


Shape 9:  Heart  ImageView
<com.github.siyamed.shapeimageview.HeartImageView
    android:layout_width="200dp"    android:layout_height="200dp"    android:src="@drawable/neo"
    app:siArrowPosition="right"
    app:siSquare="false"/>


Shape 10:   Star ImageView
<com.github.siyamed.shapeimageview.mask.PorterShapeImageView
    android:layout_width="200dp"    android:layout_height="200dp"    app:siShape="@drawable/star"
    android:src="@drawable/neo"
    app:siSquare="false"/>
Shape 11:   PorterShape ImageView
<com.github.siyamed.shapeimageview.mask.PorterShapeImageView
    android:layout_width="200dp"    android:layout_height="200dp"    app:siShape="@drawable/shape_rounded_rectangle"
    android:src="@drawable/neo"
    app:siSquare="false"/>
res/drawable/ shape_rounded_rectangle.xml
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
    <corners
        android:topLeftRadius="18dp"
        android:topRightRadius="18dp"
        android:bottomLeftRadius="18dp"
        android:bottomRightRadius="18dp" />
    <solid android:color="@color/black" />
</shape>

No comments:

Post a Comment

HOW TO CREATE CIRCLE IMAGE VIEW

Step 1: implementation 'de.hdodenhof:circleimageview:3.0.0' Step 2: <de.hdodenhof.circleimageview.CircleImageView xmlns:ap...