Skip to content

Commit 00437d0

Browse files
committed
fixed checkout state not updating when in a stopped activity
1 parent f5ffe2a commit 00437d0

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.13.17]
5+
6+
### Fixed
7+
- Fixed payment status screen not updating when in a stopped activity
8+
- Fixed scanner shopping cart button not updating when in a stopped activity
9+
410
## [0.13.16]
511

612
### Changed

ui/src/main/java/io/snabble/sdk/ui/checkout/CheckoutView.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class CheckoutView extends FrameLayout implements Checkout.OnCheckoutStat
2929
private ViewAnimator viewAnimator;
3030
private Checkout checkout;
3131
private DelayedProgressDialog progressDialog;
32+
private Checkout.State currentState;
3233

3334
public CheckoutView(Context context) {
3435
super(context);
@@ -75,6 +76,10 @@ public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent)
7576

7677
@Override
7778
public void onStateChanged(Checkout.State state) {
79+
if (state == currentState) {
80+
return;
81+
}
82+
7883
if (state == Checkout.State.VERIFYING_PAYMENT_METHOD) {
7984
progressDialog.showAfterDelay(500);
8085
} else {
@@ -105,9 +110,10 @@ public void onStateChanged(Checkout.State state) {
105110
.show();
106111
break;
107112
case NONE:
108-
109113
break;
110114
}
115+
116+
currentState = state;
111117
}
112118

113119
private void displayPaymentView() {
@@ -171,6 +177,7 @@ public void displayView(View view) {
171177

172178
private void registerListeners() {
173179
checkout.addOnCheckoutStateChangedListener(this);
180+
onStateChanged(checkout.getState());
174181
}
175182

176183
private void unregisterListeners() {

ui/src/main/java/io/snabble/sdk/ui/scanner/SelfScanningView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ private void registerListeners() {
460460

461461
startBarcodeScanner();
462462
shoppingCart.addListener(shoppingCartListener);
463+
updateCartButton();
463464
}
464465

465466
private void unregisterListeners() {

0 commit comments

Comments
 (0)