projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'share_link_show_shared_files' into share_link__new_share
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
ui
/
activity
/
FileActivity.java
diff --git
a/src/com/owncloud/android/ui/activity/FileActivity.java
b/src/com/owncloud/android/ui/activity/FileActivity.java
index
31e3e86
..
3a9297e
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/FileActivity.java
+++ b/
src/com/owncloud/android/ui/activity/FileActivity.java
@@
-33,8
+33,10
@@
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.oc_framework.accounts.OwnCloudAccount;
-import com.owncloud.android.oc_framework.network.webdav.WebdavUtils;
+
+import com.owncloud.android.lib.accounts.OwnCloudAccount;
+import com.owncloud.android.lib.network.webdav.WebdavUtils;
+
import com.owncloud.android.utils.Log_OC;
import com.owncloud.android.utils.Log_OC;
@@
-71,10
+73,6
@@
public abstract class FileActivity extends SherlockFragmentActivity {
/** Flag to signal if the activity is launched by a notification */
private boolean mFromNotification;
/** Flag to signal if the activity is launched by a notification */
private boolean mFromNotification;
- /** Flag to signal if the server supports the Share API */
- private boolean mIsSharedSupported;
-
-
/**
/**
@@
-87,7
+85,6
@@
public abstract class FileActivity extends SherlockFragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
Account account;
if(savedInstanceState != null) {
account = savedInstanceState.getParcelable(FileActivity.EXTRA_ACCOUNT);
Account account;
if(savedInstanceState != null) {
account = savedInstanceState.getParcelable(FileActivity.EXTRA_ACCOUNT);
@@
-100,6
+97,7
@@
public abstract class FileActivity extends SherlockFragmentActivity {
}
setAccount(account, savedInstanceState != null);
}
setAccount(account, savedInstanceState != null);
+
}
}
@@
-164,7
+162,6
@@
public abstract class FileActivity extends SherlockFragmentActivity {
*/
private void swapToDefaultAccount() {
// default to the most recently used account
*/
private void swapToDefaultAccount() {
// default to the most recently used account
- AccountManager accountManager = AccountManager.get(this);
Account newAccount = AccountUtils.getCurrentOwnCloudAccount(getApplicationContext());
if (newAccount == null) {
/// no account available: force account creation
Account newAccount = AccountUtils.getCurrentOwnCloudAccount(getApplicationContext());
if (newAccount == null) {
/// no account available: force account creation
@@
-178,7
+175,6
@@
public abstract class FileActivity extends SherlockFragmentActivity {
mAccountWasRestored = (newAccount.equals(mAccount));
mAccount = newAccount;
}
mAccountWasRestored = (newAccount.equals(mAccount));
mAccount = newAccount;
}
- setIsSharedSupported( Boolean.getBoolean(accountManager.getUserData(mAccount, OwnCloudAccount.Constants.KEY_SUPPORTS_SHARE_API)));
}
}
@@
-257,14
+253,13
@@
public abstract class FileActivity extends SherlockFragmentActivity {
* @return 'True' if the server supports the Share API
*/
public boolean isSharedSupported() {
* @return 'True' if the server supports the Share API
*/
public boolean isSharedSupported() {
- return mIsSharedSupported;
+ if (getAccount() != null) {
+ AccountManager accountManager = AccountManager.get(this);
+ return Boolean.parseBoolean(accountManager.getUserData(getAccount(), OwnCloudAccount.Constants.KEY_SUPPORTS_SHARE_API));
+ }
+ return false;
}
}
-
- public void setIsSharedSupported(boolean mIsSharedSupported) {
- this.mIsSharedSupported = mIsSharedSupported;
- }
-
/**
* Helper class handling a callback from the {@link AccountManager} after the creation of
* a new ownCloud {@link Account} finished, successfully or not.
/**
* Helper class handling a callback from the {@link AccountManager} after the creation of
* a new ownCloud {@link Account} finished, successfully or not.