Ejemplo n.º 1
0
 void loginDropbox() {
   if (dropbox.isAuthenticated()) {
     // If we're already authenticated, we don't need to get
     // the login info
     progress.show();
     dropbox.login(dropboxListener);
   } else {
     String email = dropboxEmail.getText().toString();
     if (email.length() < 5 || email.indexOf("@") < 0 || email.indexOf(".") < 0) {
       shake(dropboxEmail);
       dropboxEmail.requestFocus();
       showToast("Invalid e-mail");
       return;
     }
     String password = dropboxPass.getText().toString();
     if (password.length() < 6) {
       shake(dropboxPass);
       dropboxPass.requestFocus();
       showToast("Password too short");
       return;
     }
     // It's good to do Dropbox API (and any web API) calls
     // in a separate thread, so we don't get a force-close
     // due to the UI thread stalling.
     progress.show();
     dropbox.login(dropboxListener, email, password);
   }
 }
Ejemplo n.º 2
0
 @Override
 public void loginSuccessfull() {
   progress.dismiss();
   showToast("Logged in!");
   loginButton.setEnabled(false);
   storeKeys(dropbox.getConfig().accessTokenKey, dropbox.getConfig().accessTokenSecret);
   createDropboxList();
   // allow scrolling to next page
   wizard.enablePage(1);
   // setLoggedIn(true);
   // displayAccountInfo(mDropbox.accountInfo());
 }