Giter VIP home page Giter VIP logo

lotus's Introduction

Lotus

Lotus: a library for handling interaction between pages or modules in Android. Implemented based on Google Lifecycle-aware and the classic observer pattern.

Features

Observers have life-cycle attributes Observers bind lifecycle owner(Activity/Fragment) with an API. Lifecycle-aware components perform actions in response to a change in the lifecycle status of another component, such as activities and fragments.

Single Data pool Lotus uses the single data pool for dispatching data and it can handle cross-module interaction perfectly.

Notify events more efficiently Lotus only notify events to the observers which subscribe the event.

Support Mutex observer The Data with a type(DataReactType) can hold one mutex observer.

Support Annotation Write the code with @DataSubscribe annotation to your subscriber methods. The performance can be improved greatly by indexing in build time than reflection in run time.

Compatible without lifecycle Lotus provides api for observes without lifecycle.

Click for Chinese-README

Getting started

  1. Define event type in DataReactType class:
 public static final String LOGIN_SUCCESS = "type_1"
  1. Declare subscribers:
        @DataSubscribe(dataType ={DataReactType.LOGIN_SUCCESS})
        public void onLoginSuccess(Data data) { 
            //do something
            Log.e(TAG, "get data:" + data.getData());
        } 
  1. Set data:
  DataReact.set(new Data(DataReactType.LOGIN_SUCCESS).setData(userInfo));

License

Copyright (C) 2018 iQIYI.com

Lotus binaries and source code can be used according to the Apache License, Version 2.0.

lotus's People

Contributors

tomgogo 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lotus's Issues

Logo/Icon Proposal

Hi good day! Im Jibbie Eguna, a graphics designer, I would like to ask for your permission to propose a new designs of logo in your application/project. I would like to help projects in open-source .I would just like to propose new designs. Hoping for your positive response Thank You!

description typo?

lotus is a framework for [intereact] between views in Android

interaction(s)?

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.