Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge remote-tracking branch 'upstream/master' #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies {
compile 'com.google.dagger:dagger:2.0.2'
apt 'com.google.dagger:dagger-compiler:2.0.2'
provided 'org.glassfish:javax.annotation:10.0-b28'
provided 'javax.annotation:jsr250-api:1.0'

compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.jakewharton.timber:timber:4.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.app.Application;
import android.content.Context;
import android.support.annotation.VisibleForTesting;

import com.frogermcs.dagger2metrics.Dagger2Metrics;

Expand All @@ -14,8 +13,7 @@
/**
* Created by Miroslaw Stanek on 22.04.15.
*/
public class GithubClientApplication extends Application {

public class GithubClientApplication extends Application {
private AppComponent appComponent;
private UserComponent userComponent;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package frogermcs.io.githubclient.ui.activity.presenter;

import android.os.Handler;

import frogermcs.io.githubclient.HeavyLibraryWrapper;
import frogermcs.io.githubclient.data.api.UserManager;
import frogermcs.io.githubclient.data.model.User;
Expand All @@ -13,23 +15,22 @@
public class SplashActivityPresenter {
public String username;

private SplashActivity splashActivity;
private Validator validator;
private UserManager userManager;
private HeavyLibraryWrapper heavyLibraryWrapper;
private final SplashActivity splashActivity;
private final Validator validator;
private final UserManager userManager;

public SplashActivityPresenter(SplashActivity splashActivity, Validator validator,
UserManager userManager, HeavyLibraryWrapper heavyLibraryWrapper) {
this.splashActivity = splashActivity;
this.validator = validator;
this.userManager = userManager;
this.heavyLibraryWrapper = heavyLibraryWrapper;

HeavyLibraryWrapper heavyLibraryWrapper1 = heavyLibraryWrapper;
//This calls should be delivered to ExternalLibrary right after it will be initialized
this.heavyLibraryWrapper.callMethod();
this.heavyLibraryWrapper.callMethod();
this.heavyLibraryWrapper.callMethod();
this.heavyLibraryWrapper.callMethod();
heavyLibraryWrapper1.callMethod();
heavyLibraryWrapper1.callMethod();
heavyLibraryWrapper1.callMethod();
heavyLibraryWrapper1.callMethod();
}

public void onShowRepositoriesClick() {
Expand All @@ -38,7 +39,13 @@ public void onShowRepositoriesClick() {
userManager.getUser(username).subscribe(new SimpleObserver<User>() {
@Override
public void onNext(User user) {
splashActivity.showLoading(false);
// To avoid prematurely hiding the progressbar, post delayed
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override public void run() {
splashActivity.showLoading(false);
}
}, 1000 /* 1 sec */);
splashActivity.showRepositoriesListForUser(user);
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
classpath 'com.android.tools.build:gradle:2.0.0-alpha9'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.frogermcs.dagger2metrics:dagger2metrics-plugin:0.2.1'
}
Expand Down