X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/a75ffde65f732d695f557bdfe7d954c40cfae4d4..080a8ab7af2bc48e3c5fa1334ae91d21073e26c2:/src/com/owncloud/android/ui/activity/FolderPickerActivity.java diff --git a/src/com/owncloud/android/ui/activity/FolderPickerActivity.java b/src/com/owncloud/android/ui/activity/FolderPickerActivity.java index a358f79e..743b134f 100644 --- a/src/com/owncloud/android/ui/activity/FolderPickerActivity.java +++ b/src/com/owncloud/android/ui/activity/FolderPickerActivity.java @@ -38,8 +38,8 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; -import android.view.Window; import android.widget.Button; +import android.widget.ProgressBar; import android.widget.Toast; import com.owncloud.android.R; @@ -59,7 +59,6 @@ import com.owncloud.android.syncadapter.FileSyncAdapter; import com.owncloud.android.ui.dialog.CreateFolderDialogFragment; import com.owncloud.android.ui.fragment.FileFragment; import com.owncloud.android.ui.fragment.OCFileListFragment; -import com.owncloud.android.utils.DisplayUtils; import com.owncloud.android.utils.ErrorMessageAdapter; public class FolderPickerActivity extends FileActivity implements FileFragment.ContainerActivity, @@ -81,12 +80,12 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C protected Button mCancelBtn; protected Button mChooseBtn; + private ProgressBar mProgressBar; @Override protected void onCreate(Bundle savedInstanceState) { Log_OC.d(TAG, "onCreate() start"); - requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); super.onCreate(savedInstanceState); @@ -103,20 +102,23 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayShowTitleEnabled(true); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); - setSupportProgressBarIndeterminateVisibility(mSyncInProgress); - // always AFTER setContentView(...) ; to work around bug in its implementation + + mProgressBar = (ProgressBar) findViewById(R.id.progressBar); + mProgressBar.setIndeterminateDrawable( + getResources().getDrawable( + R.drawable.actionbar_progress_indeterminate_horizontal)); + mProgressBar.setIndeterminate(mSyncInProgress); + // always AFTER setContentView(...) ; to work around bug in its implementation // sets message for empty list of folders setBackgroundText(); Log_OC.d(TAG, "onCreate() end"); - } @Override protected void onStart() { super.onStart(); - getSupportActionBar().setIcon(DisplayUtils.getSeasonalIconId()); } /** @@ -152,6 +154,7 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C Bundle args = new Bundle(); args.putBoolean(OCFileListFragment.ARG_JUST_FOLDERS, true); args.putBoolean(OCFileListFragment.ARG_ALLOW_CONTEXTUAL_ACTIONS, false); + args.putBoolean(OCFileListFragment.ARG_HIDE_FAB, true); listOfFiles.setArguments(args); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.add(R.id.fragment_container, listOfFiles, TAG_LIST_OF_FOLDERS); @@ -217,8 +220,8 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C getApplicationContext() ); synchFolderOp.execute(getAccount(), this, null, null); - - setSupportProgressBarIndeterminateVisibility(true); + + mProgressBar.setIndeterminate(true); setBackgroundText(); } @@ -260,7 +263,6 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.main_menu, menu); - menu.findItem(R.id.action_upload).setVisible(false); menu.findItem(R.id.action_sort).setVisible(false); return true; } @@ -347,9 +349,9 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C actionBar.setDisplayHomeAsUpEnabled(!atRoot); actionBar.setHomeButtonEnabled(!atRoot); actionBar.setTitle( - atRoot - ? getString(R.string.default_display_name_for_root_folder) - : currentDir.getFileName() + atRoot + ? getString(R.string.default_display_name_for_root_folder) + : currentDir.getFileName() ); } @@ -387,7 +389,7 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C super.onRemoteOperationFinish(operation, result); if (operation instanceof CreateFolderOperation) { - onCreateFolderOperationFinish((CreateFolderOperation)operation, result); + onCreateFolderOperationFinish((CreateFolderOperation) operation, result); } } @@ -405,10 +407,8 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C ) { if (result.isSuccess()) { - dismissLoadingDialog(); refreshListOfFilesFragment(); } else { - dismissLoadingDialog(); try { Toast msg = Toast.makeText(FolderPickerActivity.this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources()), @@ -522,10 +522,10 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C } removeStickyBroadcast(intent); Log_OC.d(TAG, "Setting progress visibility to " + mSyncInProgress); - setSupportProgressBarIndeterminateVisibility(mSyncInProgress /*|| mRefreshSharesInProgress*/); + + mProgressBar.setIndeterminate(mSyncInProgress); setBackgroundText(); - } } catch (RuntimeException e) { @@ -539,9 +539,9 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C /** - * Shows the information of the {@link OCFile} received as a + * Shows the information of the {@link OCFile} received as a * parameter in the second fragment. - * + * * @param file {@link OCFile} whose details will be shown */ @Override