mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 05:05:31 +03:00
Remove code format
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
96058c7072
commit
afb63961d1
1 changed files with 18 additions and 12 deletions
|
@ -1240,20 +1240,26 @@ public abstract class DrawerActivity extends ToolbarActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread t = new Thread(() -> {
|
Thread t = new Thread(() -> {
|
||||||
if ((getCapabilities() == null || getCapabilities().getAccountName() != null && getCapabilities().getAccountName().isEmpty()) && getStorageManager() != null) {
|
// fetch capabilities as early as possible
|
||||||
|
if ((getCapabilities() == null || getCapabilities().getAccountName() != null && getCapabilities().getAccountName().isEmpty())
|
||||||
|
&& getStorageManager() != null) {
|
||||||
GetCapabilitiesOperation getCapabilities = new GetCapabilitiesOperation(getStorageManager());
|
GetCapabilitiesOperation getCapabilities = new GetCapabilitiesOperation(getStorageManager());
|
||||||
getCapabilities.execute(getBaseContext());
|
getCapabilities.execute(getBaseContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getStorageManager() != null && CapabilityUtils.getCapability(user, this).getExternalLinks().isTrue()) {
|
if (getStorageManager() != null && CapabilityUtils.getCapability(user, this)
|
||||||
int count = arbitraryDataProvider.getIntegerValue(FilesSyncHelper.GLOBAL, FileActivity.APP_OPENED_COUNT);
|
.getExternalLinks().isTrue()) {
|
||||||
|
|
||||||
|
int count = arbitraryDataProvider.getIntegerValue(FilesSyncHelper.GLOBAL,
|
||||||
|
FileActivity.APP_OPENED_COUNT);
|
||||||
|
|
||||||
if (count > 10 || count == -1 || force) {
|
if (count > 10 || count == -1 || force) {
|
||||||
if (force) {
|
if (force) {
|
||||||
Log_OC.d("ExternalLinks", "force update");
|
Log_OC.d("ExternalLinks", "force update");
|
||||||
}
|
}
|
||||||
|
|
||||||
arbitraryDataProvider.storeOrUpdateKeyValue(FilesSyncHelper.GLOBAL, FileActivity.APP_OPENED_COUNT, "0");
|
arbitraryDataProvider.storeOrUpdateKeyValue(FilesSyncHelper.GLOBAL,
|
||||||
|
FileActivity.APP_OPENED_COUNT, "0");
|
||||||
|
|
||||||
Log_OC.d("ExternalLinks", "update via api");
|
Log_OC.d("ExternalLinks", "update via api");
|
||||||
RemoteOperation getExternalLinksOperation = new ExternalLinksOperation();
|
RemoteOperation getExternalLinksOperation = new ExternalLinksOperation();
|
||||||
|
@ -1261,19 +1267,21 @@ public abstract class DrawerActivity extends ToolbarActivity
|
||||||
|
|
||||||
if (result.isSuccess() && result.getData() != null) {
|
if (result.isSuccess() && result.getData() != null) {
|
||||||
externalLinksProvider.deleteAllExternalLinks();
|
externalLinksProvider.deleteAllExternalLinks();
|
||||||
ArrayList<ExternalLink> externalLinks = (ArrayList<ExternalLink>) result.getData();
|
|
||||||
|
ArrayList<ExternalLink> externalLinks = (ArrayList<ExternalLink>) (Object) result.getData();
|
||||||
|
|
||||||
for (ExternalLink link : externalLinks) {
|
for (ExternalLink link : externalLinks) {
|
||||||
externalLinksProvider.storeExternalLink(link);
|
externalLinksProvider.storeExternalLink(link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
arbitraryDataProvider.storeOrUpdateKeyValue(FilesSyncHelper.GLOBAL, FileActivity.APP_OPENED_COUNT, String.valueOf(count + 1));
|
arbitraryDataProvider.storeOrUpdateKeyValue(FilesSyncHelper.GLOBAL,
|
||||||
|
FileActivity.APP_OPENED_COUNT, String.valueOf(count + 1));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
externalLinksProvider.deleteAllExternalLinks();
|
externalLinksProvider.deleteAllExternalLinks();
|
||||||
Log_OC.d("ExternalLinks", "links disabled");
|
Log_OC.d("ExternalLinks", "links disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
runOnUiThread(this::updateExternalLinksInDrawer);
|
runOnUiThread(this::updateExternalLinksInDrawer);
|
||||||
});
|
});
|
||||||
t.start();
|
t.start();
|
||||||
|
@ -1281,9 +1289,7 @@ public abstract class DrawerActivity extends ToolbarActivity
|
||||||
|
|
||||||
protected void handleDeepLink(@NonNull Uri uri) {
|
protected void handleDeepLink(@NonNull Uri uri) {
|
||||||
String path = uri.getLastPathSegment();
|
String path = uri.getLastPathSegment();
|
||||||
if (path == null) {
|
if (path == null) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
DeepLinkConstants deepLinkType = DeepLinkConstants.Companion.fromPath(path);
|
DeepLinkConstants deepLinkType = DeepLinkConstants.Companion.fromPath(path);
|
||||||
if (deepLinkType == null) {
|
if (deepLinkType == null) {
|
||||||
|
|
Loading…
Reference in a new issue