Quick fix to work with new library updates

This commit is contained in:
Mario Danic 2017-01-24 18:00:00 +01:00 committed by AndyScherzinger
parent a81aad613b
commit ba5dae93b4
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
4 changed files with 15 additions and 13 deletions

View file

@ -10,7 +10,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
@ -41,7 +41,7 @@ dependencies {
/// dependencies for app building
compile name: 'touch-image-view'
compile 'com.github.nextcloud:android-library:1.0.10'
compile 'com.github.nextcloud:android-library:change-userinfo-calls-SNAPSHOT'
compile "com.android.support:support-v4:${supportLibraryVersion}"
compile "com.android.support:design:${supportLibraryVersion}"
compile 'com.jakewharton:disklrucache:2.0.2'

View file

@ -68,6 +68,7 @@ import com.owncloud.android.lib.common.OwnCloudAccount;
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
import com.owncloud.android.lib.common.OwnCloudCredentials;
import com.owncloud.android.lib.common.OwnCloudCredentialsFactory;
import com.owncloud.android.lib.common.UserInfo;
import com.owncloud.android.lib.common.accounts.AccountTypeUtils;
import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;
import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
@ -79,7 +80,6 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCo
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation.UserInfo;
import com.owncloud.android.operations.DetectAuthenticationMethodOperation.AuthenticationMethod;
import com.owncloud.android.operations.GetServerInfoOperation;
import com.owncloud.android.operations.OAuth2GetAccessToken;
@ -1086,8 +1086,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
if (result.isSuccess()) {
boolean success = false;
String username;
if (result.getData().get(0) instanceof GetRemoteUserInfoOperation.UserInfo) {
username = ((GetRemoteUserInfoOperation.UserInfo) result.getData().get(0)).mDisplayName;
if (result.getData().get(0) instanceof UserInfo) {
username = ((UserInfo) result.getData().get(0)).getDisplayName();
} else {
username = (String) result.getData().get(0);
}
@ -1648,7 +1648,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
try {
UserInfo userInfo = (UserInfo) authResult.getData().get(0);
mAccountMgr.setUserData(
mAccount, Constants.KEY_DISPLAY_NAME, userInfo.mDisplayName
mAccount, Constants.KEY_DISPLAY_NAME, userInfo.getDisplayName()
);
} catch (ClassCastException c) {
Log_OC.w(TAG, "Couldn't get display name for " + username);

View file

@ -24,10 +24,10 @@ import android.accounts.AccountManager;
import com.owncloud.android.MainApp;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.UserInfo;
import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation.UserInfo;
import com.owncloud.android.operations.common.SyncOperation;
/**
@ -63,7 +63,7 @@ public class GetUserProfileOperation extends SyncOperation {
accountManager.setUserData(
storedAccount,
AccountUtils.Constants.KEY_DISPLAY_NAME,
userInfo.mDisplayName
userInfo.getDisplayName()
);
}
return result;

View file

@ -48,10 +48,12 @@ import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.OwnCloudAccount;
import com.owncloud.android.lib.common.Quota;
import com.owncloud.android.lib.common.UserInfo;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.users.RemoteGetUserQuotaOperation;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation;
import com.owncloud.android.ui.TextDrawable;
import com.owncloud.android.utils.DisplayUtils;
@ -620,13 +622,13 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
Thread t = new Thread(new Runnable() {
public void run() {
RemoteOperation getQuotaInfoOperation = new RemoteGetUserQuotaOperation();
RemoteOperation getQuotaInfoOperation = new GetRemoteUserInfoOperation();
RemoteOperationResult result = getQuotaInfoOperation.execute(
AccountUtils.getCurrentOwnCloudAccount(DrawerActivity.this), DrawerActivity.this);
if (result.isSuccess() && result.getData() != null) {
final RemoteGetUserQuotaOperation.Quota quota =
(RemoteGetUserQuotaOperation.Quota) result.getData().get(0);
final UserInfo userInfo = (UserInfo) result.getData().get(0);
final Quota quota = userInfo.getQuota();
final long used = quota.getUsed();
final long total = quota.getTotal();
@ -637,7 +639,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
@Override
public void run() {
if (quotaValue > 0
|| quotaValue == RemoteGetUserQuotaOperation.QUOTA_LIMIT_INFO_NOT_AVAILABLE) {
|| quotaValue == GetRemoteUserInfoOperation.QUOTA_LIMIT_INFO_NOT_AVAILABLE) {
/**
* show quota in case
* it is available and calculated (> 0) or