Grant that progress bar in notifications is shown in Android 2.x and 3.x devices
[pub/Android/ownCloud.git] / res / layout / notification_with_progress_bar.xml
diff --git a/res/layout/notification_with_progress_bar.xml b/res/layout/notification_with_progress_bar.xml
new file mode 100644 (file)
index 0000000..00b530c
--- /dev/null
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+    ownCloud Android client application
+    Copyright (C) 2014 ownCloud Inc.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License version 2,
+    as published by the Free Software Foundation.
+  
+    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 General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:paddingTop="5dp"
+        android:paddingLeft="5dp"
+        >
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:paddingTop="3dp"
+        >
+        <ImageView android:id="@+id/icon"
+            android:layout_width="25dp"
+            android:layout_height="25dp"
+            android:scaleType="fitCenter"
+            android:background="@android:drawable/status_bar_item_app_background"
+            />
+        <TextView android:id="@+id/title"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:singleLine="true"
+            android:ellipsize="marquee"
+            android:fadingEdge="horizontal"
+            android:paddingLeft="4dp"
+                       android:textSize="18sp"
+               android:textStyle="bold"
+               android:textColor="?android:attr/textColorPrimaryInverse"
+            />
+    </LinearLayout>
+       <TextView android:id="@+id/text"
+           android:layout_width="match_parent"
+           android:layout_height="wrap_content"
+           android:singleLine="true"
+           android:ellipsize="marquee"
+           android:fadingEdge="horizontal"
+        android:textColor="?android:attr/textColorPrimaryInverse"
+           />
+    <FrameLayout android:id="@+id/progressHolder"
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:paddingTop="2dp"
+        android:paddingBottom="2dp"
+        >
+        <!--  the FrameLayout is needed to change visibility of the
+               progress bar in Android 2.2, even though 
+               https://code.google.com/p/android/issues/detail?id=11040 -->
+               <ProgressBar
+               android:id="@+id/progress"
+               android:layout_width="match_parent"
+               android:layout_height="match_parent"
+               style="?android:attr/progressBarStyleHorizontal"
+       />
+    </FrameLayout>
+</LinearLayout>