Эх сурвалжийг харах

Merge branch 'release-1.8' of https://github.com/owncloud/android into material_buttons

Andy Scherzinger 9 жил өмнө
parent
commit
5417b2a4e5

+ 12 - 9
res/layout-land/account_setup.xml

@@ -57,16 +57,18 @@
 			    android:gravity="center"
 			    android:orientation="vertical"
 			    android:padding="8dp" >
-			    
-				<Button
-				    android:id="@+id/centeredRefreshButton"
-				    android:layout_width="wrap_content"
-				    android:layout_height="wrap_content"
-				    android:layout_gravity="center_horizontal"
+
+				<android.support.v7.widget.AppCompatButton
+					android:id="@+id/centeredRefreshButton"
+					style="@style/ownCloud.Button"
+					android:layout_width="wrap_content"
+					android:layout_height="wrap_content"
+					android:layout_gravity="center_horizontal"
 					android:layout_marginBottom="10dp"
-				    android:text="@string/auth_check_server"
-				    android:visibility="gone"
-                    android:contentDescription="@string/auth_check_server"/>
+					android:text="@string/auth_check_server"
+					android:visibility="gone"
+					android:contentDescription="@string/auth_check_server"/>
+
 				<TextView
 				    android:id="@+id/instructions_message"
 				    android:layout_width="wrap_content"
@@ -224,6 +226,7 @@
 		<android.support.v7.widget.AppCompatButton
 		    android:id="@+id/buttonOK"
 			android:theme="@style/Button.Primary"
+			style="@style/Button.Primary"
 		    android:layout_width="match_parent"
 		    android:layout_height="wrap_content"
 		    android:layout_gravity="center_horizontal"

+ 1 - 0
res/layout/account_setup.xml

@@ -40,6 +40,7 @@
             android:layout_height="wrap_content"
             android:layout_marginBottom="20dp"
             android:layout_marginTop="10dp"
+            android:background="@color/login_logo_background_color"
             android:src="@drawable/logo"
             android:contentDescription="@string/app_name"/>
 

+ 1 - 0
src/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -1378,6 +1378,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
     public void onAuthenticatorTaskCallback(RemoteOperationResult result) {
         mWaitingForOpId = Long.MAX_VALUE;
         dismissDialog(WAIT_DIALOG_TAG);
+        mAsyncTask = null;
 
         if (result.isSuccess()) {
             Log_OC.d(TAG, "Successful access - time to save the account");

+ 7 - 5
src/com/owncloud/android/providers/FileContentProvider.java

@@ -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 =

+ 1 - 1
src/com/owncloud/android/ui/preview/PreviewImageFragment.java

@@ -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();
             }
         }

+ 3 - 3
src/com/owncloud/android/utils/FileStorageUtils.java

@@ -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";