disable download button while downloading
authorBartek Przybylski <bart.p.pl@gmail.com>
Mon, 2 Jul 2012 16:28:31 +0000 (18:28 +0200)
committerBartek Przybylski <bart.p.pl@gmail.com>
Mon, 2 Jul 2012 16:28:31 +0000 (18:28 +0200)
src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java

index 1ab9284..9850b65 100644 (file)
@@ -152,6 +152,7 @@ public class FileDetailFragment extends SherlockFragment implements
         i.putExtra(FileDownloader.EXTRA_REMOTE_PATH, mFile.getRemotePath());\r
         i.putExtra(FileDownloader.EXTRA_FILE_PATH, mFile.getURLDecodedRemotePath());\r
         i.putExtra(FileDownloader.EXTRA_FILE_SIZE, mFile.getFileLength());\r
+        v.setEnabled(false);\r
         getActivity().startService(i);\r
     }\r
 \r
@@ -373,6 +374,7 @@ public class FileDetailFragment extends SherlockFragment implements
     private class DownloadFinishReceiver extends BroadcastReceiver {\r
         @Override\r
         public void onReceive(Context context, Intent intent) {\r
+            getView().findViewById(R.id.fdDownloadBtn).setEnabled(true);\r
             if (intent.getAction().equals(FileDownloader.BAD_DOWNLOAD_MESSAGE)) {\r
                 Toast.makeText(context, R.string.downloader_download_failed , Toast.LENGTH_SHORT).show();\r
                 \r