]> gitweb.stoutner.com Git - PrivacyCell.git/blobdiff - app/src/main/res/layout/privacy_cell_bottom_appbar.xml
Add an option to use a bottom app bar. https://redmine.stoutner.com/issues/749
[PrivacyCell.git] / app / src / main / res / layout / privacy_cell_bottom_appbar.xml
diff --git a/app/src/main/res/layout/privacy_cell_bottom_appbar.xml b/app/src/main/res/layout/privacy_cell_bottom_appbar.xml
new file mode 100644 (file)
index 0000000..af8fd57
--- /dev/null
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+  Copyright © 2021 Soren Stoutner <soren@stoutner.com>.
+
+  This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+
+  Privacy Cell is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  Privacy Cell 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 General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with Privacy Cell.  If not, see <http://www.gnu.org/licenses/>. -->
+
+<androidx.drawerlayout.widget.DrawerLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/drawerlayout"
+    android:layout_height="match_parent"
+    android:layout_width="match_parent">
+
+    <androidx.coordinatorlayout.widget.CoordinatorLayout
+        android:layout_height="match_parent"
+        android:layout_width="match_parent" >
+
+        <!-- The linear layout with `orientation="vertical"` moves the app bar below the main content below the main content. -->
+        <LinearLayout
+            android:layout_height="match_parent"
+            android:layout_width="match_parent"
+            android:orientation="vertical" >
+
+            <!-- The main content is wrapped in a scroll view. -->
+            <ScrollView
+                android:layout_height="0dp"
+                android:layout_width="match_parent"
+                android:layout_weight="1" >
+
+                <LinearLayout
+                    android:layout_height="wrap_content"
+                    android:layout_width="match_parent"
+                    android:orientation="vertical"
+                    android:padding="15dp" >
+
+                    <!-- Stingray. -->
+                    <LinearLayout
+                        android:id="@+id/stingray_linearlayout"
+                        android:layout_height="wrap_content"
+                        android:layout_width="wrap_content"
+                        android:layout_gravity="center_horizontal"
+                        android:orientation="vertical"
+                        tools:ignore="UseCompoundDrawables" >
+
+                        <ImageView
+                            android:id="@+id/stingray_imageview"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            tools:ignore="ContentDescription" />
+
+                        <!-- The text color primary is only displayed if the read phone state permission is not granted.
+                            The default text is replaced if the permission is not granted or the device is connected to a cell phone network. -->
+                        <TextView
+                            android:id="@+id/stingray_textview"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:textAlignment="center"
+                            android:layout_marginTop="10dp"
+                            android:textColor="?android:textColorPrimary"
+                            android:textSize="20sp"
+                            android:textStyle="bold"
+                            android:text="@string/not_connected" />
+                    </LinearLayout>
+
+                    <!-- Voice network. -->
+                    <LinearLayout
+                        android:id="@+id/voice_network_linearlayout"
+                        android:layout_height="wrap_content"
+                        android:layout_width="wrap_content"
+                        android:layout_gravity="center_horizontal"
+                        android:orientation="vertical" >
+
+                        <TextView
+                            android:id="@+id/voice_network"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:textAlignment="center"
+                            android:layout_marginTop="30dp"
+                            android:textColor="@color/blue_text"
+                            android:textSize="18sp"
+                            android:textStyle="bold" />
+
+                        <TextView
+                            android:id="@+id/voice_network_details"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:textAlignment="center"
+                            android:layout_marginBottom="10dp" />
+                    </LinearLayout>
+
+                    <!-- Data network. -->
+                    <LinearLayout
+                        android:id="@+id/data_network_linearlayout"
+                        android:layout_height="wrap_content"
+                        android:layout_width="wrap_content"
+                        android:layout_gravity="center_horizontal"
+                        android:orientation="vertical" >
+
+                        <TextView
+                            android:id="@+id/data_network"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:textAlignment="center"
+                            android:textColor="@color/blue_text"
+                            android:textSize="18sp"
+                            android:textStyle="bold" />
+
+                        <TextView
+                            android:id="@+id/data_network_details"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:textAlignment="center"
+                            android:layout_marginBottom="10dp" />
+                    </LinearLayout>
+
+                    <!-- Additional network info. -->
+                    <LinearLayout
+                        android:id="@+id/additional_network_info_linearlayout"
+                        android:layout_height="wrap_content"
+                        android:layout_width="wrap_content"
+                        android:layout_gravity="center_horizontal"
+                        android:orientation="vertical" >
+
+                        <TextView
+                            android:id="@+id/additional_network_info"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:textAlignment="center"
+                            android:textColor="@color/blue_text"
+                            android:textSize="18sp"
+                            android:textStyle="bold" />
+
+                        <TextView
+                            android:id="@+id/additional_network_info_details"
+                            android:layout_height="wrap_content"
+                            android:layout_width="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:textAlignment="center" />
+                    </LinearLayout>
+                </LinearLayout>
+            </ScrollView>
+
+            <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+            <com.google.android.material.appbar.AppBarLayout
+                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:background="?android:attr/colorBackground"
+                android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
+
+                <androidx.appcompat.widget.Toolbar
+                    android:id="@+id/toolbar"
+                    android:layout_height="wrap_content"
+                    android:layout_width="match_parent" />
+            </com.google.android.material.appbar.AppBarLayout>
+        </LinearLayout>
+    </androidx.coordinatorlayout.widget.CoordinatorLayout>
+
+    <!-- The navigation drawer. -->
+    <com.google.android.material.navigation.NavigationView
+        android:id="@+id/navigationview"
+        android:layout_height="match_parent"
+        android:layout_width="wrap_content"
+        android:layout_gravity="start"
+        app:menu="@menu/navigation_menu_bottom_appbar"
+        app:itemIconTint="@color/icon_enabled" />
+</androidx.drawerlayout.widget.DrawerLayout>
\ No newline at end of file