GithubHelp home page GithubHelp logo

robin's Introduction

๐Ÿš€ Android login, made simple

Build Status Coverage Status

Almost every app has a login and signup, so why do we re-write code everytime? Let robin handle that for you.

login signup

Usage

Add this to your build.gradle

compile 'com.sirvar:robin:0.0.1'

Create a new activity to handle login and signup requests that extends RobinActivity

public class MainActivity extends RobinActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // DO NOT call setContentView();	

        // Set title for each screen
        setLoginTitle("Sign in to Robin");
        setSignupTitle("Welcome to Robin");
        setForgotPasswordTitle("Forgot Password");		

        // Set logo for screens
        setImage(getResources().getDrawable(R.mipmap.ic_launcher));		

        // Use custom font across all views
        setFont(Typeface.createFromAsset(getAssets(), "Montserrat-Medium.ttf"));		

        // Choose theme (default is LIGHT)
        setTheme(Theme.LIGHT);
    }
}

Configuration Options

Method Description
setLoginTitle(String title) Set the title of the login screen
setSignupTitle(String title) Set the title of the signup screen
setForgotPasswordTitle(String title) Set the title of the forgot password screen
setTheme(Theme theme) Set theme from Theme enum, options above
setImage(Drawable image) Set the Drawable image of all screens
setImage(Bitmap image) Set the Bitmap image of all screens
setFont(Typeface typeface) Set custom typeface to use across all screens
startLoginFragment() Changes the visible fragment to login
startSignupFragment() Changes the visible fragment to signup
startForgotPasswordFragment() Changes the visible fragment to forgot password
showLoginFirst() Shows login fragment on Activity launch
showSignupFirst() Shows signup fragment on Activity launch
enableSocialLogin() Displays Google and Facebook login buttons
disableSocialLogin() Hides Google and Facebook login buttons

Override Methods

onLogin(String email, String password)
onSignup(String name, String email, String password)
onForgotPassword(String email)
onGoogleLogin()
onFacebookLogin()

Contributing

Want to design a new theme for robin? Follow the same format as previously done and make a PR! Also update the README adding the new theme and give yourself credit right next to it!

robin's People

Contributors

sirvar 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

robin's Issues

Custom Login/SignUP Fields

Nice Library... It would be awesome if there's a way to add custom edittexts for login and sign up screens and retrieve there values when needed. Thanks

Getting a Null pointer exception

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.zoomcar, PID: 10890
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.zoomcar/com.android.zoomcar.LoginActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.hide()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.hide()' on a null object reference
at com.sirvar.robin.RobinActivity.onCreate(RobinActivity.java:36)
at com.android.zoomcar.LoginActivity.onCreate(LoginActivity.java:14)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)ย 
at android.app.ActivityThread.-wrap12(ActivityThread.java)ย 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)ย 
at android.os.Handler.dispatchMessage(Handler.java:102)ย 
at android.os.Looper.loop(Looper.java:154)ย 
at android.app.ActivityThread.main(ActivityThread.java:6077)ย 
at java.lang.reflect.Method.invoke(Native Method)ย 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)ย 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)ย 

java.lang.NullPointerExceptio

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.hide()' on a null object reference

NullPointerException

I imported gradle into my project, but when I try to execute app it crashes.
Logcat gives me that error "void android.support.v7.app.ActionBar.hide()' on a null object reference"
on super.onCreate(savedInstanceState);
Manifest and theme are the same of the example.

Any Suggestions ?
Thank you

error

Unable to find method 'org.gradle.api.tasks.testing.Test.getTestClassesDirs()Lorg/gradle/api/file/FileCollection;

Unable to find method 'org.gradle.api.tasks.testing.Test.getTestClassesDirs()Lorg/gradle/api/file/FileCollection;'.
Possible causes for this unexpected error include:

  • Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
    Re-download dependencies and sync project (requires network)
  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
    Stop Gradle build processes (requires restart)
  • Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

did both the bolded part but unfortunately, to no avail.

Set gravity

Hi!

I'd like to center the views in the screen. Is it possible to modify gravity?

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.