From: Bartek Przybylski Date: Sun, 13 May 2012 14:19:22 +0000 (+0200) Subject: merge fix X-Git-Tag: oc-android-1.4.3~426 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/390949b8323633b26d56b3a837e83941cbc24b4b?hp=0aeb425885ceccb28b31c9822d52b90656bf9257 merge fix --- diff --git a/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java b/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java index cec268bd..1db5246e 100644 --- a/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java +++ b/src/eu/alefzero/owncloud/ui/activity/FileDisplayActivity.java @@ -23,11 +23,11 @@ import android.accounts.AccountManager; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.Dialog; +import android.content.BroadcastReceiver; +import android.content.ContentResolver; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; -import android.content.BroadcastReceiver; -import android.content.ContentResolver; import android.content.Intent; import android.content.IntentFilter; import android.database.Cursor; @@ -71,7 +71,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements private ArrayAdapter mDirectories; private DataStorageManager mStorageManager; - private BR b; + private SyncBroadcastReceiver syncBroadcastRevceiver; private static final int DIALOG_SETUP_ACCOUNT = 0; private static final int DIALOG_CREATE_DIR = 1; @@ -409,17 +409,20 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements return accounts.length > 0; } - private class BR extends BroadcastReceiver { + private class SyncBroadcastReceiver extends BroadcastReceiver { + /** + * {@link BroadcastReceiver} to enable syncing feedback in UI + */ @Override public void onReceive(Context context, Intent intent) { - boolean in_progress = intent.getBooleanExtra(FileSyncService.IN_PROGRESS, false); + boolean inProgress = intent.getBooleanExtra(FileSyncService.IN_PROGRESS, false); String account_name = intent.getStringExtra(FileSyncService.ACCOUNT_NAME); - Log.d("FileDisplay", "sync of account " + account_name + " is in_progress: " + in_progress); - setProgressBarIndeterminateVisibility(in_progress); - if (!in_progress) { - FileListFragment f = (FileListFragment) getSupportFragmentManager().findFragmentById(R.id.fileList); - if (f != null) - f.populateFileList(); + Log.d("FileDisplay", "sync of account " + account_name + " is in_progress: " + inProgress); + setProgressBarIndeterminateVisibility(inProgress); + if (!inProgress) { + FileListFragment fileListFramgent = (FileListFragment) getSupportFragmentManager().findFragmentById(R.id.fileList); + if (fileListFramgent != null) + fileListFramgent.populateFileList(); } }