File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
ui/src/main/java/io/snabble/sdk/ui/cart Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 11# Changelog
22All notable changes to this project will be documented in this file.
33
4+ ## [ 0.39.1]
5+
6+ ### Added
7+ - Jump to play store if google pay is not installed
8+
49## [ 0.39.0]
510
611### Added
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ allprojects {
3131 }
3232
3333 project. ext {
34- sdkVersion= ' 0.39.0 '
34+ sdkVersion= ' 0.39.1 '
3535 versionCode= 1
3636
3737 compileSdkVersion= 30
Original file line number Diff line number Diff line change 11package io.snabble.sdk.ui.cart
22
33import android.app.ProgressDialog
4+ import android.content.ActivityNotFoundException
45import android.content.Context
56import android.content.DialogInterface
7+ import android.content.Intent
8+ import android.content.pm.PackageManager
9+ import android.net.Uri
610import android.os.Bundle
711import android.util.AttributeSet
812import android.view.KeyEvent
@@ -82,7 +86,20 @@ class CheckoutBar @JvmOverloads constructor(
8286 }
8387
8488 googlePayButton.setOneShotClickListener {
85- payButtonClick()
89+ val packageName = " com.google.android.apps.walletnfcrel"
90+ val pm = context.packageManager
91+ try {
92+ pm.getPackageInfo(packageName, PackageManager .GET_ACTIVITIES )
93+ payButtonClick()
94+ } catch (e: PackageManager .NameNotFoundException ) {
95+ try {
96+ context.startActivity(Intent (Intent .ACTION_VIEW ,
97+ Uri .parse(" market://details?id=$packageName " )))
98+ } catch (e: ActivityNotFoundException ) {
99+ context.startActivity(Intent (Intent .ACTION_VIEW ,
100+ Uri .parse(" https://play.google.com/store/apps/details?id=$packageName " )))
101+ }
102+ }
86103 }
87104
88105 cart.addListener(cartChangeListener)
You can’t perform that action at this time.
0 commit comments