android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|center_horizontal"
- android:text="@string/file_list_empty"
+ android:text="@string/empty"
android:visibility="gone"
/>
<string name="uploader_error_forbidden_content">%1$s is not allowed to access the shared content</string>
<string name="uploader_info_uploading">Uploading</string>
<string name="file_list_empty">Nothing in here. Upload something!</string>
+ <string name="file_list_loading">Loading...</string>
<string name="local_file_list_empty">There are no files in this folder.</string>
<string name="filedetails_select_file">Tap on a file to display additional information.</string>
<string name="filedetails_size">Size:</string>
<string name="network_error_socket_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
<string name="network_error_connect_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
<string name="network_host_not_available">The operation couldn\'t be completed, server is unavailable</string>
+ <string name="empty"></string>
</resources>
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();
+
Log_OC.d(TAG, "onCreate() end");
}
removeStickyBroadcast(intent);
Log_OC.d(TAG, "Setting progress visibility to " + mSyncInProgress);
setSupportProgressBarIndeterminateVisibility(mSyncInProgress /*|| mRefreshSharesInProgress*/);
+
+ showMessageView();
}
}
}
+ /**
+ * Show a text message on screen view for notifying user if content is
+ * loading or folder is empty
+ */
+ private void showMessageView() {
+ OCFileListFragment ocFileListFragment = getListOfFilesFragment();
+ if (ocFileListFragment != null) {
+ int message = R.string.file_list_loading;
+ if (!mSyncInProgress) {
+ // In case file list is empty
+ message = R.string.file_list_empty;
+ }
+ ocFileListFragment.setMessageforEmptyView(message);
+ } else {
+ Log.e(TAG, "OCFileListFragment is null");
+ }
+ }
/**
* Once the file upload has finished -> update view
synchFolderOp.execute(getAccount(), this, null, null);
setSupportProgressBarIndeterminateVisibility(true);
+
+ showMessageView();
}
/**
* Set message for empty list view
*/
public void setMessageforEmptyView(int message) {
- mEmptyListMessage.setText(message);
+ if (mEmptyListMessage != null) {
+ mEmptyListMessage.setText(message);
+ }
}
super.onActivityCreated(savedInstanceState);
Log_OC.e(TAG, "onActivityCreated() start");
- setMessageforEmptyView(R.string.file_list_empty);
-
mAdapter = new FileListListAdapter(getSherlockActivity(), mContainerActivity);
if (savedInstanceState != null) {