Giter Club home page Giter Club logo

materiallogin's Introduction

MaterialLogin

A material-designed login (and register) view

Download

Grab via Gradle:

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

or Maven:

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

You should also add CircularReveal lib for 2.3 support- first add remote maven url

    repositories {
        maven {
            url "https://jitpack.io"
        }
    }

then add a library dependency

    dependencies {
        compile ('com.github.ozodrukh:CircularReveal:2.0.1@aar') {
            transitive = true;
        }
    }

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);
((DefaultLoginView)login.getLoginView()).setListener(new DefaultLoginView.DefaultLoginViewListener() {
    @Override
    public void onLogin(TextInputLayout loginUser, TextInputLayout loginPass) {
        //Handle login
    }
});

((DefaultRegisterView)login.getRegisterView()).setListener(new DefaultRegisterView.DefaultRegisterViewListener() {
    @Override
    public void onRegister(TextInputLayout registerUser, TextInputLayout registerPass, TextInputLayout registerPassRep) {
        //Handle register
    }
});

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

Customize

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 customize the view by setting views attributes:

For the MaterialLoginView:

Attribute name Default value
registerIcon
registerEnabled true
loginView DefaultLoginView
registerView DefaultRegisterView

For the DefaultLoginView:

Attribute name Default value
loginTitle Login
loginHint Name
loginPasswordHint Password
loginActionText GO
loginTextColor #000000

For the DefaultRegisterView:

Attribute name Default value
registerTitle Register
registerHint Name
registerPasswordHint Password
registerRepeatPasswordHint Repeat Password
registerActionText NEXT
registerTextColor #000000

Thanks

I first saw this design by the great 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 options 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

pinicius-vitale avatar sdghasemi avatar stefma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

materiallogin's Issues

sorry

i can not add the dependency to my project.
The Android Studio tells me Failed to resolve: com.github.shem8:material-login:2.2.0

where is "io.codetail.animation.SupportAnimator"

The login effect that you make is very brilliant. I like it very much!
but here is a problem for me:
I imported this lib into my workspace by eclipse.
but I can't find "io.codetail.animation.SupportAnimator" and "io.codetail.animation.ViewAnimationUtils".
could you tell me where this lib is?
much thanks in advance.

can't find supportAnimator for sure.

I had imported the lib circularReveal to my workspace by eclipse .

your lib need SupportAnimator.
but there is no SupportAnimator in package “io.codetail.animation”

it confuse me a lot .

could you tell me where I can find this class “SupportAnimator”
thanks in advance .

Colors in attrs.xml too

I'm very confused why the colors are handled over the colors.xml file instead like the texts via the attributes file?

We can set it up like this too:

    <declare-styleable name="MaterialLoginView">
        <attr name="loginTitle" format="string" />
        <attr name="loginHint" format="string" />
        <attr name="loginPasswordHint" format="string" />
        <attr name="loginActionText" format="string" />
        <attr name="loginTextColor" format="reference" />

        <attr name="registerTitle" format="string" />
        <attr name="registerHint" format="string" />
        <attr name="registerPasswordHint" format="string" />
        <attr name="registerRepeatPasswordHint" format="string" />
        <attr name="registerActionText" format="string" />
        <attr name="registerTextColor" format="reference" />
        <attr name="registerIcon" format="reference" />
    </declare-styleable>

and use it like

        app:loginTextColor="@color/material_login_register_color"

Any opinion not to do this?

Cannot register twice successively

i got this message error when i try to register twice successively :

java.lang.NullPointerException: Attempt to invoke interface method 'void shem.com.materiallogin.DefaultRegisterView$DefaultRegisterViewListener.onRegister(android.support.design.widget.TextInputLayout, android.support.design.widget.TextInputLayout, android.support.design.widget.TextInputLayout)' on a null object reference at shem.com.materiallogin.DefaultRegisterView$1.onClick(DefaultRegisterView.java:67) at android.view.View.performClick(View.java:4780) at android.view.View$PerformClick.run(View.java:19866) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

change Language to Farsi or arabic

when i change string text to my language after run all of theme delete and auto change to en

how can change language to arabic or farsi ?

hide register option

What if I only require a login and not a register option
Is there any way to hide the "+" ?

Register Button Not working

I added

dependencies {
	    implementation ('com.github.ozodrukh:CircularReveal:2.0.1@aar') {
	        transitive = true;
	    }
	}

and when I Clicked Register Button
App was crashed


java.lang.NoSuchMethodError: No static method createCircularReveal(Landroid/view/View;IIFF)Lio/codetail/animation/SupportAnimator; in class Lio/codetail/animation/ViewAnimationUtils; or its super classes (declaration of 'io.codetail.animation.ViewAnimationUtils' appears in /data/app/com.dreamwalker.diabetesfits-1/split_lib_dependencies_apk.apk)
        at shem.com.materiallogin.MaterialLoginView.getCircularRevealAnimation(MaterialLoginView.java:189)
        at shem.com.materiallogin.MaterialLoginView.access$400(MaterialLoginView.java:40)
        at shem.com.materiallogin.MaterialLoginView$3.onAnimationStart(MaterialLoginView.java:156)
        at android.view.animation.Animation$1.run(Animation.java:367)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6776)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)

Library is not optimized for RTL layouts

First of all thanks for the great library. The problem is when I try using RTL layouts, registration fab locates on the upper-left corner of dialog as expected but after clicking it animates to its bottom-left direction which is the behavior for the LTR layouts, instead of bottom-right. It also happens for the reveal effect which incorrectly starts from the right half of dialog. And also the "Register" dialog title has left gravity.
What can I do?

Cannot getText! NullPointerException

Hi Dear Developer,

Whenever I want to test that I enter an incorrect username or password app always crashes. getText is not working for me for the time being. Can you please help me solve?

Attached are screenshots demonstrate this situation. Soonest reply is highly appreciated.

screen shot 2017-05-06 at 15 51 07
screen shot 2017-05-06 at 15 51 15

separate listener for login and register buttons

Provide with a suitable on click listener for login and register buttons instead of view listener as a whole. That will provide us with more control over functioning of the application. Because the basic task for the login form is to communicate with the server that requires lot of back end processing when the user has to validated from the server scripts. Fix it asap.

Support for minSDKVersion=19

Is it worthwhile to consider adding support for pre-lollipop devices? Targeting API-19 get's you 36.1% more device coverage.

Log

When I use this, it keeps logging

03-07 16:35:19.831 15058-15058/com.dante.diary I/AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
03-07 16:35:19.835 15058-15058/com.dante.diary I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.

Name convention

Actually we have two different names.
MaterialLogin and LoginView.

  • This repo is called MaterialLogin
  • The view is called LoginView
  • The Theme called MaterialLoginTheme
  • The attributes called MaterialLoginView
  • The colors called MaterialLogin*Color

only for a few.

I think it would be great if we have on Name for all. MaterialLogin OR LoginView then the ressources above look like

  • This repo is called MaterialLogin
  • The view is called MaterialLoginView
  • The Theme called MaterialLoginTheme
  • The attributes called MaterialLogin
  • The colors called MaterialLogin*Color

OR

  • This repo is called LoginView
  • The view is called LoginView
  • The Theme called LoginViewTheme
  • The attributes called LoginView
  • The colors called LoginView*Color

I preffer the first one because 👍

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.