forked from organicmaps/organicmaps
[android] [cherry-pick after conflict] Refactoring name for invalid categories callback
This commit is contained in:
parent
28ff0c4cec
commit
46bfbee4af
3 changed files with 12 additions and 10 deletions
|
@ -41,7 +41,7 @@ public class BookmarkCategoriesPagerFragment extends BaseMwmFragment
|
|||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private AlertDialogCallback mDialogClickDelegate;
|
||||
private AlertDialogCallback mInvalidSubsDialogCallback;
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
|
@ -59,7 +59,7 @@ public class BookmarkCategoriesPagerFragment extends BaseMwmFragment
|
|||
return;
|
||||
|
||||
mCatalogDeeplink = args.getString(ARG_CATALOG_DEEPLINK);
|
||||
mDialogClickDelegate = new InvalidSubscriptionAlertDialogCallback(this);
|
||||
mInvalidSubsDialogCallback = new InvalidSubscriptionAlertDialogCallback(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -170,21 +170,22 @@ public class BookmarkCategoriesPagerFragment extends BaseMwmFragment
|
|||
@Override
|
||||
public void onAlertDialogPositiveClick(int requestCode, int which)
|
||||
{
|
||||
mDialogClickDelegate.onAlertDialogPositiveClick(requestCode, which);
|
||||
mInvalidSubsDialogCallback.onAlertDialogPositiveClick(requestCode, which);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAlertDialogNegativeClick(int requestCode, int which)
|
||||
{
|
||||
mDialogClickDelegate.onAlertDialogNegativeClick(requestCode, which);
|
||||
if (PurchaseUtils.REQ_CODE_CHECK_INVALID_SUBS_DIALOG == requestCode)
|
||||
mViewPager.setAdapter(mAdapter);
|
||||
|
||||
mInvalidSubsDialogCallback.onAlertDialogNegativeClick(requestCode, which);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAlertDialogCancel(int requestCode)
|
||||
{
|
||||
mDialogClickDelegate.onAlertDialogCancel(requestCode);
|
||||
mInvalidSubsDialogCallback.onAlertDialogCancel(requestCode);
|
||||
}
|
||||
|
||||
private class PageChangeListener extends ViewPager.SimpleOnPageChangeListener
|
||||
|
|
|
@ -96,7 +96,7 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment
|
|||
private BookmarksDownloadFragmentDelegate mDelegate;
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private AlertDialogCallback mInvalidSubsDialogDelegate;
|
||||
private AlertDialogCallback mInvalidSubsDialogCallback;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState)
|
||||
|
@ -104,7 +104,7 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment
|
|||
super.onCreate(savedInstanceState);
|
||||
mDelegate = new BookmarksDownloadFragmentDelegate(this);
|
||||
mDelegate.onCreate(savedInstanceState);
|
||||
mInvalidSubsDialogDelegate = new InvalidSubscriptionAlertDialogCallback(this);
|
||||
mInvalidSubsDialogCallback = new InvalidSubscriptionAlertDialogCallback(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -311,7 +311,7 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment
|
|||
switch (requestCode)
|
||||
{
|
||||
case PurchaseUtils.REQ_CODE_CHECK_INVALID_SUBS_DIALOG:
|
||||
mInvalidSubsDialogDelegate.onAlertDialogPositiveClick(requestCode, which);
|
||||
mInvalidSubsDialogCallback.onAlertDialogPositiveClick(requestCode, which);
|
||||
break;
|
||||
case PurchaseUtils.REQ_CODE_BMK_SUBS_SUCCESS_DIALOG:
|
||||
onRetryClick();
|
||||
|
@ -324,7 +324,7 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment
|
|||
{
|
||||
if (requestCode == PurchaseUtils.REQ_CODE_CHECK_INVALID_SUBS_DIALOG)
|
||||
{
|
||||
mInvalidSubsDialogDelegate.onAlertDialogNegativeClick(requestCode, which);
|
||||
mInvalidSubsDialogCallback.onAlertDialogNegativeClick(requestCode, which);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -334,7 +334,7 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment
|
|||
switch (requestCode)
|
||||
{
|
||||
case PurchaseUtils.REQ_CODE_CHECK_INVALID_SUBS_DIALOG:
|
||||
mInvalidSubsDialogDelegate.onAlertDialogCancel(requestCode);
|
||||
mInvalidSubsDialogCallback.onAlertDialogCancel(requestCode);
|
||||
break;
|
||||
case PurchaseUtils.REQ_CODE_BMK_SUBS_SUCCESS_DIALOG:
|
||||
onRetryClick();
|
||||
|
|
|
@ -38,5 +38,6 @@ class InvalidSubscriptionAlertDialogCallback implements AlertDialogCallback
|
|||
@Override
|
||||
public void onAlertDialogCancel(int requestCode)
|
||||
{
|
||||
// Invalid subs dialog is not cancellable, so do nothing here.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue