Update with changes after CR

This commit is contained in:
jabarros 2014-09-17 17:10:20 +02:00
parent 9127ca6906
commit 6da86f04f6
7 changed files with 32 additions and 32 deletions

View file

@ -110,7 +110,7 @@ public class SynchronizeFolderOperation extends RemoteOperation {
private boolean mRemoteFolderChanged;
/** 'True' means that Etag will be ignored */
private boolean mIgnoreTag;
private boolean mIgnoreETag;
/**
@ -129,7 +129,7 @@ public class SynchronizeFolderOperation extends RemoteOperation {
long currentSyncTime,
boolean syncFullAccount,
boolean isShareSupported,
boolean ignoreTag,
boolean ignoreETag,
FileDataStorageManager dataStorageManager,
Account account,
Context context ) {
@ -142,7 +142,7 @@ public class SynchronizeFolderOperation extends RemoteOperation {
mContext = context;
mForgottenLocalFiles = new HashMap<String, String>();
mRemoteFolderChanged = false;
mIgnoreTag = ignoreTag;
mIgnoreETag = ignoreETag;
}
@ -233,7 +233,7 @@ public class SynchronizeFolderOperation extends RemoteOperation {
if (result.isSuccess()){
OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
if (!mIgnoreTag) {
if (!mIgnoreETag) {
// check if remote and local folder are different
mRemoteFolderChanged = !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
}

View file

@ -111,7 +111,7 @@ import com.owncloud.android.utils.Log_OC;
public class FileDisplayActivity extends HookActivity implements
FileFragment.ContainerActivity, OnNavigationListener,
OnSslUntrustedCertListener, SwipeRefresh {
OnSslUntrustedCertListener, OnEnforceableRefreshListener {
private ArrayAdapter<String> mDirectories;
@ -1589,7 +1589,7 @@ OnSslUntrustedCertListener, SwipeRefresh {
return null;
}
public void startSyncFolderOperation(OCFile folder, boolean ignoreTag) {
public void startSyncFolderOperation(OCFile folder, boolean ignoreETag) {
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
@ -1599,7 +1599,7 @@ OnSslUntrustedCertListener, SwipeRefresh {
currentSyncTime,
false,
getFileOperationsHelper().isSharedSupported(),
ignoreTag,
ignoreETag,
getStorageManager(),
getAccount(),
getApplicationContext()
@ -1712,8 +1712,8 @@ OnSslUntrustedCertListener, SwipeRefresh {
}
@Override
public void onRefreshForced(boolean ignoreTag) {
refreshList(ignoreTag);
public void onRefresh(boolean ignoreETag) {
refreshList(ignoreETag);
}
@Override
@ -1721,14 +1721,14 @@ OnSslUntrustedCertListener, SwipeRefresh {
refreshList(true);
}
private void refreshList(boolean ignoreTag) {
private void refreshList(boolean ignoreETag) {
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
OCFile folder = listOfFiles.getCurrentFile();
if (folder != null) {
/*mFile = mContainerActivity.getStorageManager().getFileById(mFile.getFileId());
listDirectory(mFile);*/
startSyncFolderOperation(folder, ignoreTag);
startSyncFolderOperation(folder, ignoreETag);
}
}
}

View file

@ -206,7 +206,7 @@ public class MoveActivity extends HookActivity implements FileFragment.Container
}
public void startSyncFolderOperation(OCFile folder, boolean ignoreTag) {
public void startSyncFolderOperation(OCFile folder, boolean ignoreETag) {
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
@ -216,7 +216,7 @@ public class MoveActivity extends HookActivity implements FileFragment.Container
currentSyncTime,
false,
getFileOperationsHelper().isSharedSupported(),
ignoreTag,
ignoreETag,
getStorageManager(),
getAccount(),
getApplicationContext()

View file

@ -0,0 +1,10 @@
package com.owncloud.android.ui.activity;
import android.support.v4.widget.SwipeRefreshLayout;
public interface OnEnforceableRefreshListener extends SwipeRefreshLayout.OnRefreshListener {
public void onRefresh(boolean enforced);
}

View file

@ -1,10 +0,0 @@
package com.owncloud.android.ui.activity;
import android.support.v4.widget.SwipeRefreshLayout;
public interface SwipeRefresh extends SwipeRefreshLayout.OnRefreshListener {
public void onRefreshForced(boolean ingnoreTag);
}

View file

@ -34,14 +34,14 @@ import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragment;
import com.owncloud.android.R;
import com.owncloud.android.ui.ExtendedListView;
import com.owncloud.android.ui.activity.SwipeRefresh;
import com.owncloud.android.ui.activity.OnEnforceableRefreshListener;
import com.owncloud.android.utils.Log_OC;
/**
* TODO extending SherlockListFragment instead of SherlockFragment
*/
public class ExtendedListFragment extends SherlockFragment
implements OnItemClickListener, SwipeRefresh {
implements OnItemClickListener, OnEnforceableRefreshListener {
private static final String TAG = ExtendedListFragment.class.getSimpleName();
@ -64,7 +64,7 @@ implements OnItemClickListener, SwipeRefresh {
private ArrayList<Integer> mTops;
private int mHeightCell = 0;
private SwipeRefresh mOnRefreshListener = null;
private OnEnforceableRefreshListener mOnRefreshListener = null;
public void setListAdapter(ListAdapter listAdapter) {
@ -241,7 +241,7 @@ implements OnItemClickListener, SwipeRefresh {
}
}
public void setOnRefreshListener(SwipeRefresh listener) {
public void setOnRefreshListener(OnEnforceableRefreshListener listener) {
mOnRefreshListener = listener;
}
@ -302,12 +302,12 @@ implements OnItemClickListener, SwipeRefresh {
}
@Override
public void onRefreshForced(boolean ingnoreTag) {
public void onRefresh(boolean ignoreETag) {
mRefreshLayout.setRefreshing(false);
mRefreshEmptyLayout.setRefreshing(false);
if (mOnRefreshListener != null) {
mOnRefreshListener.onRefreshForced(ingnoreTag);
mOnRefreshListener.onRefresh(ignoreETag);
}
}
}

View file

@ -36,7 +36,7 @@ import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.FileMenuFilter;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.activity.MoveActivity;
import com.owncloud.android.ui.activity.SwipeRefresh;
import com.owncloud.android.ui.activity.OnEnforceableRefreshListener;
import com.owncloud.android.ui.adapter.FileListListAdapter;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
@ -89,7 +89,7 @@ public class OCFileListFragment extends ExtendedListFragment {
FileFragment.ContainerActivity.class.getSimpleName());
}
try {
setOnRefreshListener((SwipeRefresh) activity);
setOnRefreshListener((OnEnforceableRefreshListener) activity);
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString() + " must implement " +
@ -175,7 +175,7 @@ public class OCFileListFragment extends ExtendedListFragment {
listDirectory(mFile);
onRefreshForced(false);
onRefresh(false);
// restore index and top position
restoreIndexAndTopPosition();