From: David A. Velasco Date: Wed, 22 Aug 2012 11:53:03 +0000 (+0200) Subject: Fixed crash when sending nothing to the Uploader activity; slightly more prettier UI X-Git-Tag: oc-android-1.4.3~197 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/4e57c008b7c3975745a637780687bee7ad1563e8 Fixed crash when sending nothing to the Uploader activity; slightly more prettier UI --- diff --git a/res/layout/uploader_list_item_layout.xml b/res/layout/uploader_list_item_layout.xml index 12ac1edb..a5688e03 100644 --- a/res/layout/uploader_list_item_layout.xml +++ b/res/layout/uploader_list_item_layout.xml @@ -17,10 +17,27 @@ along with this program. If not, see . --> - - + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:background="#fefefe" + android:orientation="horizontal" + android:layout_height="56dp" > + + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 89e749f4..750f4600 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -60,6 +60,8 @@ There are no ownCloud accounts on your device. Please setup an account first. Setup Quit + No content to upload + No content was received. Nothing to upload. ownCloud is not allowed to access the shared content Uploading Create directory for upload diff --git a/src/com/owncloud/android/Uploader.java b/src/com/owncloud/android/Uploader.java index c3414b35..6f650d7b 100644 --- a/src/com/owncloud/android/Uploader.java +++ b/src/com/owncloud/android/Uploader.java @@ -85,7 +85,7 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro private final static int DIALOG_WAITING = 1; private final static int DIALOG_NO_STREAM = 2; private final static int DIALOG_MULTIPLE_ACCOUNT = 3; - private final static int DIALOG_GET_DIRNAME = 4; + //private final static int DIALOG_GET_DIRNAME = 4; private final static int REQUEST_CODE_SETUP_ACCOUNT = 0; @@ -107,7 +107,6 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro showDialog(DIALOG_MULTIPLE_ACCOUNT); } else { mAccount = accounts[0]; - setContentView(R.layout.uploader_layout); mStorageManager = new FileDataStorageManager(mAccount, getContentResolver()); populateDirectoryList(); } @@ -202,6 +201,17 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro } }); return builder.create(); + case DIALOG_NO_STREAM: + builder.setIcon(android.R.drawable.ic_dialog_alert); + builder.setTitle(R.string.uploader_wrn_no_content_title); + builder.setMessage(R.string.uploader_wrn_no_content_text); + builder.setCancelable(false); + builder.setNegativeButton(R.string.common_cancel, new OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + finish(); + } + }); + return builder.create(); default: throw new IllegalArgumentException("Unknown dialog id: " + id); } @@ -264,9 +274,9 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro uploadFiles(); break; - case android.R.id.button1: // dynamic action for create aditional dir + /*case android.R.id.button1: // dynamic action for create aditional dir showDialog(DIALOG_GET_DIRNAME); - break; + break;*/ default: throw new IllegalArgumentException("Wrong element clicked"); }