Giter VIP home page Giter VIP logo

materiallogin's Introduction

MaterialLogin

A material-designed login (and register) view

Download

Grab via Gradle:

compile 'com.github.shem8:material-login:1.3.0'

or Maven:

<dependency>
  <groupId>com.github.shem8</groupId>
  <artifactId>material-login</artifactId>
  <version>1.3.0</version>
</dependency>

Usage

Add the LoginView to your layout

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <shem.com.materiallogin.MaterialLoginView
        android:id="@+id/login"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</FrameLayout>

Then set your MaterialLoginViewListener to the view in code to handle register and login events:

final MaterialLoginView login = (MaterialLoginView) findViewById(R.id.login);
login.setListener(new MaterialLoginViewListener() {
    @Override
    public void onRegister(TextInputLayout registerUser, TextInputLayout registerPass, TextInputLayout registerPassRep) {
        //Handle register
    }

    @Override
    public void onLogin(TextInputLayout loginUser, TextInputLayout loginPass) {
        //Handle login
    }
});

You can also fork the project and see the example app.

Cusomize

You can change the view colors by override it in you colors.xml:

    <color name="material_login_login_color">#000000</color>
    <color name="material_login_register_color">#00ff37</color>
    <color name="material_login_login_error_color">#ffbebe</color>
    <color name="material_login_register_error_color">#600002</color>

You can also change texts and the fab icon by setting LoginView attributes:

Attribute name Default value
loginTitle Login
loginHint Name
loginPasswordHint Password
loginActionText GO
loginTextColor #000000
registerTitle Register
registerHint Name
registerPasswordHint Password
registerRepeatPasswordHint Repeat Password
registerActionText NEXT
registerTextColor #000000
registerIcon

Thanks

I first saw this design by the graet Boris Borisov and thought it will be nice to make it available on Android apps.

Contact Me

Pull requests are more than welcome, I'm planning to add lots of optins to customize the view, and hope to do this soon. You can also contact me by mail: [email protected]

License

Copyright 2015 Shem Magnezi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

materiallogin's People

Contributors

stefma avatar

Watchers

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