Merge branch 'develop' into release-1.6.0
authorDavid A. Velasco <dvelasco@solidgear.es>
Thu, 18 Sep 2014 12:27:13 +0000 (14:27 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Thu, 18 Sep 2014 12:27:13 +0000 (14:27 +0200)
AndroidManifest.xml
oc_jb_workaround/AndroidManifest.xml
res/drawable-hdpi/folder_public.png
res/drawable-hdpi/sharedlink.png
res/drawable-mdpi/folder_public.png
res/drawable-mdpi/sharedlink.png
res/drawable-xhdpi/sharedlink.png
res/layout/file_download_fragment.xml
res/values/strings.xml
src/com/owncloud/android/ui/preview/FileDownloadFragment.java
src/com/owncloud/android/ui/preview/PreviewImageFragment.java

index 2671cce..910ea78 100644 (file)
@@ -18,8 +18,8 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->
 <manifest package="com.owncloud.android"
-    android:versionCode="10500800"
-    android:versionName="1.5.8" xmlns:android="http://schemas.android.com/apk/res/android">
+    android:versionCode="10600000"
+    android:versionName="1.6.0" xmlns:android="http://schemas.android.com/apk/res/android">
 
     <uses-permission android:name="android.permission.GET_ACCOUNTS" />
     <uses-permission android:name="android.permission.USE_CREDENTIALS" />
index 9fa39b3..b8b89c1 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.owncloud.android.workaround.accounts"
-    android:versionCode="0100017"
-    android:versionName="1.0.17" >
+    android:versionCode="0100018"
+    android:versionName="1.0.18" >
 
     <uses-sdk
         android:minSdkVersion="16"
index 00f71c2..337aba9 100644 (file)
Binary files a/res/drawable-hdpi/folder_public.png and b/res/drawable-hdpi/folder_public.png differ
index 071c622..a3c42a9 100644 (file)
Binary files a/res/drawable-hdpi/sharedlink.png and b/res/drawable-hdpi/sharedlink.png differ
index bffdace..374cf91 100644 (file)
Binary files a/res/drawable-mdpi/folder_public.png and b/res/drawable-mdpi/folder_public.png differ
index 95ab180..772838a 100644 (file)
Binary files a/res/drawable-mdpi/sharedlink.png and b/res/drawable-mdpi/sharedlink.png differ
index f474b48..9ef8f3e 100644 (file)
Binary files a/res/drawable-xhdpi/sharedlink.png and b/res/drawable-xhdpi/sharedlink.png differ
index f881847..8f571dc 100644 (file)
@@ -16,6 +16,7 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/fileDownloadLL"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" 
index dd5fe98..d80a79b 100644 (file)
 
        <string name="prefs_category_accounts">Accounts</string>
        <string name="prefs_add_account">Add account</string>
-       <string name="auth_redirect_non_secure_connection_title">Secure connection is redirected through an unsecured route.</string>
+       <string name="auth_redirect_non_secure_connection_title">Secure connection is redirected to an unsecured route.</string>
 
        <string name="actionbar_logger">Logs</string>
        <string name="log_send_history_button">Send History</string>
index b8489b5..98bbda3 100644 (file)
@@ -32,6 +32,7 @@ import android.view.View;
 import android.view.View.OnClickListener;
 import android.view.ViewGroup;
 import android.widget.ImageButton;
+import android.widget.LinearLayout;
 import android.widget.ProgressBar;
 import android.widget.TextView;
 
@@ -126,6 +127,13 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
         
         ((ImageButton)mView.findViewById(R.id.cancelBtn)).setOnClickListener(this);
         
+        ((LinearLayout)mView.findViewById(R.id.fileDownloadLL)).setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                ((PreviewImageActivity) getActivity()).toggleFullScreen();
+            }
+        });
+
         if (mError) {
             setButtonsForRemote();
         } else {
index 8e3afaf..51585c6 100644 (file)
@@ -19,16 +19,12 @@ package com.owncloud.android.ui.preview;
 import java.lang.ref.WeakReference;
 
 import android.accounts.Account;
-import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
-import android.graphics.BitmapFactory.Options;
-import android.graphics.Point;
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.support.v4.app.FragmentStatePagerAdapter;
-import android.view.Display;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View.OnClickListener;
@@ -363,58 +359,14 @@ public class PreviewImageFragment extends FileFragment {
         }
         
         
-        @SuppressWarnings("deprecation")
-        @SuppressLint({ "NewApi", "NewApi", "NewApi" }) // to avoid Lint errors since Android SDK r20
                @Override
         protected Bitmap doInBackground(String... params) {
             Bitmap result = null;
             if (params.length != 1) return result;
             String storagePath = params[0];
             try {
-                // set desired options that will affect the size of the bitmap
-                BitmapFactory.Options options = new Options();
-                options.inScaled = true;
-                options.inPurgeable = true;
-                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {
-                    options.inPreferQualityOverSpeed = false;
-                }
-                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
-                    options.inMutable = false;
-                }
-                // make a false load of the bitmap - just to be able to read outWidth, outHeight and outMimeType
-                options.inJustDecodeBounds = true;
-                BitmapFactory.decodeFile(storagePath, options);   
-                
-                int width = options.outWidth;
-                int height = options.outHeight;
-                int scale = 1;
-                
-                Display display = getActivity().getWindowManager().getDefaultDisplay();
-                Point size = new Point();
-                int screenWidth;
-                int screenHeight;
-                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR2) {
-                    display.getSize(size);
-                    screenWidth = size.x;
-                    screenHeight = size.y;
-                } else {
-                    screenWidth = display.getWidth();
-                    screenHeight = display.getHeight();
-                }
-
-                if (width > screenWidth) {
-                    // second try to scale down the image , this time depending upon the screen size 
-                    scale = (int) Math.floor((float)width / screenWidth);
-                }
-                if (height > screenHeight) {
-                    scale = Math.max(scale, (int) Math.floor((float)height / screenHeight));
-                }
-                options.inSampleSize = scale;
-
-                // really load the bitmap
-                options.inJustDecodeBounds = false; // the next decodeFile call will be real
-                result = BitmapFactory.decodeFile(storagePath, options);
-                //Log_OC.d(TAG, "Image loaded - width: " + options.outWidth + ", loaded height: " + options.outHeight);
+                //Decode file into a bitmap in real size for being able to make zoom on the image
+                result = BitmapFactory.decodeFile(storagePath);
 
                 if (result == null) {
                     mErrorMessageId = R.string.preview_image_error_unknown_format;