Merge branch 'release-1.8' of https://github.com/owncloud/android into material_buttons
authorAndy Scherzinger <info@andy-scherzinger.de>
Fri, 25 Sep 2015 14:09:01 +0000 (16:09 +0200)
committerAndy Scherzinger <info@andy-scherzinger.de>
Fri, 25 Sep 2015 14:09:01 +0000 (16:09 +0200)
res/layout-land/account_setup.xml
res/layout/account_setup.xml
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/providers/FileContentProvider.java
src/com/owncloud/android/ui/preview/PreviewImageFragment.java
src/com/owncloud/android/utils/FileStorageUtils.java

index 3c7677d..477011d 100644 (file)
                            android:gravity="center"\r
                            android:orientation="vertical"\r
                            android:padding="8dp" >\r
-                           \r
-                               <Button\r
-                                   android:id="@+id/centeredRefreshButton"\r
-                                   android:layout_width="wrap_content"\r
-                                   android:layout_height="wrap_content"\r
-                                   android:layout_gravity="center_horizontal"\r
+\r
+                               <android.support.v7.widget.AppCompatButton\r
+                                       android:id="@+id/centeredRefreshButton"\r
+                                       style="@style/ownCloud.Button"\r
+                                       android:layout_width="wrap_content"\r
+                                       android:layout_height="wrap_content"\r
+                                       android:layout_gravity="center_horizontal"\r
                                        android:layout_marginBottom="10dp"\r
-                                   android:text="@string/auth_check_server"\r
-                                   android:visibility="gone"\r
-                    android:contentDescription="@string/auth_check_server"/>\r
+                                       android:text="@string/auth_check_server"\r
+                                       android:visibility="gone"\r
+                                       android:contentDescription="@string/auth_check_server"/>\r
+\r
                                <TextView\r
                                    android:id="@+id/instructions_message"\r
                                    android:layout_width="wrap_content"\r
                <android.support.v7.widget.AppCompatButton\r
                    android:id="@+id/buttonOK"\r
                        android:theme="@style/Button.Primary"\r
+                       style="@style/Button.Primary"\r
                    android:layout_width="match_parent"\r
                    android:layout_height="wrap_content"\r
                    android:layout_gravity="center_horizontal"\r
index 7ac0f36..d5fd323 100644 (file)
@@ -40,6 +40,7 @@
             android:layout_height="wrap_content"\r
             android:layout_marginBottom="20dp"\r
             android:layout_marginTop="10dp"\r
+            android:background="@color/login_logo_background_color"\r
             android:src="@drawable/logo"\r
             android:contentDescription="@string/app_name"/>\r
 \r
index 73bd6e4..4173ca4 100644 (file)
@@ -1378,6 +1378,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
     public void onAuthenticatorTaskCallback(RemoteOperationResult result) {\r
         mWaitingForOpId = Long.MAX_VALUE;\r
         dismissDialog(WAIT_DIALOG_TAG);\r
+        mAsyncTask = null;\r
 \r
         if (result.isSuccess()) {\r
             Log_OC.d(TAG, "Successful access - time to save the account");\r
index a4e50ce..70cd897 100644 (file)
@@ -178,6 +178,7 @@ public class FileContentProvider extends ContentProvider {
             if (c != null && c.moveToFirst()) {
                 remoteId = c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID));
                 //ThumbnailsCacheManager.removeFileFromCache(remoteId);
+                c.close();
             }
             Log_OC.d(TAG, "Removing FILE " + remoteId);
 
@@ -187,11 +188,6 @@ public class FileContentProvider extends ContentProvider {
                             + uri.getPathSegments().get(1)
                             + (!TextUtils.isEmpty(where) ? " AND (" + where
                                     + ")" : ""), whereArgs);
-            /* just for log
-            if (c!=null) {
-                c.close();
-            }
-            */
             break;
         case DIRECTORY:
             // deletion of folder is recursive
@@ -306,6 +302,9 @@ public class FileContentProvider extends ContentProvider {
             // ugly patch; serious refactorization is needed to reduce work in
             // FileDataStorageManager and bring it to FileContentProvider
             if (doubleCheck == null || !doubleCheck.moveToFirst()) {
+                if (doubleCheck != null) {
+                    doubleCheck.close();
+                }
                 long rowId = db.insert(ProviderTableMeta.FILE_TABLE_NAME, null, values);
                 if (rowId > 0) {
                     Uri insertedFileUri =
@@ -341,6 +340,9 @@ public class FileContentProvider extends ContentProvider {
             // ugly patch; serious refactorization is needed to reduce work in
             // FileDataStorageManager and bring it to FileContentProvider
             if (doubleCheckShare == null || !doubleCheckShare.moveToFirst()) {
+                if (doubleCheckShare != null) {
+                    doubleCheckShare.close();
+                }
                 long rowId = db.insert(ProviderTableMeta.OCSHARES_TABLE_NAME, null, values);
                 if (rowId >0) {
                     insertedShareUri =
index b6f3682..e61e335 100644 (file)
@@ -476,7 +476,7 @@ public class PreviewImageFragment extends FileFragment {
 
         @Override
         protected void onCancelled(LoadImage result) {
-            if (result.bitmap != null) {
+            if (result != null && result.bitmap != null) {
                 result.bitmap.recycle();
             }
         }
index e70302f..d6ebdbd 100644 (file)
@@ -46,12 +46,12 @@ import android.webkit.MimeTypeMap;
  * Static methods to help in access to local file system.
  */
 public class FileStorageUtils {
-    public static Integer mSortOrder;
-    public static Boolean mSortAscending;
     public static final Integer SORT_NAME = 0;
     public static final Integer SORT_DATE = 1;
     public static final Integer SORT_SIZE = 2;
-  
+    public static Integer mSortOrder = SORT_NAME;
+    public static Boolean mSortAscending = true;
+
     
     //private static final String LOG_TAG = "FileStorageUtils";