Code Monkey home page Code Monkey logo

apollo's Introduction

Hi there 🖐, I'm Sloaix

Former Baidu SLG Android Development Engineer, currently residing in ChongQing.

This is my BLOG.

top-langs

Sloaix's GitHub Stats

apollo's People

Contributors

sloaix 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apollo's Issues

Propose Logo

Hi. @lsxiao
I'm graphic designer. I wanted to contribute to your project and I've designed a logo for your project. If you like it, you can use it. it's free. I'll send you files and pr.
apollo v 1

Best Regard.
Mirza Zulfan

关于SubscriptionBinder绑定

你说SubscriptionBinder 可以在基类里面绑定和解绑定,为啥不直接来个默认的获取SubscriptionBinder的方法呢? 这样我不在基类里面用就很方便啦,
比如: EventBus.getDefault().register(......this);

因为有时候 需要在某些没有基类的地方获取消息

你好我在集成的时候出现问题

  • What went wrong:
    A problem occurred configuring project ':app'.

Could not resolve all files for configuration ':app:kapt'.
Could not download kryo-shaded.jar (com.esotericsoftware:kryo-shaded:4.0.0)
> Could not get resource 'https://jcenter.bintray.com/com/esotericsoftware/kryo-shaded/4.0.0/kryo-shaded-4.0.0.jar'.
> Could not GET 'https://jcenter.bintray.com/com/esotericsoftware/kryo-shaded/4.0.0/kryo-shaded-4.0.0.jar'.
> Connect to akamai.bintray.com:443 [akamai.bintray.com/23.42.190.84] failed: Connection timed out: connect
Could not download guava.jar (com.google.guava:guava:23.5-jre)
> Could not get resource 'https://jcenter.bintray.com/com/google/guava/guava/23.5-jre/guava-23.5-jre.jar'.
> Could not GET 'https://jcenter.bintray.com/com/google/guava/guava/23.5-jre/guava-23.5-jre.jar'.
> Connect to akamai.bintray.com:443 [akamai.bintray.com/23.42.190.84] failed: Connection timed out: connect

说是下载不了

我是这么配置的

def apolloVersion = "1.0.1-fix"
apollo = [
        //Apollo的核心库
        core     : "com.github.lsxiao.Apollo:core:$apolloVersion",
        processor: "com.github.lsxiao.Apollo:processor:$apolloVersion",
        //IPC,如不需要可以不依赖
        ipc      : "com.github.lsxiao.Apollo:ipc:$apolloVersion"
]

然后在 app的gradle中

implementation apollo.core
kapt apollo.processor

这个仓库也添加了

maven { url "https://jitpack.io" }

依赖写在library无法收到事件

api 'com.github.lsxiao.Apollo:core:1.0.2'
kapt "com.github.lsxiao.Apollo:processor:1.0.2"
只有写在app.gradle才能收到事件,写在library.gradle收不到,有解决办法吗

很赞,有源码分析吗?

求教

如下配置,无法找到com.lsxiao.apollo.generate.ApolloBinderGeneratorImpl包,哪里出问题了,求教

//Apollo的编译时注解处理器
annotationProcessor "com.github.lsxiao.Apollo:processor:1.0.0-rc.3"

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
maven { url "https://www.jitpack.io" }
}
}

发送事件无效

我的一个activity里面有一个viewPager+fragment,activity和viewPager中的fragment都注册了Apollo,但是在某一个fragment中发送两个事件,一个是向activity中发送,另一个是向别的fragment中发送,只会生效其中一个

问题请教

作者你好,我碰到了一个问题,我在adapter里使用Apollo.emit发送事件,在已经bind的Fragment里面无法接收到相应的事件。而如果在Fragment发送,则可以正常在Fragment接收。

Apollo是不是只能在Activity或Fragment中发送事件才能被正常接收呢,还是说发送事件的类也需要进行bind操作?

希望能添加权重

用 eventbus 有权重功能,感觉很好,比如多个tag接收同一事件,按照不同权重顺序接收。
还有 MAIN, IO, NEW, COMPUTATION, TRAMPOLINE, IMMEDIATE 这几个分别说明一下啊 ,是不是和eventbus 的一样呢

Unresolved reference: ApolloBinderGeneratorImpl

Im using Kotlin and I have problem ApolloBinderGeneratorImpl.instance() does not exist.
What im doing wrong?

//class App: Application() {

override fun onCreate() {
        super.onCreate()
        Apollo.init(AndroidSchedulers.mainThread(), ApolloBinderGeneratorImpl.instance(), this)
}

my gradle file:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

...

//event bus
    implementation "com.github.lsxiao.Apollo:core:1.0.0-rc.4"
    implementation "com.github.lsxiao.Apollo:ipc:1.0.0-rc.4"
    kapt "com.github.lsxiao.Apollo:processor:1.0.0-rc.4"

    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation "io.reactivex.rxjava2:rxjava:2.1.1"
    implementation "io.reactivex.rxjava2:rxkotlin:2.1.0"

包名错误?

无意间发现了一个 typo,强迫症犯了,希望能够更正。
snipaste_20170331_103221

:(Need Maintainers

由于家逢大变,本人已于19年5月从百度离职,目前已经未从事Android相关工作,暂无力更新此项目,需要新的维护者加入。

[Dependencies] RxJava Update ?

Hi,

I see that you are using "old" version of RxJava

//libs
rxjava2 = "2.0.5"

Is it possible to update to the last version ?

Thanks

代码混淆问题

文档中提供的混淆规则不够全面,启用 ProGuardApolloBinderGeneratorImpl 这个类也被混淆了,导致在 Apollo.kt 第 81 行使用反射获取这个类的 instance 方法时出现错误,应用崩溃。
应增加以下规则:
-keep class com.lsxiao.apollo.generate.** { *; }
另外,我发现英文版的文档没有提供混淆规则。

app和library里使用@Receive注解,会生成两个相同的ApolloBinderGeneratorImpl,导致编译错误

因为在做模块化开发,所以一些模块是以library的形式引入的,如果在library中使用@receive注解,会在library/build/intermidtates/classes/debug/com/lsxiao/apollo/generate/目录下生成ApolloBinderGeneratorImpl,因为app这边也在它目录下生成了ApolloBinderGeneratorImpl,所以导致Program type already present:ApolloBinderGeneratorImpl的错误。如果在library的build.gradle文件中不声明apollo的compiler,library中的@receive注解就会失效,收不到事件。

java.lang.NoClassDefFoundError

compile 'io.reactivex.rxjava2:rxjava:2.1.7'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation "com.github.lsxiao.Apollo:core:1.0.1"
annotationProcessor "com.github.lsxiao.Apollo:processor:1.0.1"

在build.gradle中添加了以上依赖,编译时报了Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

java.lang.NoClassDefFoundError: com/lsxiao/apollo/core/annotations/Receive的错误,请问应如何解决

编译时没有生成绑定代码

MainActivity里面
@receive(AppConstants.RXBUS_SET_MENSTRUL_DAY_CIRCLE)
public void updateUser(User user) {
mainViewModel.updateUser(user);
}
在ApolloBinderGeneratorImpl里面没有找到绑定MainActivity的代码,
但是其他类可以生成绑定代码

不知道怎么错了。。

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lin.sexy/com.lin.sexy.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'com.lsxiao.apllo.entity.SubscriptionBinder com.lsxiao.apllo.Apollo$SubscriberBinder.bind(java.lang.Object)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2457)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2517)
at android.app.ActivityThread.access$900(ActivityThread.java:168)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1378)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5643)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:689)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'com.lsxiao.apllo.entity.SubscriptionBinder com.lsxiao.apllo.Apollo$SubscriberBinder.bind(java.lang.Object)' on a null object reference
at com.lsxiao.apllo.Apollo.uniqueBind(Apollo.java:212)
at com.lsxiao.apllo.Apollo.bind(Apollo.java:185)
at com.lin.sexy.MainActivity.onCreate(MainActivity.java:24)

——————————————————————————————————————
public class MainActivity extends RxAppCompatActivity {
private SubscriptionBinder binder;
TestStore testStore;
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
binder = Apollo.get().bind(this);

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.