belinwu / doorbell

Starting conditional activities for Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doorbell

Bintray

A simple library to start activities or call callbacks with condition in your Android apps.

This is an alpha library until V1.0.0 is released.

DO NOT USE THIS LIBRARY IN PRODUCTION.

Download

Doorbell is available on jCenter.

Gradle:

compile 'com.wujilin.doorbell:doorbell:0.6.2'

Tip: If Doorbell not be in External Libraries list, try Clean Project in Android Studio.

It works for me. :)

How do I use Doorbell?

Checkout the Developer Document for more details and APIs.

Start a Activity

Doorbell.with(activity)
    .start(AnotherActivity.class)
    .condition(boolean) // Optional
    .ring();

When the optional condition is passed, AnotherActivity will be launched.

Call a Callback

Doorbell.create(condition)
    .ring(OnAllowListener);

When the condition is passed, OnAllowListener.onAllow() will be called.

Ring a Door

Doorbell.ring(Door);

When the condition of the door is passed, Door.onAllow() will be called, otherwise Door.onBlock() called.

Android SDK Version

Doorbell requires a minimum SDK version of 10.

Dependencies

compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:support-annotations:25.2.0'

Release History

Checkout the CHANGELOG file.

License

The MIT License.

Copyright (c) 2015 Belin Wu.

About

Starting conditional activities for Android.

License:MIT License


Languages

Language:Java 100.0%