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
private class ColorTextInfo extends ItemHolderInfo { | |
int color; | |
String text; | |
//... | |
} |
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 ExampleApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
//Use it only in debug builds | |
if (BuildConfig.DEBUG) { | |
Dagger2Metrics.enableCapturing(this); | |
} | |
} |
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 ExampleApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
//Use it only in debug builds | |
if (BuildConfig.DEBUG) { | |
AndroidDevMetrics.initWith(this); | |
} | |
} |
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
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.frogermcs.androiddevmetrics:androiddevmetrics-plugin:0.3' | |
} | |
} |
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 ExampleApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
//Use it only in debug builds | |
if (BuildConfig.DEBUG) { | |
AndroidDevMetrics.initWith(this); | |
} | |
} |
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
apply plugin: 'com.android.application' | |
apply plugin: 'com.neenbedankt.android-apt' | |
apply plugin: 'com.frogermcs.androiddevmetrics' | |
repositories { | |
maven { | |
url "https://oss.sonatype.org/content/repositories/snapshots" | |
} | |
} | |
//... |
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
@ProducerModule | |
public class GithubApiProducerModule { | |
@Produces | |
static OkHttpClient produceOkHttpClient() { | |
final OkHttpClient.Builder builder = new OkHttpClient.Builder(); | |
if (BuildConfig.DEBUG) { | |
HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); | |
logging.setLevel(HttpLoggingInterceptor.Level.BODY); | |
builder.addInterceptor(logging); |
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
@ProductionComponent( | |
dependencies = AppComponent.class, | |
modules = GithubApiProducerModule.class | |
) | |
public interface AppProductionComponent { | |
ListenableFuture<UserManager> userManager(); | |
ListenableFuture<UserModule.Factory> userModuleFactory(); | |
} |
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
AppProductionComponent appProductionComponent = DaggerAppProductionComponent.builder() | |
.executor(Executors.newSingleThreadExecutor()) | |
.appComponent(appComponent) | |
.build(); |
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
appProductionComponent = splashActivity.getAppProductionComponent(); | |
Futures.addCallback(appProductionComponent.userManager(), new FutureCallback<UserManager>() { | |
@Override | |
public void onSuccess(UserManager result) { | |
SplashActivityPresenter.this.userManager = result; | |
} | |
@Override | |
public void onFailure(Throwable t) { |