All Projects → tmtron → green-annotations

tmtron / green-annotations

Licence: Apache-2.0 license
An Android Annotations plugin to support Green Robot.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to green-annotations

Eventbus
C# 事件总线实现
Stars: ✭ 127 (+504.76%)
Mutual labels:  eventbus
Bus
🔊Minimalist message bus implementation for internal communication
Stars: ✭ 187 (+790.48%)
Mutual labels:  eventbus
AndroidStarterAlt
A sample View-based Android app using the MVP architecture. It uses Mosby, Dagger2, RxJava, retrofit, LoganSquare, requery, EventBus, Conductor.
Stars: ✭ 27 (+28.57%)
Mutual labels:  eventbus
Router
Router —— A substitute good of EventBus similar implemented by dynamic proxy
Stars: ✭ 147 (+600%)
Mutual labels:  eventbus
Readhub
ReadHub Client 非官方客户端
Stars: ✭ 179 (+752.38%)
Mutual labels:  eventbus
Liveeventbus
📬EventBus for Android,消息总线,基于LiveData,具有生命周期感知能力,支持Sticky,支持AndroidX,支持跨进程,支持跨APP
Stars: ✭ 3,192 (+15100%)
Mutual labels:  eventbus
Rxbus2
RxJava2 based bus with queuing (e.g. lifecycle based) support
Stars: ✭ 116 (+452.38%)
Mutual labels:  eventbus
Kotlin-Annotation-Processor
Annotation Processor Sample in Kotlin
Stars: ✭ 19 (-9.52%)
Mutual labels:  annotation-processor
Messagebus
A MessageBus (CommandBus, EventBus and QueryBus) implementation in PHP7
Stars: ✭ 178 (+747.62%)
Mutual labels:  eventbus
IntroduceToEclicpseVert.x
This repository contains the code of Vert.x examples contained in my articles published on platforms such as kodcu.com, medium, dzone. How to run each example is described in its readme file.
Stars: ✭ 27 (+28.57%)
Mutual labels:  eventbus
Eventbus
A lightweight and very fast event bus / event framework for C++17
Stars: ✭ 149 (+609.52%)
Mutual labels:  eventbus
Elegantbus
🔥🔥Android 平台,基于LivaData的EventBus,无侵入,更优雅,支持跨进程,跨应用粘性事件,自定义事件等功能。
Stars: ✭ 156 (+642.86%)
Mutual labels:  eventbus
azeroth-event
Lightweight event-driven framework
Stars: ✭ 18 (-14.29%)
Mutual labels:  eventbus
Androideventbus
[DEPRECATED] A lightweight eventbus library for android, simplifies communication between Activities, Fragments, Threads, Services, etc.
Stars: ✭ 1,597 (+7504.76%)
Mutual labels:  eventbus
evon
Fast and versatile event dispatcher code generator for Golang
Stars: ✭ 15 (-28.57%)
Mutual labels:  eventbus
Milkomeda
Spring extend componets which build from experience of bussiness, let developers to develop with Spring Boot as fast as possible.(基于Spring生态打造的一系列来自业务上的快速开发模块集合。)
Stars: ✭ 117 (+457.14%)
Mutual labels:  eventbus
Unpeek Livedata
LiveData 数据倒灌:别问,问就是不可预期 - Perfect alternative to SingleLiveEvent, supporting multiple observers.
Stars: ✭ 208 (+890.48%)
Mutual labels:  eventbus
COCO-Assistant
Helper for dealing with MS-COCO annotations
Stars: ✭ 83 (+295.24%)
Mutual labels:  annotation-processor
rabbitmq-advanced-spring-boot-starter
A generic library for messaging with rabbit mq with extension on spring boot amqp
Stars: ✭ 85 (+304.76%)
Mutual labels:  eventbus
KDispatcher
Simple and light-weight event dispatcher for Kotlin
Stars: ✭ 64 (+204.76%)
Mutual labels:  eventbus

Green Annotations

An Android Annotations plugin to support the Greenrobot Eventbus.
It can inject the default EventBus and automatically handle the registration/unregistration.

Build Status Maven Central Android Arsenal Javadocs license Join the chat at https://gitter.im/green-annotations/Lobby

Usage in your Android Studio project:

In the build.gradle file of the module project:

    dependencies {
        // Android Annotations for Greenrobot
        apt 'com.tmtron:green-annotations:1.0.2'
        compile 'com.tmtron:green-annotations-api:1.0.2'
    }

Note: Green-Annotations version 1.0.2 requires Android-Annotations version 4.4.0

Details

Before

Shows the Activity without using AndroidAnnotations or GreenAnnotations:

    public class ActivityBefore extends Activity {
    
        EventBus eventBus;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            eventBus = EventBus.getDefault();
        }
    
        @Override
        public void onStart() {
            super.onStart();
            eventBus.register(this);
        }
    
        @Override
        public void onStop() {
            eventBus.unregister(this);
            super.onStop();
        }
    
        public void fireEvent(String message) {
            eventBus.post(new MessageEvent(message));
        }
    
        @Subscribe(threadMode = ThreadMode.MAIN)
        public void onMessageEvent(MessageEvent event) {
            Toast.makeText(getApplicationContext(), event.message, Toast.LENGTH_SHORT).show();
        }
    
    }

After

Shows the same Activity with AndroidAnnotations and GreenAnnotations:

    @EActivity
    public class ActivityAfter extends Activity {
    
        @EventBusGreenRobot
        EventBus eventBus;
    
        public void fireEvent(String message) {
            eventBus.post(new MessageEvent(message));
        }
    
        @Subscribe(threadMode = ThreadMode.MAIN)
        public void onMessageEvent(MessageEvent event) {
            Toast.makeText(getApplicationContext(), event.message, Toast.LENGTH_SHORT).show();
        }
    
    }

Note: green-annotations-test is a tiny test-project: a sample android app with only one single activity to show how to use green-annotations (and the gradle-setup).

License

This plugin is under the Apache 2.0 license. Copyright 2016, Martin Trummer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].