Merge pull request #453 from owncloud/improve_action_bar_pr_392_with_develop
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / InstantUploadActivity.java
index e868bda..0d455bd 100644 (file)
@@ -2,8 +2,8 @@
  *   Copyright (C) 2012-2013 ownCloud Inc.
  *
  *   This program is free software: you can redistribute it and/or modify
  *   Copyright (C) 2012-2013 ownCloud Inc.
  *
  *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation, either version 3 of the License.
+ *   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
  *
  *   This program is distributed in the hope that it will be useful,
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,6 +19,14 @@ package com.owncloud.android.ui.activity;
 import java.util.ArrayList;
 import java.util.List;
 
 import java.util.ArrayList;
 import java.util.List;
 
+import com.owncloud.android.R;
+import com.owncloud.android.authentication.AccountUtils;
+import com.owncloud.android.db.DbHandler;
+import com.owncloud.android.files.InstantUploadBroadcastReceiver;
+import com.owncloud.android.files.services.FileUploader;
+import com.owncloud.android.utils.FileStorageUtils;
+import com.owncloud.android.utils.Log_OC;
+
 import android.accounts.Account;
 import android.app.Activity;
 import android.content.Intent;
 import android.accounts.Account;
 import android.app.Activity;
 import android.content.Intent;
@@ -26,7 +34,6 @@ import android.database.Cursor;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.os.Bundle;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.os.Bundle;
-import android.util.Log;
 import android.util.SparseArray;
 import android.view.Gravity;
 import android.view.View;
 import android.util.SparseArray;
 import android.view.Gravity;
 import android.view.View;
@@ -42,13 +49,6 @@ import android.widget.LinearLayout;
 import android.widget.TextView;
 import android.widget.Toast;
 
 import android.widget.TextView;
 import android.widget.Toast;
 
-import com.owncloud.android.AccountUtils;
-import com.owncloud.android.Log_OC;
-import com.owncloud.android.R;
-import com.owncloud.android.db.DbHandler;
-import com.owncloud.android.files.InstantUploadBroadcastReceiver;
-import com.owncloud.android.files.services.FileUploader;
-import com.owncloud.android.utils.FileStorageUtils;
 
 /**
  * This Activity is used to display a list with images they could not be
 
 /**
  * This Activity is used to display a list with images they could not be
@@ -59,16 +59,6 @@ import com.owncloud.android.utils.FileStorageUtils;
  * sub-menu underneath the 'Upload' menu-item
  * 
  * @author andomaex / Matthias Baumann
  * sub-menu underneath the 'Upload' menu-item
  * 
  * @author andomaex / Matthias Baumann
- * 
- *         This program is free software: you can redistribute it and/or modify
- *         it under the terms of the GNU General Public License as published by
- *         the Free Software Foundation, either version 3 of the License. (at
- *         your option) any later version.
- * 
- *         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 de/
  */
 public class InstantUploadActivity extends Activity {
 
  */
 public class InstantUploadActivity extends Activity {
 
@@ -87,14 +77,14 @@ public class InstantUploadActivity extends Activity {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.failed_upload_files);
 
         super.onCreate(savedInstanceState);
         setContentView(R.layout.failed_upload_files);
 
-        Button delete_all_btn = (Button) findViewById(R.id.failed_upload_delete_all_btn);
-        delete_all_btn.setOnClickListener(getDeleteListner());
-        Button retry_all_btn = (Button) findViewById(R.id.failed_upload_retry_all_btn);
-        retry_all_btn.setOnClickListener(getRetryListner());
+        Button deleteAllBtn = (Button) findViewById(R.id.failed_upload_delete_all_btn);
+        deleteAllBtn.setOnClickListener(getDeleteListner());
+        Button retryAllBtn = (Button) findViewById(R.id.failed_upload_retry_all_btn);
+        retryAllBtn.setOnClickListener(getRetryListner());
         this.failed_upload_all_cb = (CheckBox) findViewById(R.id.failed_upload_headline_cb);
         failed_upload_all_cb.setOnCheckedChangeListener(getCheckAllListener());
         listView = (LinearLayout) findViewById(R.id.failed_upload_scrollviewlayout);
         this.failed_upload_all_cb = (CheckBox) findViewById(R.id.failed_upload_headline_cb);
         failed_upload_all_cb.setOnCheckedChangeListener(getCheckAllListener());
         listView = (LinearLayout) findViewById(R.id.failed_upload_scrollviewlayout);
-
+        
         loadListView(true);
 
     }
         loadListView(true);
 
     }
