From d7c7a727100a3e9b6fccbcb4a4e6c66110efdc6e Mon Sep 17 00:00:00 2001
From: str4d <str4d@mail.i2p>
Date: Sun, 14 Feb 2016 05:36:04 +0000
Subject: [PATCH] Factor out loading screen activity XML

---
 .../res/layout/activity_nav_drawer.xml        | 57 +------------------
 .../res/layout/activity_with_loading.xml      | 57 +++++++++++++++++++
 2 files changed, 59 insertions(+), 55 deletions(-)
 create mode 100644 briar-android/res/layout/activity_with_loading.xml

diff --git a/briar-android/res/layout/activity_nav_drawer.xml b/briar-android/res/layout/activity_nav_drawer.xml
index f7f90efa8e..5b167e4ffe 100644
--- a/briar-android/res/layout/activity_nav_drawer.xml
+++ b/briar-android/res/layout/activity_nav_drawer.xml
@@ -2,65 +2,12 @@
 <android.support.v4.widget.DrawerLayout
 	android:id="@+id/drawer_layout"
 	xmlns:android="http://schemas.android.com/apk/res/android"
-	xmlns:tools="http://schemas.android.com/tools"
 	android:layout_width="match_parent"
 	android:layout_height="match_parent">
 
 	<!-- The first child(root) is the content view -->
-	<LinearLayout
-		android:layout_width="match_parent"
-		android:layout_height="match_parent"
-		android:orientation="vertical">
-
-		<android.support.v7.widget.Toolbar
-			android:id="@+id/toolbar"
-			style="@style/BriarToolbar"
-			android:layout_width="match_parent"
-			android:layout_height="wrap_content"
-			android:background="?attr/colorPrimary"
-			android:minHeight="?attr/actionBarSize"
-			/>
-
-		<FrameLayout
-			android:layout_width="match_parent"
-			android:layout_height="match_parent">
-
-			<FrameLayout
-				android:id="@+id/content_fragment"
-				android:layout_width="match_parent"
-				android:layout_height="match_parent"
-				android:background="@color/default_background"/>
-
-			<RelativeLayout
-				android:id="@+id/container_progress"
-				android:layout_width="match_parent"
-				android:layout_height="match_parent"
-				android:layout_gravity="center"
-				android:background="@color/default_background"
-				android:visibility="invisible"
-				tools:visibility="visible">
-
-				<ProgressBar
-					android:id="@+id/progress_bar"
-					style="?android:attr/progressBarStyleLargeInverse"
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:layout_centerInParent="true"/>
-
-				<TextView
-					android:id="@+id/title_progress_bar"
-					android:layout_width="match_parent"
-					android:layout_height="wrap_content"
-					android:layout_below="@id/progress_bar"
-					android:gravity="center"
-					android:paddingTop="@dimen/margin_large"
-					tools:text="progress bar title"
-					/>
-
-			</RelativeLayout>
-
-		</FrameLayout>
-	</LinearLayout>
+	<include
+		layout="@layout/activity_with_loading"/>
 
 	<!-- The second child is the menu -->
 	<include
diff --git a/briar-android/res/layout/activity_with_loading.xml b/briar-android/res/layout/activity_with_loading.xml
new file mode 100644
index 0000000000..8d22ba321a
--- /dev/null
+++ b/briar-android/res/layout/activity_with_loading.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+	xmlns:android="http://schemas.android.com/apk/res/android"
+	xmlns:tools="http://schemas.android.com/tools"
+	android:layout_width="match_parent"
+	android:layout_height="match_parent"
+	android:orientation="vertical">
+
+	<android.support.v7.widget.Toolbar
+		android:id="@+id/toolbar"
+		style="@style/BriarToolbar"
+		android:layout_width="match_parent"
+		android:layout_height="wrap_content"
+		android:background="?attr/colorPrimary"
+		android:minHeight="?attr/actionBarSize"
+		/>
+
+	<FrameLayout
+		android:layout_width="match_parent"
+		android:layout_height="match_parent">
+
+		<FrameLayout
+			android:id="@+id/content_fragment"
+			android:layout_width="match_parent"
+			android:layout_height="match_parent"
+			android:background="@color/default_background"/>
+
+		<RelativeLayout
+			android:id="@+id/container_progress"
+			android:layout_width="match_parent"
+			android:layout_height="match_parent"
+			android:layout_gravity="center"
+			android:background="@color/default_background"
+			android:visibility="invisible"
+			tools:visibility="visible">
+
+			<ProgressBar
+				android:id="@+id/progress_bar"
+				style="?android:attr/progressBarStyleLargeInverse"
+				android:layout_width="wrap_content"
+				android:layout_height="wrap_content"
+				android:layout_centerInParent="true"/>
+
+			<TextView
+				android:id="@+id/title_progress_bar"
+				android:layout_width="match_parent"
+				android:layout_height="wrap_content"
+				android:layout_below="@id/progress_bar"
+				android:gravity="center"
+				android:paddingTop="@dimen/margin_large"
+				tools:text="progress bar title"
+				/>
+
+		</RelativeLayout>
+
+	</FrameLayout>
+</LinearLayout>
\ No newline at end of file
-- 
GitLab