[android] Fixed showing invalid subs dialog on bookmark screen when we come back to it from another screen

This commit is contained in:
Александр Зацепин 2019-09-09 12:39:46 +03:00 committed by yoksnod
parent f2ce21b575
commit 28ff0c4cec
3 changed files with 39 additions and 7 deletions

View file

@ -108,6 +108,20 @@ public class BookmarkCategoriesPagerFragment extends BaseMwmFragment
mCatalogDeeplink = null;
}
@Override
public void onResume()
{
super.onResume();
mDelegate.onResume();
}
@Override
public void onPause()
{
super.onPause();
mDelegate.onPause();
}
@Override
public void onStop()
{

View file

@ -116,6 +116,20 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment
mProductDetailsLoadingManager.addCallback(mProductDetailsLoadingCallback);
}
@Override
public void onResume()
{
super.onResume();
mDelegate.onResume();
}
@Override
public void onPause()
{
super.onPause();
mDelegate.onPause();
}
@Override
public void onStop()
{

View file

@ -67,6 +67,17 @@ class BookmarksDownloadFragmentDelegate implements Authorizer.Callback, Bookmark
mInvalidCategoriesListener.attach(mFragment);
}
void onResume()
{
LOGGER.i(TAG, "Check invalid bookmark categories...");
BookmarkManager.INSTANCE.checkInvalidCategories();
}
void onPause()
{
// Do nothing.
}
void onStop()
{
mAuthorizer.detach();
@ -77,11 +88,6 @@ class BookmarksDownloadFragmentDelegate implements Authorizer.Callback, Bookmark
void onCreateView(@Nullable Bundle savedInstanceState)
{
BookmarkManager.INSTANCE.addInvalidCategoriesListener(mInvalidCategoriesListener);
if (savedInstanceState != null)
return;
LOGGER.i(TAG, "Check invalid bookmark categories...");
BookmarkManager.INSTANCE.checkInvalidCategories();
}
void onDestroyView()
@ -218,8 +224,6 @@ class BookmarksDownloadFragmentDelegate implements Authorizer.Callback, Bookmark
public void onCheckInvalidCategories(boolean hasInvalidCategories)
{
LOGGER.i(TAG, "Has invalid categories: " + hasInvalidCategories);
BookmarkManager.INSTANCE.removeInvalidCategoriesListener(this);
if (mFrag == null)
{
mPendingInvalidCategoriesResult = hasInvalidCategories;