diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java b/owncloudApp/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java index adc720b7954..43eaee47fd3 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/owncloudApp/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -1,4 +1,4 @@ -/** +/* * ownCloud Android client application * * @author Bartek Przybylski @@ -57,6 +57,9 @@ import com.owncloud.android.utils.MimetypeIconUtil; import com.owncloud.android.utils.PreferenceUtils; +import org.jetbrains.annotations.NotNull; + + /** * This Fragment is used to display the details about a file. */ @@ -76,7 +79,7 @@ public class FileDetailFragment extends FileFragment implements OnClickListener /** * Public factory method to create new FileDetailFragment instances. - * + *
* When 'fileToDetail' or 'ocAccount' are null, creates a dummy layout (to use when a file wasn't tapped before). * * @param fileToDetail An {@link OCFile} to show in the fragment @@ -94,7 +97,7 @@ public static FileDetailFragment newInstance(OCFile fileToDetail, Account accoun /** * Creates an empty details fragment. - * + *
* It's necessary to keep a public constructor without parameters; the system uses it when tries
* to reinstantiate a fragment automatically.
*/
@@ -106,7 +109,7 @@ public FileDetailFragment() {
@Override
public void onActivityCreated(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
+ super.onActivityCreated(savedInstanceState);
setHasOptionsMenu(true);
mProgressController = new TransferProgressController((ComponentsGetter) getActivity());
ProgressBar progressBar = mView.findViewById(R.id.fdProgressBar);
@@ -128,8 +131,7 @@ public void onActivityCreated(Bundle savedInstanceState) {
}
@Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
+ public View onCreateView(@NotNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
setFile(getArguments().getParcelable(ARG_FILE));
mAccount = getArguments().getParcelable(ARG_ACCOUNT);
@@ -154,7 +156,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
}
@Override
- public void onSaveInstanceState(Bundle outState) {
+ public void onSaveInstanceState(@NotNull Bundle outState) {
super.onSaveInstanceState(outState);
outState.putParcelable(FileActivity.EXTRA_FILE, getFile());
outState.putParcelable(FileActivity.EXTRA_ACCOUNT, mAccount);
@@ -367,9 +369,9 @@ public boolean isEmpty() {
* Updates the view with all relevant details about that file.
*
* @param forcedTransferring Flag signaling if the file should be considered as downloading or uploading,
- * although {@link FileDownloaderBinder#isDownloading(Account, OCFile)} and
- * {@link FileUploaderBinder#isUploading(Account, OCFile)} return false.
- * @param refresh If 'true', try to refresh the whole file from the database
+ * although {@link FileDownloaderBinder#isDownloading(Account, OCFile)} and
+ * {@link FileUploaderBinder#isUploading(Account, OCFile)} return false.
+ * @param refresh If 'true', try to refresh the whole file from the database
*/
private void updateFileDetails(boolean forcedTransferring, boolean refresh) {
if (readyToShow()) {
@@ -431,6 +433,7 @@ private void setFilename(String filename) {
/**
* Updates the MIME type in view
+ *
* @param file : An {@link OCFile}
*/
private void setFiletype(OCFile file) {
diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/preview/ImageViewCustom.java b/owncloudApp/src/main/java/com/owncloud/android/ui/preview/ImageViewCustom.java
deleted file mode 100644
index f8b5fb37359..00000000000
--- a/owncloudApp/src/main/java/com/owncloud/android/ui/preview/ImageViewCustom.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package com.owncloud.android.ui.preview;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.os.Build;
-import android.util.AttributeSet;
-import android.view.View;
-import android.widget.ImageView;
-
-import com.owncloud.android.lib.common.utils.Log_OC;
-
-public class ImageViewCustom extends ImageView {
-
- private static final String TAG = ImageViewCustom.class.getSimpleName();
-
- private static final boolean IS_ICS_OR_HIGHER = Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
- private static final boolean IS_VERSION_BUGGY_ON_RECYCLES =
- Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN_MR1 ||
- Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN_MR2;
-
- private int mBitmapHeight;
- private int mBitmapWidth;
-
- public ImageViewCustom(Context context) {
- super(context);
- }
-
- public ImageViewCustom(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public ImageViewCustom(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
-
- @SuppressLint("NewApi")
- @Override
- protected void onDraw(Canvas canvas) {
-
- if (IS_ICS_OR_HIGHER && checkIfMaximumBitmapExceed(canvas) || IS_VERSION_BUGGY_ON_RECYCLES) {
- // Software type is set with two targets:
- // 1. prevent that bitmaps larger than maximum textures allowed are shown as black views in devices
- // with LAYER_TYPE_HARDWARE enabled by default;
- // 2. grant that bitmaps are correctly dellocated from memory in versions suffering the bug fixed in
- // https://android.googlesource.com/platform/frameworks/base/+/034de6b1ec561797a2422314e6ef03e3cd3e08e0;
- //
- setLayerType(View.LAYER_TYPE_SOFTWARE, null);
- }
-
- super.onDraw(canvas);
- }
-
- /**
- * Checks if current bitmaps exceed the maximum OpenGL texture size limit
- *
- * @param canvas Canvas where the view will be drawn into.
- * @return boolean True means that the bitmap is too big for the canvas.
- */
- @SuppressLint("NewApi")
- private boolean checkIfMaximumBitmapExceed(Canvas canvas) {
- Log_OC.v(TAG, "Canvas maximum: " + canvas.getMaximumBitmapWidth() + " - " + canvas.getMaximumBitmapHeight());
- return mBitmapWidth > canvas.getMaximumBitmapWidth()
- || mBitmapHeight > canvas.getMaximumBitmapHeight();
-
- }
-
- @Override
- /**
- * Keeps the size of the bitmap cached in member variables for faster access in {@link #onDraw(Canvas)} ,
- * but without keeping another reference to the {@link Bitmap}
- */
- public void setImageBitmap(Bitmap bm) {
- mBitmapWidth = bm.getWidth();
- mBitmapHeight = bm.getHeight();
- super.setImageBitmap(bm);
- }
-
-}
diff --git a/owncloudApp/src/main/java/third_parties/in/srain/cube/GridViewWithHeaderAndFooter.java b/owncloudApp/src/main/java/third_parties/in/srain/cube/GridViewWithHeaderAndFooter.java
index a756ee3316e..54e6f343813 100644
--- a/owncloudApp/src/main/java/third_parties/in/srain/cube/GridViewWithHeaderAndFooter.java
+++ b/owncloudApp/src/main/java/third_parties/in/srain/cube/GridViewWithHeaderAndFooter.java
@@ -55,7 +55,7 @@ private static class FixedViewInfo {
* The view to add to the grid
*/
public View view;
- public ViewGroup viewContainer;
+ ViewGroup viewContainer;
/**
* The data backing the view. This is returned from {@link android.widget.ListAdapter#getItem(int)}.
*/
@@ -63,16 +63,15 @@ private static class FixedViewInfo {
/**
* true
if the fixed view should be selectable in the grid
*/
- public boolean isSelectable;
+ boolean isSelectable;
}
- private int mNumColumns = AUTO_FIT;
private View mViewForMeasureRowHeight = null;
private int mRowHeight = -1;
- private static final String LOG_TAG = "grid-view-with-header-and-footer";
+ private static final String LOG_TAG = "grid-view-header-footer";
- private ArrayList