Coder Social home page Coder Social logo

morristech / coolview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nadimgouia/coolview

0.0 1.0 0.0 422 KB

An Android Library that help you to customize 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.

Java 100.00%

coolview's Introduction

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);
        

coolview's People

Contributors

nadimgouia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.