From 8d29b6318ccae2384834cff48a90d4dcf925562d Mon Sep 17 00:00:00 2001 From: grecep Date: Tue, 28 Oct 2014 20:50:09 +0100 Subject: [PATCH] removed unnecessary code --- .../ui/activity/UploadFilesActivity.java | 6 +--- .../ui/fragment/LocalFileListFragment.java | 30 ++++--------------- 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/src/com/owncloud/android/ui/activity/UploadFilesActivity.java b/src/com/owncloud/android/ui/activity/UploadFilesActivity.java index 3b2d1b4627..9eb5143b2a 100644 --- a/src/com/owncloud/android/ui/activity/UploadFilesActivity.java +++ b/src/com/owncloud/android/ui/activity/UploadFilesActivity.java @@ -154,10 +154,8 @@ public class UploadFilesActivity extends FileActivity implements } case R.id.actionbar_select_all:{ if(selectAllToggled){ - // deselect all toggleOffSelectAll(); }else{ - // select alls toggleOnSelectAll(item); } break; @@ -170,7 +168,6 @@ public class UploadFilesActivity extends FileActivity implements public void toggleOffSelectAll(MenuItem item){ selectAllToggled = false; item.setIcon(android.R.drawable.checkbox_off_background); -// mFileListFragment.listDirectory() mFileListFragment.deselectAll(); } public void toggleOffSelectAll(){ @@ -179,8 +176,7 @@ public class UploadFilesActivity extends FileActivity implements } public void toggleOnSelectAll(MenuItem item){ selectAllToggled = true; - item.setIcon(android.R.drawable.checkbox_on_background); - + item.setIcon(android.R.drawable.checkbox_on_background); mFileListFragment.selectAll(); } diff --git a/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java b/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java index 4cdf80fae0..2ce3745fb5 100644 --- a/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/LocalFileListFragment.java @@ -101,13 +101,10 @@ public class LocalFileListFragment extends ExtendedListFragment { int numberOfFiles = mAdapter.getCount(); for(int i = 0; i < numberOfFiles; i++){ File file = (File) mAdapter.getItem(i); - if (file != null) { - /// Click on a directory - if (file.isDirectory()) { - - } else { /// Click on a file - getListView().setItemChecked(i, true); - + if (file != null) { + if (!file.isDirectory()) { + /// Click on a file + getListView().setItemChecked(i, true); // notify the change to the container Activity mContainerActivity.onFileClick(file); } @@ -115,24 +112,7 @@ public class LocalFileListFragment extends ExtendedListFragment { } } - public void deselectAll(){ - /* - int numberOfFiles = mAdapter.getCount(); - for(int i = 0; i < numberOfFiles; i++){ - File file = (File) mAdapter.getItem(i); - if (file != null) { - /// Click on a directory - if (file.isDirectory()) { - - } else { /// Click on a file - if(getListView().isItemChecked(i)){ - getListView().setItemChecked(i, false); - } - // notify the change to the container Activity - mContainerActivity.onFileClick(file); - } - } - }*/ + public void deselectAll(){ mAdapter = new LocalFileListAdapter(mContainerActivity.getInitialDirectory(), getActivity()); setListAdapter(mAdapter); }