@@ -160,7 +150,7 @@ public class InstantUploadActivity extends Activity {
                 loadmoreBtn = new Button(this);
                 loadmoreBtn.setId(42);
                 loadmoreBtn.setText(getString(R.string.failed_upload_load_more_images));
                 loadmoreBtn = new Button(this);
                 loadmoreBtn.setId(42);
                 loadmoreBtn.setText(getString(R.string.failed_upload_load_more_images));
-                loadmoreBtn.setBackgroundResource(R.color.owncloud_white);
+                loadmoreBtn.setBackgroundResource(R.color.background_color);
                 loadmoreBtn.setTextSize(12);
                 loadmoreBtn.setOnClickListener(new OnClickListener() {
                     @Override
                 loadmoreBtn.setTextSize(12);
                 loadmoreBtn.setOnClickListener(new OnClickListener() {
                     @Override
@@ -339,14 +329,14 @@ public class InstantUploadActivity extends Activity {
 
         TextView failureTextView = new TextView(this);
         failureTextView.setText(getString(R.string.failed_upload_failure_text) + message);
 
         TextView failureTextView = new TextView(this);
         failureTextView.setText(getString(R.string.failed_upload_failure_text) + message);
-        failureTextView.setBackgroundResource(R.color.owncloud_white);
+        failureTextView.setBackgroundResource(R.color.background_color);
         failureTextView.setTextSize(8);
         failureTextView.setOnLongClickListener(getOnLongClickListener(message));
         failureTextView.setPadding(5, 5, 5, 10);
         TextView retryButton = new TextView(this);
         retryButton.setId(id);
         retryButton.setText(img_path);
         failureTextView.setTextSize(8);
         failureTextView.setOnLongClickListener(getOnLongClickListener(message));
         failureTextView.setPadding(5, 5, 5, 10);
         TextView retryButton = new TextView(this);
         retryButton.setId(id);
         retryButton.setText(img_path);
-        retryButton.setBackgroundResource(R.color.owncloud_white);
+        retryButton.setBackgroundResource(R.color.background_color);
         retryButton.setTextSize(8);
         retryButton.setOnClickListener(getImageButtonOnClickListener(img_path));
         retryButton.setOnLongClickListener(getOnLongClickListener(message));
         retryButton.setTextSize(8);
         retryButton.setOnClickListener(getImageButtonOnClickListener(img_path));
         retryButton.setOnLongClickListener(getOnLongClickListener(message));
@@ -363,7 +353,7 @@ public class InstantUploadActivity extends Activity {
 
             @Override
             public boolean onLongClick(View v) {
 
             @Override
             public boolean onLongClick(View v) {
-                Log.d(LOG_TAG, message);
+                Log_OC.d(LOG_TAG, message);
                 Toast toast = Toast.makeText(InstantUploadActivity.this, getString(R.string.failed_upload_retry_text)
                         + message, Toast.LENGTH_LONG);
                 toast.show();
                 Toast toast = Toast.makeText(InstantUploadActivity.this, getString(R.string.failed_upload_retry_text)
                         + message, Toast.LENGTH_LONG);
                 toast.show();
@@ -376,7 +366,7 @@ public class InstantUploadActivity extends Activity {
     private CheckBox getFileCheckbox(int id) {
         CheckBox retryCB = new CheckBox(this);
         retryCB.setId(id);
     private CheckBox getFileCheckbox(int id) {
         CheckBox retryCB = new CheckBox(this);
         retryCB.setId(id);
-        retryCB.setBackgroundResource(R.color.owncloud_white);
+        retryCB.setBackgroundResource(R.color.background_color);
         retryCB.setTextSize(8);
         retryCB.setTag(retry_chexbox_tag);
         return retryCB;
         retryCB.setTextSize(8);
         retryCB.setTag(retry_chexbox_tag);
         return retryCB;
@@ -440,7 +430,7 @@ public class InstantUploadActivity extends Activity {
      */
     private void startUpload(String img_path) {
         // extract filename
      */
     private void startUpload(String img_path) {
         // extract filename
-        String filename = FileStorageUtils.getInstantUploadFilePath(img_path);
+        String filename = FileStorageUtils.getInstantUploadFilePath(this, img_path);
         if (canInstantUpload()) {
             Account account = AccountUtils.getCurrentOwnCloudAccount(InstantUploadActivity.this);
             // add file again to upload queue
         if (canInstantUpload()) {
             Account account = AccountUtils.getCurrentOwnCloudAccount(InstantUploadActivity.this);
             // add file again to upload queue