mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-31 13:34:45 +01:00
Minor style fix in authentication classes
This commit is contained in:
@@ -44,7 +44,7 @@ public class AccountChooser {
|
||||
* Handle the account being selected.
|
||||
* @param account The selected account or null if none could be found
|
||||
*/
|
||||
public void handleAccountSelected(Account account);
|
||||
public void onAccountSelected(Account account);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,13 +65,13 @@ public class AccountChooser {
|
||||
return;
|
||||
}
|
||||
if (accounts.length == 1) {
|
||||
handler.handleAccountSelected(accounts[0]);
|
||||
handler.onAccountSelected(accounts[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO This should be read out of a preference.
|
||||
if (selectedAccount != null) {
|
||||
handler.handleAccountSelected(selectedAccount);
|
||||
handler.onAccountSelected(selectedAccount);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -89,14 +89,14 @@ public class AccountChooser {
|
||||
selectedAccount = accounts[selectedAccountIndex];
|
||||
}
|
||||
|
||||
handler.handleAccountSelected(selectedAccount);
|
||||
handler.onAccountSelected(selectedAccount);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.cancel,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
handler.handleAccountSelected(null);
|
||||
handler.onAccountSelected(null);
|
||||
}
|
||||
});
|
||||
String[] choices = new String[accounts.length];
|
||||
@@ -127,7 +127,7 @@ public class AccountChooser {
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
handler.handleAccountSelected(null);
|
||||
handler.onAccountSelected(null);
|
||||
}
|
||||
});
|
||||
builder.show();
|
||||
|
||||
@@ -84,7 +84,7 @@ public class MyMapsList extends Activity implements MapsFacade.MapsListCallback
|
||||
MyMapsList.this,
|
||||
new AccountChooser.AccountHandler() {
|
||||
@Override
|
||||
public void handleAccountSelected(Account account) {
|
||||
public void onAccountSelected(Account account) {
|
||||
// Account selection happens in the UI thread.
|
||||
if (account != null) {
|
||||
// The user did not quit and there was a valid google
|
||||
|
||||
@@ -24,7 +24,6 @@ import android.content.Intent;
|
||||
* @author Sandor Dornbush
|
||||
*/
|
||||
public interface AuthManager {
|
||||
|
||||
/**
|
||||
* Initializes the login process. The user should be asked to login if they
|
||||
* haven't already. The {@link Runnable} provided will be executed when the
|
||||
@@ -34,7 +33,7 @@ public interface AuthManager {
|
||||
* has been successfully fetched and is available via
|
||||
* {@link #getAuthToken()}
|
||||
*/
|
||||
public abstract void doLogin(Runnable whenFinished, Object o);
|
||||
void doLogin(Runnable whenFinished, Object o);
|
||||
|
||||
/**
|
||||
* The {@link android.app.Activity} owner of this class should call this
|
||||
@@ -53,7 +52,7 @@ public interface AuthManager {
|
||||
* the auth token, or False if there was an error or the request was
|
||||
* canceled
|
||||
*/
|
||||
public abstract boolean authResult(int resultCode, Intent results);
|
||||
boolean authResult(int resultCode, Intent results);
|
||||
|
||||
/**
|
||||
* Returns the current auth token. Response may be null if no valid auth
|
||||
@@ -62,7 +61,7 @@ public interface AuthManager {
|
||||
* @return The current auth token or null if no auth token has been
|
||||
* fetched
|
||||
*/
|
||||
public abstract String getAuthToken();
|
||||
String getAuthToken();
|
||||
|
||||
/**
|
||||
* Invalidates the existing auth token and request a new one. The
|
||||
@@ -72,6 +71,5 @@ public interface AuthManager {
|
||||
* @param whenFinished A {@link Runnable} to execute when a new auth token
|
||||
* is successfully fetched
|
||||
*/
|
||||
public abstract void invalidateAndRefresh(Runnable whenFinished);
|
||||
|
||||
void invalidateAndRefresh(Runnable whenFinished);
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ public class ModernAuthManager implements AuthManager {
|
||||
accountChooser.chooseAccount(activity,
|
||||
new AccountChooser.AccountHandler() {
|
||||
@Override
|
||||
public void handleAccountSelected(Account account) {
|
||||
public void onAccountSelected(Account account) {
|
||||
if (account != null) {
|
||||
doLogin(whenFinished, account);
|
||||
} else {
|
||||
|
||||
@@ -533,7 +533,7 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
accountChooser.chooseAccount(SendActivity.this,
|
||||
new AccountChooser.AccountHandler() {
|
||||
@Override
|
||||
public void handleAccountSelected(Account account) {
|
||||
public void onAccountSelected(Account account) {
|
||||
if (account == null) {
|
||||
progressDialog.dismiss();
|
||||
progressDialog = null;
|
||||
|
||||
Reference in New Issue
Block a user