[new downloader][android] fix: Crash on entering to downloader.

This commit is contained in:
Alexander Marchuk 2016-04-07 15:43:14 +03:00
parent 06d56d9dad
commit 5ea8a25218
3 changed files with 13 additions and 2 deletions

View file

@ -714,7 +714,12 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde
int position = lm.findFirstVisibleItemPosition();
int offset = lm.findViewByPosition(position).getTop();
boolean wasEmpty = mPath.isEmpty();
mPath.push(new PathEntry(child.id, child.name, position, offset));
if (wasEmpty)
mFragment.clearSearchQuery();
refreshData();
lm.scrollToPosition(0);

View file

@ -77,8 +77,16 @@ public class DownloaderFragment extends BaseMwmRecyclerFragment
mToolbarController.showProgress(true);
}
void clearSearchQuery()
{
mToolbarController.clear();
}
void cancelSearch()
{
if (!mAdapter.isSearchResultsMode())
return;
mAdapter.cancelSearch();
onSearchEnd();
}

View file

@ -192,8 +192,6 @@ public class SearchToolbarController extends ToolbarController
public void showControls(boolean show)
{
UiUtils.showIf(show, mContainer);
if (show)
clear();
}
public void onActivityResult(int requestCode, int resultCode, Intent data)