Fix arrow stuff

This commit is contained in:
Mario Danic 2017-02-19 17:47:46 +01:00 committed by AndyScherzinger
parent 6b4a94b5ca
commit 0fd9a47b23
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
4 changed files with 33 additions and 6 deletions

View file

@ -507,8 +507,10 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
super.updateActionBarTitleAndHomeButton(chosenFile);
/// set home button properties
if (mDrawerToggle != null) {
if (mDrawerToggle != null && chosenFile != null) {
mDrawerToggle.setDrawerIndicatorEnabled(isRoot(chosenFile));
} else {
mDrawerToggle.setDrawerIndicatorEnabled(false);
}
}

View file

@ -633,8 +633,20 @@ public class FileDisplayActivity extends HookActivity
searchView.setOnCloseListener(new SearchView.OnCloseListener() {
@Override
public boolean onClose() {
setDrawerIndicatorEnabled(isDrawerIndicatorAvailable());
return false;
if (TextUtils.isEmpty(searchView.getQuery().toString())) {
searchView.onActionViewCollapsed();
setDrawerIndicatorEnabled(isDrawerIndicatorAvailable()); // order matters
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mDrawerToggle.syncState();
} else {
searchView.post(new Runnable() {
@Override
public void run() {
searchView.setQuery("", true);
}
});
}
return true;
}
});
@ -650,8 +662,6 @@ public class FileDisplayActivity extends HookActivity
if (currentVisibility != oldVisibility) {
if (currentVisibility == View.VISIBLE) {
setDrawerIndicatorEnabled(false);
} else {
setDrawerIndicatorEnabled(isDrawerIndicatorAvailable());
}
oldVisibility = currentVisibility;

View file

@ -450,6 +450,11 @@ public class ExtendedListFragment extends Fragment
if (searchView != null) {
searchView.onActionViewCollapsed();
if (getActivity() != null) {
FileDisplayActivity fileDisplayActivity = (FileDisplayActivity) getActivity();
fileDisplayActivity.setDrawerIndicatorEnabled(fileDisplayActivity.isDrawerIndicatorAvailable());
}
}
mRefreshListLayout.setRefreshing(false);

View file

@ -787,11 +787,21 @@ public class OCFileListFragment extends ExtendedListFragment implements Extended
directory = storageManager.getFileById(directory.getParentId());
}
if (searchView != null && !searchView.isIconified() && !fromSearch) {
searchView.post(new Runnable() {
@Override
public void run() {
searchView.setQuery("", false);
searchView.onActionViewCollapsed();
if (getActivity() != null) {
FileDisplayActivity fileDisplayActivity = (FileDisplayActivity) getActivity();
if (getCurrentFile() != null) {
fileDisplayActivity.setDrawerIndicatorEnabled(fileDisplayActivity.isRoot(getCurrentFile()));
}
}
}
});
}