MaterialLogin


Source link: https://github.com/shem8/MaterialLogin

MaterialLogin

A material-designed login (and register) view

Download

Grab via Gradle:

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

or Maven:

<dependency>
<groupId>com.github.shem8</groupId>
<artifactId>material-login</artifactId>
<version>2.1.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:1.3.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. 

Resources

A custom time picker library for Android.

This is quite simple toast library, that make it easier to show and create custom toast.

Custom EditTextView to show/hide password with customizable icon.

Cube grid animation for Android.

Simple Google Cloud Messaging (GCM) integration library for Android.

Adding migrations in Android for databases is tricky and involves a lot a human effort. There is huge scope for human error and screwed up migrations. Poirot aims to fix that by attempting to automatically generating migrations where it can, and by forcing certain practices upon the user.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes