Toast show 로직 수정
This commit is contained in:
parent
daed389264
commit
f0a8ca5823
|
@ -48,10 +48,16 @@ class CanChargeIapFragment : BaseFragment<FragmentCanChargeIapBinding>(
|
||||||
}
|
}
|
||||||
} else if (billingResult.responseCode == BillingClient.BillingResponseCode.USER_CANCELED) {
|
} else if (billingResult.responseCode == BillingClient.BillingResponseCode.USER_CANCELED) {
|
||||||
selectedProductDetails = null
|
selectedProductDetails = null
|
||||||
handler.post { showToast("구매를 취소했습니다.") }
|
handler.post {
|
||||||
|
Toast.makeText(requireActivity(), "구매를 취소했습니다.", Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
selectedProductDetails = null
|
selectedProductDetails = null
|
||||||
handler.post { showToast("구매를 하지 못했습니다.\n다시 시도해 주세요.") }
|
Toast.makeText(
|
||||||
|
requireActivity(),
|
||||||
|
"구매를 하지 못했습니다.\n다시 시도해 주세요.",
|
||||||
|
Toast.LENGTH_LONG
|
||||||
|
).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +72,11 @@ class CanChargeIapFragment : BaseFragment<FragmentCanChargeIapBinding>(
|
||||||
purchase = purchase
|
purchase = purchase
|
||||||
) { chargeCan ->
|
) { chargeCan ->
|
||||||
handler.post {
|
handler.post {
|
||||||
showToast("캔이 충전되었습니다")
|
Toast.makeText(
|
||||||
|
requireActivity(),
|
||||||
|
"캔이 충전되었습니다",
|
||||||
|
Toast.LENGTH_LONG
|
||||||
|
).show()
|
||||||
SharedPreferenceManager.can += chargeCan
|
SharedPreferenceManager.can += chargeCan
|
||||||
|
|
||||||
val activity = requireActivity() as? CanChargeActivity
|
val activity = requireActivity() as? CanChargeActivity
|
||||||
|
@ -160,7 +170,13 @@ class CanChargeIapFragment : BaseFragment<FragmentCanChargeIapBinding>(
|
||||||
loadingDialog.show(screenWidth)
|
loadingDialog.show(screenWidth)
|
||||||
billingClient.startConnection(object : BillingClientStateListener {
|
billingClient.startConnection(object : BillingClientStateListener {
|
||||||
override fun onBillingServiceDisconnected() {
|
override fun onBillingServiceDisconnected() {
|
||||||
handler.post { showToast("인 앱 결제 이용이 불가능 합니다. 다시 시도해 주세요.") }
|
handler.post {
|
||||||
|
Toast.makeText(
|
||||||
|
requireActivity(),
|
||||||
|
"인 앱 결제 이용이 불가능 합니다. 다시 시도해 주세요.",
|
||||||
|
Toast.LENGTH_LONG
|
||||||
|
).show()
|
||||||
|
}
|
||||||
loadingDialog.dismiss()
|
loadingDialog.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +184,13 @@ class CanChargeIapFragment : BaseFragment<FragmentCanChargeIapBinding>(
|
||||||
if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
|
if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
|
||||||
queryAvailableCans()
|
queryAvailableCans()
|
||||||
} else {
|
} else {
|
||||||
handler.post { showToast("인 앱 결제 이용이 불가능 합니다. 다시 시도해 주세요.") }
|
handler.post {
|
||||||
|
Toast.makeText(
|
||||||
|
requireActivity(),
|
||||||
|
"인 앱 결제 이용이 불가능 합니다. 다시 시도해 주세요.",
|
||||||
|
Toast.LENGTH_LONG
|
||||||
|
).show()
|
||||||
|
}
|
||||||
loadingDialog.dismiss()
|
loadingDialog.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +224,13 @@ class CanChargeIapFragment : BaseFragment<FragmentCanChargeIapBinding>(
|
||||||
if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
|
if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
|
||||||
handler.post { adapter.addItems(productDetailsList) }
|
handler.post { adapter.addItems(productDetailsList) }
|
||||||
} else {
|
} else {
|
||||||
handler.post { showToast("인 앱 결제 이용이 불가능 합니다. 다시 시도해 주세요.") }
|
handler.post {
|
||||||
|
Toast.makeText(
|
||||||
|
requireActivity(),
|
||||||
|
"인 앱 결제 이용이 불가능 합니다. 다시 시도해 주세요.",
|
||||||
|
Toast.LENGTH_LONG
|
||||||
|
).show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handler.post { loadingDialog.dismiss() }
|
handler.post { loadingDialog.dismiss() }
|
||||||
|
|
Loading…
Reference in New Issue