Browse Source

Add proper toolbar and title

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 5 years ago
parent
commit
88bdf4cbf7

+ 2 - 1
src/main/AndroidManifest.xml

@@ -320,7 +320,8 @@
 
         <activity android:name=".ui.activity.LogHistoryActivity"/>
 
-        <activity android:name=".ui.errorhandling.ErrorShowActivity" />
+        <activity android:name=".ui.errorhandling.ErrorShowActivity"
+            android:theme="@style/Theme.ownCloud.Toolbar"/>
         <activity android:name=".ui.activity.UploadListActivity" />
         <activity
             android:name=".ui.trashbin.TrashbinActivity"

+ 10 - 2
src/main/java/com/owncloud/android/ui/errorhandling/ErrorShowActivity.java

@@ -18,14 +18,17 @@
  */
 package com.owncloud.android.ui.errorhandling;
 
-import android.app.Activity;
 import android.os.Bundle;
 import android.util.Log;
 import android.widget.TextView;
 
 import com.owncloud.android.R;
 
-public class ErrorShowActivity extends Activity {
+import androidx.appcompat.app.ActionBar;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+public class ErrorShowActivity extends AppCompatActivity {
     private static final String TAG = ErrorShowActivity.class.getSimpleName();
     public static final String EXTRA_ERROR_TEXT = "error";
 
@@ -38,5 +41,10 @@ public class ErrorShowActivity extends Activity {
         setContentView(R.layout.errorhandling_showerror);
         error = findViewById(R.id.errorTextView);
         error.setText(getIntent().getStringExtra(EXTRA_ERROR_TEXT));
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+
+        setTitle(R.string.common_error);
     }
 }

+ 38 - 7
src/main/res/layout/errorhandling_showerror.xml

@@ -1,11 +1,42 @@
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+<!--
+  Nextcloud Android client application
+
+  Copyright (C) 2019 Andy Scherzinger
+
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+  License as published by the Free Software Foundation; either
+  version 3 of the License, or any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+
+  You should have received a copy of the GNU Affero General Public
+  License along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    tools:context=".ui.errorhandling.ErrorShowActivity">
 
-    <TextView
-        android:id="@+id/errorTextView"
+    <include layout="@layout/toolbar_standard" />
+
+    <ScrollView
+        android:id="@+id/error_page_container"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:padding="@dimen/standard_padding" />
+        android:layout_height="match_parent"
+        app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
+        <TextView
+            android:id="@+id/errorTextView"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:padding="@dimen/standard_padding" />
+
+    </ScrollView>
 
-</ScrollView>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>