Giter Site home page Giter Site logo

loginbuttons's Introduction

LoginButtons

Android Arsenal Download

A simple library for building beautiful login buttons

Screenshot

Gradle

Add this in your dependencies block

compile 'com.shaishavgandhi:login-buttons:0.1.1'

Basic Usage

Google Plus Login Button

<com.shaishavgandhi.loginbuttons.GooglePlusButton
        android:layout_width="match_parent"
        android:textAlignment="center"
        app:iconSize="30dp"
        android:text="Sign in with Google"
        android:layout_height="wrap_content"
        />

Facebook Login Button

<com.shaishavgandhi.loginbuttons.FacebookButton
        android:layout_width="match_parent"
        android:text="Sign in with Facebook"
        app:iconSize="30dp"
        android:layout_height="wrap_content"
        />

Twitter Login Button

<com.shaishavgandhi.loginbuttons.TwitterButton
        android:layout_width="match_parent"
        app:iconSize="30dp"
        android:text="Sign in with Twitter"
        android:layout_height="wrap_content"
        />

LinkedIn Login Button

<com.shaishavgandhi.loginbuttons.LinkedInButton
        android:layout_width="match_parent"
        app:iconSize="30dp"
        android:text="Sign in with LinkedIn"
        android:layout_height="wrap_content"
        />

Custom Properties

Every button has the following custom properties :

  • app:iconSize="30dp" value in dp
  • app:iconPadding="30dp" value in dp
  • app:iconCenterAligned="true/false" icon center aligned by default. Set value false to set icon on left as shown here
  • app:roundedCorner="true/false Whether to set rounded corners. Default false
  • app:roundedCornerRadius="30dp" value in dp
  • app:transparentBackground="true/fasle Sets background to transparent and border to the color of the appropriate social media color. Examples here and here

Mix and match

The libary gives a fair amount of freedom and using several permutations and combinations to make a button of your choice.

A popular example are circular buttons, like FAB for login. Using the properties you can make a circular button like this :

<com.shaishavgandhi.loginbuttons.GooglePlusButton
        android:layout_width="75dp"
        app:roundedCorner="true"
        app:iconSize="30dp"
        app:roundedCornerRadius="75dp"
        android:layout_height="75dp"
        />

In the above example, enabling roundedCorner and setting the width, height and roundedCornerRadius to the same value enables a circular button. Image here

Another example is of rounded corner buttons :

<com.shaishavgandhi.loginbuttons.GooglePlusButton
        android:layout_width="match_parent"
        android:textAlignment="center"
        app:roundedCorner="true"
        app:iconCenterAligned="false"
        app:iconSize="30dp"
        android:text="Sign in with Google"
        android:layout_height="wrap_content"
        />

Above code uses various properties to get a rounded corner button, with icon on the left. See here

Examples

<com.shaishavgandhi.loginbuttons.GooglePlusButton
      android:layout_width="75dp"
      app:iconSize="30dp"
      android:layout_height="75dp"
      />
<com.shaishavgandhi.loginbuttons.GooglePlusButton
      android:layout_width="75dp"
      app:transparentBackground="true"
      app:iconSize="30dp"
      android:layout_height="75dp"
      />
<com.shaishavgandhi.loginbuttons.LinkedInButton
      android:layout_width="75dp"
      app:roundedCorner="true"
      app:transparentBackground="true"
      app:roundedCornerRadius="75dp"
      app:iconSize="30dp"
      android:layout_height="75dp"
      />

Contributing

All contributions are welcome and much appreciated! Steps for contributing :

  • Fork this repo
  • Clone to your work station for a local copy
  • Create a new branch by git checkout -b branch_name_here
  • Make your awesome changes and contributions
  • Push to your forked repo
  • Make pull request

License

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

loginbuttons's People

Contributors

shaishavgandhi avatar ravidsrk avatar

Watchers

James Cloos avatar Kitty 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.