You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core-sdk-samples/higgs-shop-sample-app/app/src/main/kotlin/com/mparticle/example/higgsshopsampleapp/activities/MainActivity.kt
Copy file name to clipboardExpand all lines: core-sdk-samples/higgs-shop-sample-app/app/src/main/kotlin/com/mparticle/example/higgsshopsampleapp/fragments/CartFragment.kt
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,12 @@ class CartFragment : Fragment() {
Copy file name to clipboardExpand all lines: core-sdk-samples/higgs-shop-sample-app/app/src/main/kotlin/com/mparticle/example/higgsshopsampleapp/fragments/ShopFragment.kt
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -78,5 +78,20 @@ class ShopFragment : Fragment() {
78
78
}
79
79
})
80
80
shopViewModel.getProducts(this.requireContext())
81
+
82
+
shopViewModel.cartTotalSizeResponseLiveData.observe(viewLifecycleOwner, Observer { total ->
Copy file name to clipboardExpand all lines: core-sdk-samples/higgs-shop-sample-app/app/src/main/kotlin/com/mparticle/example/higgsshopsampleapp/viewmodels/CartViewModel.kt
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ import java.math.BigDecimal
18
18
classCartViewModel : ViewModel() {
19
19
val cartResponseLiveData =MutableLiveData<List<CartItemEntity>>()
20
20
val cartSubtotalPriceLiveData =MutableLiveData<BigDecimal>()
21
+
val cartTotalLiveData =MutableLiveData<Int>()
21
22
privateval cartRepository =CartRepository()
22
23
privatevalTAG="CartViewModel"
23
24
@@ -27,6 +28,17 @@ class CartViewModel : ViewModel() {
Copy file name to clipboardExpand all lines: core-sdk-samples/higgs-shop-sample-app/app/src/main/kotlin/com/mparticle/example/higgsshopsampleapp/viewmodels/ShopViewModel.kt
0 commit comments