|
@@ -32,6 +32,8 @@ import android.support.v7.app.ActionBar;
|
|
import android.support.v7.widget.Toolbar;
|
|
import android.support.v7.widget.Toolbar;
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
import android.widget.ProgressBar;
|
|
import android.widget.ProgressBar;
|
|
|
|
+import android.widget.RelativeLayout;
|
|
|
|
+import android.widget.TextView;
|
|
|
|
|
|
import com.owncloud.android.R;
|
|
import com.owncloud.android.R;
|
|
import com.owncloud.android.datamodel.FileDataStorageManager;
|
|
import com.owncloud.android.datamodel.FileDataStorageManager;
|
|
@@ -44,6 +46,8 @@ import com.owncloud.android.utils.ThemeUtils;
|
|
public abstract class ToolbarActivity extends BaseActivity {
|
|
public abstract class ToolbarActivity extends BaseActivity {
|
|
private ProgressBar mProgressBar;
|
|
private ProgressBar mProgressBar;
|
|
private ImageView mPreviewImage;
|
|
private ImageView mPreviewImage;
|
|
|
|
+ private RelativeLayout mInfoBox;
|
|
|
|
+ private TextView mInfoBoxMessage;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
@@ -69,6 +73,8 @@ public abstract class ToolbarActivity extends BaseActivity {
|
|
|
|
|
|
ThemeUtils.colorToolbarProgressBar(this, ThemeUtils.primaryColor(this, false));
|
|
ThemeUtils.colorToolbarProgressBar(this, ThemeUtils.primaryColor(this, false));
|
|
}
|
|
}
|
|
|
|
+ mInfoBox = (RelativeLayout) findViewById(R.id.info_box);
|
|
|
|
+ mInfoBoxMessage = (TextView) findViewById(R.id.info_box_message);
|
|
|
|
|
|
mPreviewImage = findViewById(R.id.preview_image);
|
|
mPreviewImage = findViewById(R.id.preview_image);
|
|
|
|
|
|
@@ -146,6 +152,34 @@ public abstract class ToolbarActivity extends BaseActivity {
|
|
return file == null || (file.isFolder() && file.getParentId() == FileDataStorageManager.ROOT_PARENT_ID);
|
|
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) {
|
|
|
|
+ mInfoBox.setVisibility(View.VISIBLE);
|
|
|
|
+ mInfoBoxMessage.setText(R.string.maintenance_mode);
|
|
|
|
+ } else {
|
|
|
|
+ mInfoBox.setVisibility(View.GONE);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 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) {
|
|
|
|
+ mInfoBox.setVisibility(View.VISIBLE);
|
|
|
|
+ mInfoBoxMessage.setText(R.string.offline_mode);
|
|
|
|
+ } else {
|
|
|
|
+ mInfoBox.setVisibility(View.GONE);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Change the indeterminate mode for the toolbar's progress bar.
|
|
* Change the indeterminate mode for the toolbar's progress bar.
|
|
*
|
|
*
|