• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

shem8/MaterialLogin: Login view with material design

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

shem8/MaterialLogin

开源软件地址(OpenSource Url):

https://github.com/shem8/MaterialLogin

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource 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.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap