1616import android .widget .ViewAnimator ;
1717
1818import io .snabble .sdk .Checkout ;
19- import io .snabble .sdk .PaymentMethod ;
2019import io .snabble .sdk .Snabble ;
2120import io .snabble .sdk .encodedcodes .EncodedCodesOptions ;
2221import io .snabble .sdk .ui .KeyguardHandler ;
@@ -31,10 +30,6 @@ public class CheckoutView extends FrameLayout implements Checkout.OnCheckoutStat
3130 private CoordinatorLayout coordinatorLayout ;
3231 private ViewAnimator viewAnimator ;
3332 private Checkout checkout ;
34-
35- private Handler handler = new Handler (Looper .getMainLooper ());
36-
37- private Checkout .State previousState ;
3833 private DelayedProgressDialog progressDialog ;
3934
4035 public CheckoutView (Context context ) {
@@ -95,18 +90,8 @@ public void onStateChanged(Checkout.State state) {
9590 displayPaymentView ();
9691 break ;
9792 case PAYMENT_APPROVED :
98- if (previousState != null && (checkout .getSelectedPaymentMethod () == PaymentMethod .CASH
99- || checkout .getSelectedPaymentMethod () == PaymentMethod .TELECASH_DIRECT_DEBIT )) {
100- handler .postDelayed (new Runnable () {
101- @ Override
102- public void run () {
103- displayView (new CheckoutDoneView (getContext ()));
104- }
105- }, 3000 );
106- } else {
107- if (checkout .getSelectedPaymentMethod () != PaymentMethod .ENCODED_CODES ) {
108- displayView (new CheckoutDoneView (getContext ()));
109- }
93+ if (!checkout .getSelectedPaymentMethod ().isOfflineMethod ()) {
94+ displayView (new CheckoutDoneView (getContext ()));
11095 }
11196 break ;
11297 case PAYMENT_ABORTED :
@@ -122,8 +107,6 @@ public void run() {
122107
123108 break ;
124109 }
125-
126- previousState = state ;
127110 }
128111
129112 private void displayPaymentView () {
0 commit comments