浏览代码

cleanup

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 7 年之前
父节点
当前提交
15f549fc8e

+ 19 - 17
src/main/java/com/owncloud/android/ui/adapter/LocalFileListAdapter.java

@@ -1,21 +1,22 @@
 /*
- * ownCloud Android client application
+ * Nextcloud Android client application
+ *
+ * @author Tobias Kaminsky
+ * Copyright (C) 2018 Tobias Kaminsky
+ * Copyright (C) 2018 Nextcloud
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
  *
- * @author David A. Velasco
- * Copyright (C) 2011  Bartek Przybylski
- * Copyright (C) 2015 ownCloud Inc.
- * <p>
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2,
- * as published by the Free Software Foundation.
- * <p>
  * 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 details.
- * <p>
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 package com.owncloud.android.ui.adapter;
 
@@ -364,7 +365,8 @@ public class LocalFileListAdapter extends RecyclerView.Adapter<RecyclerView.View
 
     /**
      * Change the adapted directory for a new one
-     * @param directory     New file to adapt. Can be NULL, meaning "no content to adapt".
+     *
+     * @param directory New file to adapt. Can be NULL, meaning "no content to adapt".
      */
     public void swapDirectory(final File directory) {
         if (mLocalFolderPicker) {
@@ -429,7 +431,7 @@ public class LocalFileListAdapter extends RecyclerView.Adapter<RecyclerView.View
         }
     }
 
-    private ArrayList<File> getFiles(final File directory) {
+    private ArrayList<File> getFiles(File directory) {
         File[] files = directory.listFiles();
 
         if (files != null && files.length > 0) {
@@ -458,12 +460,12 @@ public class LocalFileListAdapter extends RecyclerView.Adapter<RecyclerView.View
     /**
      * Filter for hidden files
      *
-     * @param files             ArrayList of files to filter
+     * @param files ArrayList of files to filter
      * @return Non-hidden files
      */
     public ArrayList<File> filterHiddenFiles(ArrayList<File> files) {
         ArrayList<File> ret = new ArrayList<>();
-        
+
         for (File file : files) {
             if (!file.isHidden()) {
                 ret.add(file);

+ 13 - 18
src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java

@@ -1,25 +1,24 @@
 /*
- * ownCloud Android client application
+ * Nextcloud Android client application
  *
- * @author Bartek Przybylski
  * @author Tobias Kaminsky
- * @author David A. Velasco
- * @author masensio
- * Copyright (C) 2011  Bartek Przybylski
- * Copyright (C) 2016 ownCloud Inc.
+ * Copyright (C) 2018 Tobias Kaminsky
+ * Copyright (C) 2018 Nextcloud
  *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2,
- * as published by the Free Software Foundation.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or 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 details.
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+
 package com.owncloud.android.ui.adapter;
 
 
@@ -74,7 +73,6 @@ import java.util.HashSet;
 import java.util.Locale;
 import java.util.Vector;
 
-
 /**
  * This Adapter populates a RecyclerView with all files and folders in a Nextcloud instance.
  */
@@ -239,11 +237,8 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
 
     @Override
     public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
-        // TODO handle if file is null: if (mFiles != null && mFiles.size() > position)
-
         if (holder instanceof OCFileListFooterViewHolder) {
             ((OCFileListFooterViewHolder) holder).footerText.setText(getFooterText());
-
         } else {
             OCFileListGridViewHolder gridViewHolder = (OCFileListGridViewHolder) holder;
 
@@ -477,8 +472,8 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
      * @param updatedStorageManager Optional updated storage manager; used to replace
      *                              mStorageManager if is different (and not NULL)
      */
-    public void swapDirectory(OCFile directory, FileDataStorageManager updatedStorageManager
-            , boolean onlyOnDevice) {
+    public void swapDirectory(OCFile directory, FileDataStorageManager updatedStorageManager,
+                              boolean onlyOnDevice) {
         if (updatedStorageManager != null && !updatedStorageManager.equals(mStorageManager)) {
             mStorageManager = updatedStorageManager;
             mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);

+ 1 - 3
src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java

@@ -61,8 +61,7 @@ import java.util.Comparator;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
- * This Adapter populates a ListView with following types of uploads: pending,
- * active, completed. Filtering possible.
+ * This Adapter populates a ListView with following types of uploads: pending,active, completed. Filtering possible.
  */
 public class UploadListAdapter extends SectionedRecyclerViewAdapter<SectionedViewHolder> {
 
@@ -84,7 +83,6 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter<SectionedVie
     @Override
     public int getItemCount(int section) {
         return mUploadGroups[section].getItems().length;
-
     }
 
     @Override

+ 1 - 2
src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java

@@ -358,8 +358,7 @@ public class ExtendedListFragment extends Fragment
 
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                             Bundle savedInstanceState) {
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
         Log_OC.d(TAG, "onCreateView");
 
         View v = inflater.inflate(R.layout.list_fragment, null);

+ 15 - 15
src/main/java/com/owncloud/android/ui/fragment/LocalFileListFragment.java

@@ -1,21 +1,22 @@
-/**
- * ownCloud Android client application
+/*
+ * Nextcloud Android client application
+ *
+ * @author Tobias Kaminsky
+ * Copyright (C) 2018 Tobias Kaminsky
+ * Copyright (C) 2018 Nextcloud
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
  *
- * @author David A. Velasco
- * Copyright (C) 2011  Bartek Przybylski
- * Copyright (C) 2015 ownCloud Inc.
- * <p>
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2,
- * as published by the Free Software Foundation.
- * <p>
  * 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 details.
- * <p>
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 package com.owncloud.android.ui.fragment;
 
@@ -136,7 +137,6 @@ public class LocalFileListFragment extends ExtendedListFragment implements Local
         }
     }
 
-
     /**
      * Checks the file clicked over. Browses inside if it is a directory.
      * Notifies the container activity in any case.

+ 0 - 2
src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -120,7 +120,6 @@ import java.util.Set;
 
 /**
  * A Fragment that lists all files and folders in a given path.
- * <p>
  * TODO refactor to get rid of direct dependency on FileDisplayActivity
  */
 public class OCFileListFragment extends ExtendedListFragment implements OCFileListFragmentInterface {
@@ -1663,7 +1662,6 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi
             onMessageEvent(searchEvent);
 
             mRefreshListLayout.setRefreshing(false);
-//            mRefreshEmptyLayout.setRefreshing(false);
         } else {
             super.onRefresh();
         }

+ 1 - 1
src/main/java/com/owncloud/android/ui/interfaces/LocalFileListFragmentInterface.java

@@ -1,4 +1,4 @@
-/**
+/*
  * Nextcloud Android client application
  *
  * @author Mario Danic

+ 1 - 1
src/main/java/com/owncloud/android/ui/interfaces/OCFileListFragmentInterface.java

@@ -1,4 +1,4 @@
-/**
+/*
  * Nextcloud Android client application
  *
  * @author Mario Danic