mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
Clean up
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
bce7a5eccd
commit
61899d49ac
@ -24,7 +24,6 @@
|
|||||||
package com.nextcloud.talk.controllers;
|
package com.nextcloud.talk.controllers;
|
||||||
|
|
||||||
import android.accounts.Account;
|
import android.accounts.Account;
|
||||||
import android.accounts.AccountManager;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
@ -86,7 +85,7 @@ public class SwitchAccountController extends BaseController {
|
|||||||
private FlexibleAdapter.OnItemClickListener onImportItemClickListener = position -> {
|
private FlexibleAdapter.OnItemClickListener onImportItemClickListener = position -> {
|
||||||
if (userItems.size() > position) {
|
if (userItems.size() > position) {
|
||||||
Account account = ((AdvancedUserItem) userItems.get(position)).getAccount();
|
Account account = ((AdvancedUserItem) userItems.get(position)).getAccount();
|
||||||
getAuthTokenForAccount(account);
|
verifyAccount(account);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -218,9 +217,7 @@ public class SwitchAccountController extends BaseController {
|
|||||||
swipeRefreshLayout.setEnabled(false);
|
swipeRefreshLayout.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getAuthTokenForAccount(Account account) {
|
private void verifyAccount(Account account) {
|
||||||
final AccountManager accMgr = AccountManager.get(getActivity());
|
|
||||||
|
|
||||||
ImportAccount importAccount = AccountUtils.getInformationFromAccount(account);
|
ImportAccount importAccount = AccountUtils.getInformationFromAccount(account);
|
||||||
BundleBuilder bundleBuilder = new BundleBuilder(new Bundle());
|
BundleBuilder bundleBuilder = new BundleBuilder(new Bundle());
|
||||||
bundleBuilder.putString(BundleKeys.KEY_USERNAME, importAccount.getUsername());
|
bundleBuilder.putString(BundleKeys.KEY_USERNAME, importAccount.getUsername());
|
||||||
@ -230,7 +227,6 @@ public class SwitchAccountController extends BaseController {
|
|||||||
getRouter().pushController(RouterTransaction.with(new AccountVerificationController
|
getRouter().pushController(RouterTransaction.with(new AccountVerificationController
|
||||||
(bundleBuilder.build())).pushChangeHandler(new HorizontalChangeHandler())
|
(bundleBuilder.build())).pushChangeHandler(new HorizontalChangeHandler())
|
||||||
.popChangeHandler(new HorizontalChangeHandler()));
|
.popChangeHandler(new HorizontalChangeHandler()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user