Growth(TP-15388): Added unbind() to avoid Memory leaks (#4957)

* Growth(TP-15388): Added unbind() to avoid Memory leaks

* Code fix

Co-authored-by: shubham-icpcw9 <shubham.patwarika@gmail.com>
This commit is contained in:
Shubham Patwarika
2023-01-18 09:58:19 +05:30
committed by GitHub Enterprise
parent 2cd6a3b43e
commit a3a4a58c5b
13 changed files with 57 additions and 0 deletions

View File

@@ -527,6 +527,11 @@ class DigitalGoldBuyActivity : BaseActivity(), WidgetCallback, NewBottomSheetLis
pgRepaymentStatus(description, data)
}
override fun onDestroy() {
super.onDestroy()
binding.unbind()
}
private fun pgRepaymentStatus(
description: String?,
data: PaymentData?,

View File

@@ -348,6 +348,7 @@ class DigitalGoldHomeActivity : BaseActivity(), WidgetCallback, NewBottomSheetLi
super.onDestroy()
timer?.cancel()
timer = null
binding.unbind()
}
companion object {

View File

@@ -520,6 +520,11 @@ class DigitalGoldSellActivity : BaseActivity(), WidgetCallback, NewBottomSheetLi
handleBackPress()
}
override fun onDestroy() {
super.onDestroy()
binding.unbind()
}
companion object {
private const val CLOSE = "CLOSE"
}

View File

@@ -138,6 +138,11 @@ class DigitalGoldSellFragment : BaseFragment(), WidgetCallback {
}
}
override fun onDestroyView() {
super.onDestroyView()
binding.unbind()
}
companion object {
const val TAG = "sellScreen"
fun getInstance() = DigitalGoldSellFragment().apply { }

View File

@@ -129,6 +129,11 @@ class DigitalGoldSellUpiFragment : BaseFragment(), WidgetCallback {
binding.shimmerLayout.isVisible = false
}
override fun onDestroyView() {
super.onDestroyView()
binding.unbind()
}
override fun getLifeCycle(): Lifecycle = lifecycle
override fun widgetUserData(key: String, value: Any) {

View File

@@ -123,6 +123,11 @@ class DigitalGoldTransactionActivity : BaseActivity(), WidgetCallback {
}
}
override fun onDestroy() {
super.onDestroy()
binding.unbind()
}
override val screenName: String = DIGITAL_GOLD_TRANSACTION_SCREEN

View File

@@ -522,6 +522,7 @@ class NewDashboardActivity :
if (::updateInAppDialog.isInitialized) {
updateInAppDialog.safelyDismissDialog()
}
binding.unbind()
}
override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {

View File

@@ -819,6 +819,11 @@ class HomeFragment : PaymentBaseFragment(), WidgetCallback, PlayStoreActionListe
)
}
override fun onDestroyView() {
super.onDestroyView()
binding.unbind()
}
companion object {
const val TAG = "HOME"
fun newInstance(bundle: Bundle?): HomeFragment {

View File

@@ -267,6 +267,11 @@ class ReferralHomeActivity : BaseActivity(), WidgetCallback {
})
}
override fun onDestroy() {
super.onDestroy()
binding.unbind()
}
companion object {
private const val APP_SHARE_IMAGE_FILE_NAME = "image.png"
}

View File

@@ -317,6 +317,11 @@ class LoginFragment : BaseFragment(), View.OnClickListener {
fragmentStateListener = null
}
override fun onDestroyView() {
super.onDestroyView()
binding.unbind()
}
override val screenName: String
get() = NaviAnalytics.PHONE_NUMBER

View File

@@ -217,6 +217,11 @@ class RewardDelightActivity : BaseActivity(), ActionButtonClickListener {
}
}
override fun onDestroy() {
super.onDestroy()
binding.unbind()
}
companion object {
const val KEY_REWARD_INFO = "KEY_REWARD_INFO"
const val MESSAGE_TEXT = "MESSAGE_TEXT"

View File

@@ -186,6 +186,11 @@ class RewardsAnnouncementFragment :
}
}
override fun onDestroyView() {
super.onDestroyView()
binding.unbind()
}
companion object {
const val TAG = "RewardsAnnouncementFragment"
private const val KEY_REWARDS_ANNOUNCEMENT_DATA = "KEY_REWARDS_ANNOUNCEMENT_DATA"

View File

@@ -53,4 +53,9 @@ abstract class BaseDialogFragment<T : ViewDataBinding>(
if (isResumed)
dismiss()
}
override fun onDestroyView() {
super.onDestroyView()
binding.unbind()
}
}