forked from organicmaps/organicmaps
[new downloader][android] fix: Crash on entering to downloader.
This commit is contained in:
parent
06d56d9dad
commit
5ea8a25218
3 changed files with 13 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue