import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
+import android.support.v4.widget.SwipeRefreshLayout;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
*/
public class FileDisplayActivity extends HookActivity implements
-FileFragment.ContainerActivity, OnNavigationListener, OnSslUntrustedCertListener {
-
+FileFragment.ContainerActivity, OnNavigationListener,
+OnSslUntrustedCertListener, SwipeRefreshLayout.OnRefreshListener {
+
private ArrayAdapter<String> mDirectories;
private SyncBroadcastReceiver mSyncBroadcastReceiver;
getSupportActionBar().setHomeButtonEnabled(true); // mandatory since Android ICS, according to the official documentation
setSupportProgressBarIndeterminateVisibility(mSyncInProgress /*|| mRefreshSharesInProgress*/); // always AFTER setContentView(...) ; to work around bug in its implementation
- showMessageView();
+ setBackgroundText();
Log_OC.d(TAG, "onCreate() end");
}
Log_OC.d(TAG, "Setting progress visibility to " + mSyncInProgress);
setSupportProgressBarIndeterminateVisibility(mSyncInProgress /*|| mRefreshSharesInProgress*/);
- showMessageView();
+ setBackgroundText();
}
* Show a text message on screen view for notifying user if content is
* loading or folder is empty
*/
- private void showMessageView() {
+ private void setBackgroundText() {
OCFileListFragment ocFileListFragment = getListOfFilesFragment();
if (ocFileListFragment != null) {
int message = R.string.file_list_loading;
// In case file list is empty
message = R.string.file_list_empty;
}
- ocFileListFragment.setMessageforEmptyView(getString(message));
+ ocFileListFragment.setMessageForEmptyList(getString(message));
} else {
Log.e(TAG, "OCFileListFragment is null");
}
setSupportProgressBarIndeterminateVisibility(true);
- showMessageView();
+ setBackgroundText();
}
/**
onTransferStateChanged(file, false, false);
}
+ @Override
+ public void onRefresh() {
+ OCFileListFragment listOfFiles = getListOfFilesFragment();
+ if (listOfFiles != null) {
+ OCFile folder = listOfFiles.getCurrentFile();
+ if (folder != null) {
+ /*mFile = mContainerActivity.getStorageManager().getFileById(mFile.getFileId());
+ listDirectory(mFile);*/
+ startSyncFolderOperation(folder);
+ }
+ }
+ }
+
}