make info box generic

This commit is contained in:
AndyScherzinger 2018-07-05 16:50:20 +02:00
parent 69ad131a5f
commit 456bde9cb3
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 2 additions and 28 deletions

View file

@ -1329,7 +1329,7 @@ public class FileDisplayActivity extends HookActivity
synchResult != null) {
if (synchResult.isSuccess()) {
setMaintenanceMode(false);
hideInfoBox();
} else {
// TODO refactor and make common
if (checkForRemoteOperationError(synchResult)) {
@ -1338,7 +1338,7 @@ public class FileDisplayActivity extends HookActivity
synchResult.getCode())) {
showUntrustedCertDialog(synchResult);
} else if (ResultCode.MAINTENANCE_MODE.equals(synchResult.getCode())) {
setMaintenanceMode(true);
showInfoBox(R.string.maintenance_mode);
}
}
}

View file

@ -154,32 +154,6 @@ public abstract class ToolbarActivity extends BaseActivity {
return file == null || (file.isFolder() && file.getParentId() == FileDataStorageManager.ROOT_PARENT_ID);
}
/**
* de-/activates the maintenance message within the toolbar.
*
* @param active flag is mode should be de-/activated
*/
protected final void setMaintenanceMode(boolean active) {
if (active) {
showInfoBox(R.string.maintenance_mode);
} else {
hideInfoBox();
}
}
/**
* de-/activates the offline message within the toolbar.
*
* @param active flag is mode should be de-/activated
*/
protected final void setOfflineMode(boolean active) {
if (active) {
showInfoBox(R.string.offline_mode);
} else {
hideInfoBox();
}
}
/**
* shows the toolbar's info box with the given text.
*