forked from organicmaps/organicmaps
[android] Added pending product details and validation result processing for bookmark subscription screen
This commit is contained in:
parent
cf6fb5d27d
commit
a41db3ba7e
2 changed files with 18 additions and 11 deletions
|
@ -313,7 +313,7 @@ public class BookmarkSubscriptionFragment extends BaseMwmFragment
|
|||
{
|
||||
@Nullable
|
||||
private List<SkuDetails> mPendingDetails;
|
||||
private Boolean mPendingActivationResult;
|
||||
private Boolean mPendingValidationResult;
|
||||
|
||||
@Override
|
||||
public void onProductDetailsLoaded(@NonNull List<SkuDetails> details)
|
||||
|
@ -359,11 +359,27 @@ public class BookmarkSubscriptionFragment extends BaseMwmFragment
|
|||
public void onValidationFinish(boolean success)
|
||||
{
|
||||
if (getUiObject() == null)
|
||||
mPendingActivationResult = success;
|
||||
mPendingValidationResult = success;
|
||||
else
|
||||
getUiObject().handleActivationResult(success);
|
||||
|
||||
activateStateSafely(BookmarkSubscriptionPaymentState.VALIDATION_FINISH);
|
||||
}
|
||||
|
||||
@Override
|
||||
void onAttach(@NonNull BookmarkSubscriptionFragment bookmarkSubscriptionFragment)
|
||||
{
|
||||
if (mPendingDetails != null)
|
||||
{
|
||||
bookmarkSubscriptionFragment.handleProductDetails(mPendingDetails);
|
||||
mPendingDetails = null;
|
||||
}
|
||||
|
||||
if (mPendingValidationResult != null)
|
||||
{
|
||||
bookmarkSubscriptionFragment.handleActivationResult(mPendingValidationResult);
|
||||
mPendingValidationResult = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,15 +24,6 @@ public enum BookmarkSubscriptionPaymentState
|
|||
fragment.queryProductDetails();
|
||||
}
|
||||
},
|
||||
PRODUCT_DETAILS_LOADED
|
||||
{
|
||||
@Override
|
||||
void activate(@NonNull BookmarkSubscriptionFragment fragment)
|
||||
{
|
||||
hideProgress(fragment);
|
||||
// TODO: coming soon.
|
||||
}
|
||||
},
|
||||
PRODUCT_DETAILS_FAILURE
|
||||
{
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue