This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package your.dependency | |
interface Dependecy { | |
interface Rx { | |
String rxJava = "io.reactivex.rxjava2:rxjava:${rxJavaVersion}"; | |
String rxKotlin = "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
def rx = deps.rx | |
implementation rx.rxJava | |
implementation rx.rxKotlin | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const val rxJavaVersion = "2.1.9" | |
const val rxKotlinVersion = "2.2.0" | |
object dependencies { | |
val rx = mapOf( | |
"rxJava" to "io.reactivex.rxjava2:rxjava:${rxJavaVersion}", | |
"rxKotlin" to "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}" | |
) | |
} | |
class DependenciesPlugin : Plugin<Project> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implement “com.modules:moduleA:x.y.z” |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2017 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Singleton | |
public class RealmManager { | |
private ThreadLocal<Realm> realms; | |
@Inject | |
public RealmManager() { | |
realms = new ThreadLocal<>(); | |
} | |
public Realm openRealm() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rx.Observable; | |
import rx.subjects.PublishSubject; | |
import rx.subjects.SerializedSubject; | |
import rx.subjects.Subject; | |
/** | |
* @author <a href="mailto:[email protected]">Jared Burrows</a> | |
*/ | |
public final class RxBus { | |
private final Subject<Object, Object> bus = new SerializedSubject<>(PublishSubject.create()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.app.Application; | |
import android.content.Context; | |
import android.content.ContextWrapper; | |
import android.os.Bundle; | |
import android.os.Looper; | |
import android.os.MessageQueue; | |
import android.util.Log; | |
import android.view.View; | |
import android.view.ViewTreeObserver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AndroidApplication extends MultiDexApplication { | |
public static final String TAG = AndroidApplication.class.getSimpleName(); | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
registerComponentCallbacks(new ComponentCallback()); | |
} | |
private class ComponentCallback implements ComponentCallbacks2 { |