forked from organicmaps/organicmaps
[android] Disabled the myTarget banners if search is started in downloader
This commit is contained in:
parent
8087fca1a6
commit
401aa715a6
2 changed files with 12 additions and 3 deletions
|
@ -748,15 +748,16 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde
|
|||
mItems.clear();
|
||||
mItems.addAll(results);
|
||||
processData();
|
||||
if (results.isEmpty())
|
||||
clearAds();
|
||||
}
|
||||
|
||||
private void clearAds()
|
||||
void clearAds()
|
||||
{
|
||||
if (mAds.isEmpty())
|
||||
return;
|
||||
|
||||
if (mMytargetHelper != null)
|
||||
mMytargetHelper.cancel();
|
||||
|
||||
mAds.clear();
|
||||
mAdsLoaded = false;
|
||||
notifyDataSetChanged();
|
||||
|
@ -981,6 +982,13 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde
|
|||
}
|
||||
|
||||
mAdsLoading = true;
|
||||
|
||||
if (mMytargetHelper == null)
|
||||
initMytargetHelper();
|
||||
}
|
||||
|
||||
private void initMytargetHelper()
|
||||
{
|
||||
mMytargetHelper = new MytargetHelper(new MytargetHelper.Listener<Void>()
|
||||
{
|
||||
private void onNoAdsInternal()
|
||||
|
|
|
@ -76,6 +76,7 @@ public class DownloaderFragment extends BaseMwmRecyclerFragment
|
|||
mCurrentSearch = System.nanoTime();
|
||||
SearchEngine.searchMaps(mToolbarController.getQuery(), mCurrentSearch);
|
||||
mToolbarController.showProgress(true);
|
||||
mAdapter.clearAds();
|
||||
}
|
||||
|
||||
void clearSearchQuery()
|
||||
|
|
Loading…
Add table
Reference in a new issue