TP-72872 | Rpd changes master ay (#11730)
This commit is contained in:
@@ -446,7 +446,7 @@ class OrderStatusFragment :
|
||||
binding.rewardLottie.isVisible = true
|
||||
viewModel.setRewardLottieVisibility(true)
|
||||
|
||||
setSpringAnimation(binding.rewardLottie, 600, 200)
|
||||
setSpringAnimation(binding.rewardLottie, 500, 200)
|
||||
|
||||
// Start the Lottie animation
|
||||
binding.rewardLottie.setAnimation(lottieUrl)
|
||||
|
||||
@@ -10,6 +10,8 @@ package com.navi.amc.common.fragment
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.pm.ResolveInfo
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
@@ -33,10 +35,12 @@ import com.navi.amc.utils.AmcAnalytics.BANK_VERIFICATION_OPTIONS
|
||||
import com.navi.amc.utils.AmcAnalytics.CHANGE_BANK
|
||||
import com.navi.amc.utils.AmcAnalytics.PENNY_DROP_OPTIONS
|
||||
import com.navi.amc.utils.AmcAnalytics.UPI_APP_AVAILABLE
|
||||
import com.navi.amc.utils.Constant.NAVI
|
||||
import com.navi.amc.utils.Constant.PD
|
||||
import com.navi.amc.utils.Constant.RPD
|
||||
import com.navi.amc.utils.Constant.TOKEN
|
||||
import com.navi.amc.utils.Constant.UPILINK
|
||||
import com.navi.amc.utils.Constant.UPI_INTENT
|
||||
import com.navi.amc.utils.isUpiAppAvailable
|
||||
import com.navi.amc.utils.orValue
|
||||
import com.navi.base.model.ActionData
|
||||
@@ -216,12 +220,35 @@ class PennyDropOptionsFragment() : AmcBaseFragment() {
|
||||
|
||||
private fun upiIntent(link: String) {
|
||||
try {
|
||||
val intent =
|
||||
Intent().apply {
|
||||
setAction(Intent.ACTION_VIEW)
|
||||
setData(Uri.parse(link))
|
||||
val intent = Intent(Intent.ACTION_VIEW).apply { data = Uri.parse(UPI_INTENT) }
|
||||
val resolveInfoList: MutableList<ResolveInfo>? =
|
||||
(context?.packageManager)?.queryIntentActivities(
|
||||
intent,
|
||||
PackageManager.MATCH_DEFAULT_ONLY
|
||||
)
|
||||
val targetIntents: MutableList<Intent> = ArrayList()
|
||||
if (resolveInfoList != null) {
|
||||
for (resolveInfo in resolveInfoList) {
|
||||
val packageName = resolveInfo.activityInfo.packageName
|
||||
|
||||
// Exclude the specific app
|
||||
if (!packageName.contains(NAVI, true)) {
|
||||
val targetIntent =
|
||||
Intent(Intent.ACTION_VIEW).apply {
|
||||
data = Uri.parse(link)
|
||||
`package` = packageName
|
||||
}
|
||||
targetIntents.add(targetIntent)
|
||||
}
|
||||
}
|
||||
startActivityForResult(intent, REQUEST_CODE)
|
||||
if (targetIntents.isNotEmpty()) {
|
||||
val chooserIntent =
|
||||
Intent.createChooser(Intent(), "Choose UPI App").apply {
|
||||
putExtra(Intent.EXTRA_INITIAL_INTENTS, targetIntents.toTypedArray())
|
||||
}
|
||||
startActivityForResult(chooserIntent, REQUEST_CODE)
|
||||
}
|
||||
}
|
||||
} catch (ex: Exception) {
|
||||
sendEvent(
|
||||
AmcAnalytics.RPD_ABORTED,
|
||||
|
||||
@@ -190,4 +190,6 @@ object Constant {
|
||||
const val PAYMENT_TIMESTAMP = "paymentTimeStamp"
|
||||
const val FUND_ID = "fundId"
|
||||
const val RUPEE_SYMBOL = "₹"
|
||||
const val UPI_INTENT = "upi://pay"
|
||||
const val NAVI = "navi"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user