Skip to content

Commit

Permalink
release commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonid Olevsky committed Aug 27, 2016
1 parent 0a6c6c7 commit 073a693
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class MarsPhotosActivity extends BaseActivity<MarsPhotosModel> {

MarsPhotosAdapter marsPhotosAdapter;

boolean isFirstTimeCalled = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -54,8 +56,14 @@ protected void onCreate(Bundle savedInstanceState) {
recyclerView.setAdapter(marsPhotosAdapter);

marsPhotosPresenter.initPageController(recyclerView);
}

@Override
protected void onStart() {
super.onStart();

if (savedInstanceState == null) {
if(!isFirstTimeCalled){
isFirstTimeCalled = true;
marsPhotosPresenter.loadData();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ public class PlanetaryApodActivity extends BaseActivity<ApodModel> {
@BindView(R.id.progress_bar) ProgressBar progressBar;
@BindView(R.id.image_header) ProgressImageView imageView;

@Override
protected void onCreate(Bundle savedInstanceState) {
boolean isFirstTimeCalled = false;

@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
((MainApplication) getApplication()).getApplicationComponent().inject(this);

Expand All @@ -45,8 +46,13 @@ protected void onCreate(Bundle savedInstanceState) {

setSupportActionBar(toolbar);
intActionBar();
}

@Override protected void onStart() {
super.onStart();

if (savedInstanceState == null) {
if(!isFirstTimeCalled){
isFirstTimeCalled = true;
planetaryApodPresenter.loadData();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;

import javax.inject.Inject;

import me.lolevsky.nasaplanetary.MainApplication;
Expand All @@ -21,15 +18,15 @@ public class SplashActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
((MainApplication) getApplication()).getApplicationComponent().inject(this);

//get the opportunity for remote config get data.
//give the opportunity for remote config get data.
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
startActivity(intent);
finish();
}
}, 1000);
}, 2000);
}

@Override
Expand Down

0 comments on commit 073a693

Please sign in to comment.