mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 17:46:37 +03:00
Remove drop-down list in action bar
This commit is contained in:
parent
d789d304e3
commit
e78102d123
2 changed files with 19 additions and 6 deletions
|
@ -361,9 +361,9 @@ public class FileActivity extends ActionBarActivity
|
|||
/** Called when a drawer has settled in a completely closed state. */
|
||||
public void onDrawerClosed(View view) {
|
||||
super.onDrawerClosed(view);
|
||||
updateActionBarTitle();
|
||||
getSupportActionBar().setDisplayShowTitleEnabled(true);
|
||||
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
|
||||
//initFragmentsWithFile();
|
||||
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
|
||||
invalidateOptionsMenu();
|
||||
}
|
||||
|
||||
|
@ -384,6 +384,14 @@ public class FileActivity extends ActionBarActivity
|
|||
mDrawerLayout.setDrawerListener(mDrawerToggle);
|
||||
}
|
||||
|
||||
protected void updateActionBarTitle(){
|
||||
if (mFile.getParentId() == 0) {
|
||||
getSupportActionBar().setTitle(getString(
|
||||
R.string.default_display_name_for_root_folder));
|
||||
} else {
|
||||
getSupportActionBar().setTitle(mFile.getFileName().toString());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets and validates the ownCloud {@link Account} associated to the Activity.
|
||||
*
|
||||
|
|
|
@ -802,6 +802,7 @@ public class FileDisplayActivity extends HookActivity implements
|
|||
if (listOfFiles != null) { // should never be null, indeed
|
||||
setFile(listOfFiles.getCurrentFile());
|
||||
}
|
||||
updateActionBarTitle();
|
||||
cleanSecondFragment();
|
||||
|
||||
}
|
||||
|
@ -1239,8 +1240,10 @@ public class FileDisplayActivity extends HookActivity implements
|
|||
// listOfFiles.listDirectory(root, MainApp.getOnlyOnDevice());
|
||||
setFile(listOfFiles.getCurrentFile());
|
||||
startSyncFolderOperation(root, false);
|
||||
updateActionBarTitle();
|
||||
}
|
||||
cleanSecondFragment();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1260,6 +1263,7 @@ public class FileDisplayActivity extends HookActivity implements
|
|||
Log_OC.e(TAG, "Unexpected null when accessing list fragment");
|
||||
}
|
||||
cleanSecondFragment();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1272,7 +1276,7 @@ public class FileDisplayActivity extends HookActivity implements
|
|||
public void onBrowsedDownTo(OCFile directory) {
|
||||
pushDirname(directory);
|
||||
cleanSecondFragment();
|
||||
|
||||
updateActionBarTitle();
|
||||
// Sync Folder
|
||||
startSyncFolderOperation(directory, false);
|
||||
|
||||
|
@ -1308,7 +1312,7 @@ public class FileDisplayActivity extends HookActivity implements
|
|||
OCFile currentDir = getCurrentDir();
|
||||
boolean noRoot = (currentDir != null && currentDir.getParentId() != 0);
|
||||
// actionBar.setDisplayHomeAsUpEnabled(noRoot);
|
||||
// actionBar.setDisplayShowTitleEnabled(!noRoot);
|
||||
// actionBar.setDisplayShowTitleEnabled(!noRoot);
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
actionBar.setDisplayShowTitleEnabled(true);
|
||||
if (!noRoot) {
|
||||
|
@ -1319,8 +1323,9 @@ public class FileDisplayActivity extends HookActivity implements
|
|||
getString(R.string.default_display_name_for_root_folder));
|
||||
}
|
||||
}
|
||||
actionBar.setNavigationMode(!noRoot ? ActionBar.NAVIGATION_MODE_STANDARD :
|
||||
ActionBar.NAVIGATION_MODE_LIST);
|
||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
|
||||
// actionBar.setNavigationMode(!noRoot ? ActionBar.NAVIGATION_MODE_STANDARD :
|
||||
// ActionBar.NAVIGATION_MODE_LIST);
|
||||
actionBar.setListNavigationCallbacks(mDirectories, this);
|
||||
// assuming mDirectories is updated
|
||||
|
||||
|
|
Loading…
Reference in a new issue