Browse Source

rebase changes

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 5 năm trước cách đây
mục cha
commit
7bf354928a

+ 4 - 4
src/main/java/com/owncloud/android/ui/activity/ManageAccountsActivity.java

@@ -130,7 +130,7 @@ public class ManageAccountsActivity extends FileActivity
 
         arbitraryDataProvider = new ArbitraryDataProvider(getContentResolver());
 
-        mAccountListAdapter = new AccountListAdapter(this, getUserAccountManager(), getAccountListItems(), mTintedCheck);
+        mAccountListAdapter = new AccountListAdapter(this, accountManager, getAccountListItems(), mTintedCheck);
 
         mRecyclerView.setAdapter(mAccountListAdapter);
         mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
@@ -272,10 +272,10 @@ public class ManageAccountsActivity extends FileActivity
                               try {
                                   Bundle result = future.getResult();
                                   String name = result.getString(AccountManager.KEY_ACCOUNT_NAME);
-                                  AccountUtils.setCurrentOwnCloudAccount(getApplicationContext(), name);
+                                  accountManager.setCurrentOwnCloudAccount(name);
                                   mAccountListAdapter = new AccountListAdapter(
                                           this,
-                                          getUserAccountManager(),
+                                          accountManager,
                                           getAccountListItems(),
                                           mTintedCheck
                                   );
@@ -324,7 +324,7 @@ public class ManageAccountsActivity extends FileActivity
 
             List<AccountListItem> accountListItemArray = getAccountListItems();
             if (accountListItemArray.size() > SINGLE_ACCOUNT) {
-                mAccountListAdapter = new AccountListAdapter(this, getUserAccountManager(), accountListItemArray, mTintedCheck);
+                mAccountListAdapter = new AccountListAdapter(this, accountManager, accountListItemArray, mTintedCheck);
                 mRecyclerView.setAdapter(mAccountListAdapter);
             } else {
                 onBackPressed();

+ 1 - 1
src/main/java/com/owncloud/android/ui/adapter/AccountListAdapter.java

@@ -67,7 +67,7 @@ public class AccountListAdapter extends RecyclerView.Adapter<AccountListAdapter.
     private static final String KEY_DISPLAY_NAME = "DISPLAY_NAME";
     private static final int KEY_USER_INFO_REQUEST_CODE = 13;
 
-    public AccountListAdapter(BaseActivity context, List<AccountListItem> values, Drawable tintedCheck) {
+    public AccountListAdapter(BaseActivity context, UserAccountManager accountManager, List<AccountListItem> values, Drawable tintedCheck) {
         this.mContext = context;
         this.accountManager = accountManager;
         this.mValues = values;