Remove dual pane for rich workspaces

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2020-09-14 16:11:21 +02:00
parent f50a204a79
commit ea623aa01e
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -616,6 +616,7 @@ public class FileDisplayActivity extends FileActivity
} }
public @androidx.annotation.Nullable public @androidx.annotation.Nullable
@Deprecated
OCFileListFragment getListOfFilesFragment() { OCFileListFragment getListOfFilesFragment() {
Fragment listOfFiles = getSupportFragmentManager().findFragmentByTag( Fragment listOfFiles = getSupportFragmentManager().findFragmentByTag(
FileDisplayActivity.TAG_LIST_OF_FILES); FileDisplayActivity.TAG_LIST_OF_FILES);
@ -1111,10 +1112,15 @@ public class FileDisplayActivity extends FileActivity
Log_OC.v(TAG, "onResume() start"); Log_OC.v(TAG, "onResume() start");
super.onResume(); super.onResume();
// Instead of onPostCreate, starting the loading in onResume for children fragments // Instead of onPostCreate, starting the loading in onResume for children fragments
OCFileListFragment ocFileListFragment = getListOfFilesFragment(); Fragment leftFragment = getLeftFragment();
if (ocFileListFragment != null) {
ocFileListFragment.setLoading(mSyncInProgress); if (!(leftFragment instanceof OCFileListFragment)) {
return;
} }
OCFileListFragment ocFileListFragment = (OCFileListFragment) leftFragment;
ocFileListFragment.setLoading(mSyncInProgress);
syncAndUpdateFolder(false); syncAndUpdateFolder(false);
OCFile startFile = null; OCFile startFile = null;
@ -1126,18 +1132,16 @@ public class FileDisplayActivity extends FileActivity
// refresh list of files // refresh list of files
if (searchView != null && !TextUtils.isEmpty(searchQuery)) { if (searchView != null && !TextUtils.isEmpty(searchQuery)) {
searchView.setQuery(searchQuery, false); searchView.setQuery(searchQuery, false);
} else if (ocFileListFragment != null && !ocFileListFragment.isSearchFragment() && startFile == null) { } else if (!ocFileListFragment.isSearchFragment() && startFile == null) {
updateListOfFilesFragment(false); updateListOfFilesFragment(false);
ocFileListFragment.registerFabListener(); ocFileListFragment.registerFabListener();
} else { } else {
if (ocFileListFragment != null) { ocFileListFragment.listDirectory(startFile, false, false);
ocFileListFragment.listDirectory(startFile, false, false);
}
updateActionBarTitleAndHomeButton(startFile); updateActionBarTitleAndHomeButton(startFile);
} }
// Listen for sync messages // Listen for sync messages
if (ocFileListFragment != null && !ocFileListFragment.isSearchFragment()) { if (!ocFileListFragment.isSearchFragment()) {
IntentFilter syncIntentFilter = new IntentFilter(FileSyncAdapter.EVENT_FULL_SYNC_START); IntentFilter syncIntentFilter = new IntentFilter(FileSyncAdapter.EVENT_FULL_SYNC_START);
syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_END); syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_END);
syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED); syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED);
@ -2206,10 +2210,7 @@ public class FileDisplayActivity extends FileActivity
PreviewTextFileFragment.class.getName(), args); PreviewTextFileFragment.class.getName(), args);
setLeftFragment(textPreviewFragment); setLeftFragment(textPreviewFragment);
binding.rightFragmentContainer.setVisibility(View.GONE); binding.rightFragmentContainer.setVisibility(View.GONE);
//updateFragmentsVisibility(true);
super.updateActionBarTitleAndHomeButton(file); super.updateActionBarTitleAndHomeButton(file);
//setFile(file);
} else { } else {
Intent previewIntent = new Intent(); Intent previewIntent = new Intent();
previewIntent.putExtra(EXTRA_FILE, file); previewIntent.putExtra(EXTRA_FILE, file);
@ -2222,7 +2223,7 @@ public class FileDisplayActivity extends FileActivity
} }
/** /**
* Stars rich workspace preview for a folder. * Starts rich workspace preview for a folder.
* *
* @param folder {@link OCFile} to preview its rich workspace. * @param folder {@link OCFile} to preview its rich workspace.
*/ */
@ -2233,10 +2234,9 @@ public class FileDisplayActivity extends FileActivity
Fragment textPreviewFragment = Fragment.instantiate(getApplicationContext(), Fragment textPreviewFragment = Fragment.instantiate(getApplicationContext(),
PreviewTextStringFragment.class.getName(), PreviewTextStringFragment.class.getName(),
args); args);
setSecondFragment(textPreviewFragment); setLeftFragment(textPreviewFragment);
updateFragmentsVisibility(true); binding.rightFragmentContainer.setVisibility(View.GONE);
updateActionBarTitleAndHomeButton(folder); super.updateActionBarTitleAndHomeButton(folder);
setFile(folder);
} }
public void startContactListFragment(OCFile file) { public void startContactListFragment(OCFile file) {