Skip to content

Commit

Permalink
Use stored credentials (#90)
Browse files Browse the repository at this point in the history
* Use stored credentials

* Change || to &&
  • Loading branch information
christiancoleman authored and omkarmoghe committed Jul 23, 2016
1 parent 7c51936 commit 46be738
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

import com.google.android.gms.common.SignInButton;
import com.omkarmoghe.pokemap.R;
import com.omkarmoghe.pokemap.controllers.app_preferences.PokemapAppPreferences;
import com.omkarmoghe.pokemap.controllers.app_preferences.PokemapSharedPreferences;
import com.omkarmoghe.pokemap.controllers.net.GoogleManager;
import com.omkarmoghe.pokemap.controllers.net.GoogleService;
import com.omkarmoghe.pokemap.controllers.net.NianticManager;
Expand All @@ -48,13 +50,22 @@ public class LoginActivity extends AppCompatActivity{
private GoogleManager.LoginListener mGoogleLoginListener;

private String mDeviceCode;
private PokemapAppPreferences mPref;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);

mNianticManager = NianticManager.getInstance();
mGoogleManager = GoogleManager.getInstance();
mPref = new PokemapSharedPreferences(this);

if (mPref.isUsernameSet() && mPref.isPasswordSet()) {
mNianticManager.login(mPref.getUsername(), mPref.getPassword());
finishLogin();
}

setContentView(R.layout.activity_login);

mNianticLoginListener = new NianticManager.LoginListener() {
@Override
Expand Down

0 comments on commit 46be738

Please sign in to comment.