CoolView

Additional

Language
Java
Version
N/A
Created
Oct 3, 2017
Updated
May 20, 2019 (Retired)
Owner
Nadim GOUIA (nadimgouia)
Contributor
Nadim GOUIA (nadimgouia)
1
Activity
Badge
Generate
Download
Source code

CoolView

An Android Library that help you to customise views (Button, EditText, ImageView), by adding border with the size and color that you want, and give it the corner radius that you seems cool, and you can also make an imageview looks like a circle.

Gradle

compile on your dependencies


dependencies {
      compile 'com.ndroid:cool-view:1.0'
}

ScreenShot

Sample Example

Sample Module

Usage

To create a new CoolButton (its the same way for the CoolEditText)


   <com.ndroid.CoolButton
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:background="#26d64c"
            android:drawableLeft="@drawable/phone"
            android:text="Call Now"
            android:textColor="#fff"
            custom:border_color="#262626"
            custom:border_radius="20"
            custom:border_stroke="5" />

To set the border_radius, border_stroke, border_color from the activity class..


        CoolButton coolButton = (CoolButton) findViewById(R.id.coolButton);
        //custom button border ...
        // set the border color
        coolButton.setBorderColor("#FFD42626");
        // set the border radius
        coolButton.setBorderRadius(20);
        // set the border stroke
        coolButton.setBorderStroke(4);

Create a bordered Cool ImageView..


   <com.ndroid.CoolImageView
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:background="#26d64c"
            android:drawableLeft="@drawable/phone"
            android:text="Call Now"
            android:textColor="#fff"
            custom:border_color="#262626"
            custom:border_radius="20"
            custom:border_stroke="5" />

Make the CoolImageView Circle ...


   <com.ndroid.CoolImageView
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:background="#26d64c"
            android:drawableLeft="@drawable/phone"
            android:text="Call Now"
            android:textColor="#fff"
            custom:border_color="#262626"
            custom:border_stroke="5"
            custom:is_circle="true"
            />

Customize the ImageView From Activity class ...


CoolImage coolImage = (CoolImage) findViewById(R.id.coolImage);
        //custom ImageView border ...
        // set the border color
        coolImage.setBorderColor("#000000");
        // set the border radius
        coolImage.setBorderRadius(20);
        // set the border stroke
        coolImage.setBorderStroke(4);
        // make the imageview circle 
        coolImage.setCircle(true);