Browse Source

Merge remote-tracking branch 'origin/release-1.7.2' into release-1.7.2

David A. Velasco 9 years ago
parent
commit
8c5b2b7b13

+ 1 - 1
AndroidManifest.xml

@@ -36,7 +36,7 @@
     <uses-permission android:name="android.permission.WAKE_LOCK"/>
     
     <uses-sdk
-        android:minSdkVersion="8"
+        android:minSdkVersion="14"
         android:targetSdkVersion="19" />
 
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >

+ 21 - 8
res/layout/uploader_layout.xml

@@ -21,15 +21,28 @@
 	android:layout_height="wrap_content" android:orientation="vertical"
 	android:layout_width="wrap_content" android:background="#fefefe"
 	android:gravity="center">
-	<TextView android:layout_width="fill_parent" android:text="@string/uploader_top_message"
-		android:layout_height="wrap_content" android:id="@+id/drawer_username" android:textColor="@android:color/black"
-		android:gravity="center_horizontal"></TextView>
+
+	<TextView android:layout_width="fill_parent"
+		android:text="@string/uploader_top_message"
+		android:layout_height="wrap_content"
+		android:id="@+id/drawer_username"
+		android:textColor="@android:color/black"
+		android:gravity="center_horizontal">
+	</TextView>
+
 	<FrameLayout android:layout_height="fill_parent"
-		android:layout_width="fill_parent" android:id="@+id/frameLayout1"
-		android:layout_below="@+id/drawer_username" android:layout_above="@+id/linearLayout1">
-		<ListView android:id="@android:id/list" android:layout_width="fill_parent"
-			android:layout_height="fill_parent" android:divider="@drawable/uploader_list_separator"
-			android:dividerHeight="1dip"></ListView>
+		android:layout_width="fill_parent"
+		android:id="@+id/frameLayout1"
+		android:layout_below="@+id/drawer_username"
+		android:layout_above="@+id/linearLayout1">
+
+		<ListView android:id="@android:id/list"
+			android:layout_width="fill_parent"
+			android:layout_height="fill_parent"
+			android:divider="@drawable/uploader_list_separator"
+			android:dividerHeight="1dip">
+		</ListView>
+
 	</FrameLayout>
 
 	<LinearLayout

+ 1 - 1
res/layout/uploader_list_item_layout.xml

@@ -35,7 +35,7 @@
     <TextView 
         android:text="TextView" 
         android:layout_width="fill_parent" 
-        android:id="@+id/drawer_username" 
+        android:id="@+id/filename"
         android:layout_height="wrap_content" 
         android:textColor="@android:color/black"
 		android:layout_gravity="center_vertical"

+ 12 - 6
res/values/strings.xml

@@ -72,12 +72,8 @@
     <string name="uploader_info_uploading">Uploading</string>
     <string name="file_list_seconds_ago">seconds ago</string>
     <string name="file_list_empty">Nothing in here. Upload something!</string>
-    <string name="file_list_loading">Loading...</string>
+    <string name="file_list_loading">Loading&#8230;</string>
     <string name="local_file_list_empty">There are no files in this folder.</string>
-    <string name="file_list_folder">folder</string>
-    <string name="file_list_folders">folders</string>
-    <string name="file_list_file">file</string>
-    <string name="file_list_files">files</string>
     <string name="filedetails_select_file">Tap on a file to display additional information.</string>
     <string name="filedetails_size">Size:</string>
     <string name="filedetails_type">Type:</string>
@@ -301,7 +297,7 @@
 	<string name="network_error_connect_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
 	<string name="network_host_not_available">The operation couldn\'t be completed, server is unavailable</string>
 
-	<string name="empty"></string>
+	<string name="empty" />
 	
 	<string name="forbidden_permissions">You do not have permission %s</string>
 	<string name="forbidden_permissions_rename">to rename this file</string>
@@ -350,4 +346,14 @@
     <string name="common_error_out_memory">Not enough memory</string>
 
     <string name="username">Username</string>
+
+    <string name="file_list__footer__folder">1 folder</string>
+    <string name="file_list__footer__folders">%1$d folders</string>
+    <string name="file_list__footer__file">1 file</string>
+    <string name="file_list__footer__file_and_folder">1 file, 1 folder</string>
+    <string name="file_list__footer__file_and_folders">1 file, %1$d folders</string>
+    <string name="file_list__footer__files">%1$d files</string>
+    <string name="file_list__footer__files_and_folder">%1$d files, 1 folder</string>
+    <string name="file_list__footer__files_and_folders">%1$d files, %1$d folders</string>
+
 </resources>

+ 1 - 1
src/com/owncloud/android/ui/activity/Uploader.java

@@ -426,7 +426,7 @@ public class Uploader extends FileActivity
                                                 data,
                                                 R.layout.uploader_list_item_layout,
                                                 new String[] {"dirname"},
-                                                new int[] {R.id.textView1});
+                                                new int[] {R.id.filename});
             
             mListView.setAdapter(sa);
             Button btnChooseFolder = (Button) findViewById(R.id.uploader_choose_folder);

+ 39 - 15
src/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -438,23 +438,47 @@ public class OCFileListFragment extends ExtendedListFragment {
     }
 
     private String generateFooterText(int filesCount, int foldersCount) {
-        String output = "";
-        if (filesCount > 0){
-            if (filesCount == 1) {
-                output = output + filesCount + " " + getResources().getString(R.string.file_list_file);
-            } else {
-                output = output + filesCount + " " + getResources().getString(R.string.file_list_files);
+        String output;
+        if (filesCount <= 0) {
+            if (foldersCount <= 0) {
+                output = "";
+
+            } else if (foldersCount == 1) {
+                output = getResources().getString(R.string.file_list__footer__folder);
+
+            } else { // foldersCount > 1
+                output = getResources().getString(R.string.file_list__footer__folders);
+                String.format(output, foldersCount);
+
             }
-        }
-        if (foldersCount > 0 && filesCount > 0){
-            output = output + ", ";
-        }
-        if (foldersCount == 1) {
-            output = output + foldersCount + " " + getResources().getString(R.string.file_list_folder);
-        } else if (foldersCount > 1) {
-            output = output + foldersCount + " " + getResources().getString(R.string.file_list_folders);
-        }
 
+        } else if (filesCount == 1) {
+            if (foldersCount <= 0) {
+                output = getResources().getString(R.string.file_list__footer__file);
+
+            } else if (foldersCount == 1) {
+                output = getResources().getString(R.string.file_list__footer__file_and_folder);
+
+            } else { // foldersCount > 1
+                output = getResources().getString(R.string.file_list__footer__file_and_folders);
+                String.format(output, foldersCount);
+
+            }
+        } else {    // filesCount > 1
+            if (foldersCount <= 0) {
+                output = getResources().getString(R.string.file_list__footer__files);
+                String.format(output, filesCount);
+
+            } else if (foldersCount == 1) {
+                output = getResources().getString(R.string.file_list__footer__files_and_folder);
+                String.format(output, filesCount);
+
+            } else { // foldersCount > 1
+                output = getResources().getString(R.string.file_list__footer__files_and_folders);
+                String.format(output, filesCount, foldersCount);
+
+            }
+        }
         return output;
     }