|
|
@ -3,19 +3,34 @@ package com.remit.jmecustomer.features.myTransfers.view |
|
|
|
import MyBeneficiariesAllAdapter |
|
|
|
import android.content.Intent |
|
|
|
import android.os.Bundle |
|
|
|
import android.os.PersistableBundle |
|
|
|
import android.view.View |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import com.remit.jmecustomer.R |
|
|
|
import com.remit.jmecustomer.base.BaseActivity |
|
|
|
import com.remit.jmecustomer.common.customwidgets.common.GenericEditTextPromptDialog |
|
|
|
import com.remit.jmecustomer.common.customwidgets.common.GenericPromptDialog |
|
|
|
import com.remit.jmecustomer.databinding.FragmentBeneficiaryAllBinding |
|
|
|
import com.remit.jmecustomer.features.beneficiaryDetail.BeneficiaryDetailActivity |
|
|
|
import com.remit.jmecustomer.features.recipientmanagement.gateway.recipientlistingV3.RecipientListingV3Gateway |
|
|
|
import com.remit.jmecustomer.features.recipientmanagement.model.recipientModelV5.Receiver |
|
|
|
import com.remit.jmecustomer.features.recipientmanagement.model.recipientModelV5.RecentTransaction |
|
|
|
import com.remit.jmecustomer.features.recipientmanagement.model.recipientlistingV3.ReceiverInfoV3Model |
|
|
|
import com.remit.jmecustomer.features.recipientmanagement.presenter.recipientlistingV3.RecipientListingV3Presenter |
|
|
|
import com.remit.jmecustomer.features.recipientmanagement.presenter.recipientlistingV3.RecipientListingV3PresenterInterface |
|
|
|
import com.remit.jmecustomer.features.recipientmanagement.view.recepientTermsConditions.BeneficiaryAddEditV3TermsActivity |
|
|
|
import com.remit.jmecustomer.features.recipientmanagement.view.recipientaddeditV3.RecipientAddEditV3Activity |
|
|
|
import com.remit.jmecustomer.features.sendmoney.model.SendMoneyRequiredDataV3 |
|
|
|
import com.remit.jmecustomer.utils.Constants |
|
|
|
|
|
|
|
class MyBeneficiaryAllActivity : BaseActivity(), |
|
|
|
MyBeneficiariesAllAdapter.RecipientSelectionListener { |
|
|
|
MyBeneficiariesAllAdapter.RecipientSelectionListener, |
|
|
|
RecipientListingV3PresenterInterface.RecipientListingV3ContractInterface, |
|
|
|
GenericEditTextPromptDialog.GenericEditTextPromptListener { |
|
|
|
private lateinit var binding: FragmentBeneficiaryAllBinding |
|
|
|
private var adapter: MyBeneficiariesAllAdapter? = null |
|
|
|
private var mainList: ArrayList<Receiver>? = ArrayList() |
|
|
|
var presenter: RecipientListingV3PresenterInterface? = null |
|
|
|
private var genericEditTextPromptDialog: GenericEditTextPromptDialog? = null |
|
|
|
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) { |
|
|
@ -31,7 +46,8 @@ class MyBeneficiaryAllActivity : BaseActivity(), |
|
|
|
} |
|
|
|
|
|
|
|
fun init() { |
|
|
|
mainList = intent?.getParcelableArrayListExtra("receiver") |
|
|
|
presenter = RecipientListingV3Presenter(this, RecipientListingV3Gateway()) |
|
|
|
presenter!!.getAllRecipientListV5(null , Constants.CURRENT_COUNTRY_ID) |
|
|
|
var data: ArrayList<Receiver> = ArrayList() |
|
|
|
adapter = MyBeneficiariesAllAdapter(data, this) |
|
|
|
val layoutManagerVertical = LinearLayoutManager(this) |
|
|
@ -48,12 +64,124 @@ class MyBeneficiaryAllActivity : BaseActivity(), |
|
|
|
startActivity(intent) |
|
|
|
} |
|
|
|
|
|
|
|
override fun showAllRecipientToUser( |
|
|
|
recipientInfoModelList: MutableList<Receiver>, |
|
|
|
changeLayoutBehavior: Boolean |
|
|
|
) { |
|
|
|
adapter?.setData(recipientInfoModelList); |
|
|
|
} |
|
|
|
|
|
|
|
override fun showAllRecipientToUserV5( |
|
|
|
recipientInfoModelList: MutableList<Receiver>?, |
|
|
|
recentTransactionList: MutableList<RecentTransaction>?, |
|
|
|
changeLayoutBehavior: Boolean |
|
|
|
) { |
|
|
|
adapter?.setData(recipientInfoModelList) |
|
|
|
} |
|
|
|
|
|
|
|
override fun onRecipientDeletedSuccessfully(recipientToBeDeleted: String?) {} |
|
|
|
|
|
|
|
override fun showEmailCodePromptDialog() { |
|
|
|
genericEditTextPromptDialog = GenericEditTextPromptDialog() |
|
|
|
genericEditTextPromptDialog?.setTitleMessage(getString(R.string.enterCodeFromEmail_text)) |
|
|
|
genericEditTextPromptDialog?.setCancellable(false) |
|
|
|
genericEditTextPromptDialog?.setListener(this) |
|
|
|
if (!genericEditTextPromptDialog?.isAdded!!) genericEditTextPromptDialog?.show( |
|
|
|
supportFragmentManager, |
|
|
|
"PROMPTEDITTEXT" |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onEmailCodeNegativeButtonPressed() {} |
|
|
|
|
|
|
|
override fun onEmailCodePositiveBtnPressed(emailCode: String?) { |
|
|
|
presenter?.verifyEmailCode(emailCode) |
|
|
|
} |
|
|
|
|
|
|
|
override fun showNoRecipientFoundView(action: Boolean) { |
|
|
|
// if (action) { |
|
|
|
// recipientListRv.setVisibility(View.INVISIBLE) |
|
|
|
// noDataFoundTextView.setVisibility(View.VISIBLE) |
|
|
|
// } else { |
|
|
|
// recipientListRv.setVisibility(View.VISIBLE) |
|
|
|
// noDataFoundTextView.setVisibility(View.INVISIBLE) |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun promptToSendMoney( |
|
|
|
listener: GenericPromptDialog.GenericDialogPromptListener?, |
|
|
|
message: String? |
|
|
|
) { |
|
|
|
val genericPromptDialog = GenericPromptDialog() |
|
|
|
genericPromptDialog.setTitleMessage(getString(R.string.important_text)) |
|
|
|
genericPromptDialog.setBodyMessage(message) |
|
|
|
genericPromptDialog.setIconsRes(-1) |
|
|
|
genericPromptDialog.setCancellable(true) |
|
|
|
genericPromptDialog.setListener(listener) |
|
|
|
if (!genericPromptDialog.isAdded) genericPromptDialog.show( |
|
|
|
getSupportFragmentManager(), |
|
|
|
"PROMPTSENDMONEY" |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
override fun redirectToSendMoney(sendMoneyRequiredDataV3: SendMoneyRequiredDataV3?) { |
|
|
|
// val intent = Intent(requireContext(), SendMoneyV2Activity::class.java) |
|
|
|
// intent.putExtra( |
|
|
|
// RecipientAddEditV3Activity.RECIPIENT_INFO_BUNDLE_KEY_v3, |
|
|
|
// sendMoneyRequiredDataV3 |
|
|
|
// ) |
|
|
|
// startActivityForResult( |
|
|
|
// intent, |
|
|
|
// RecipientAddEditV3Activity.RECIPIENT_ACTION_EDIT_REQUEST_CODE_v3 |
|
|
|
// ) |
|
|
|
} |
|
|
|
|
|
|
|
override fun proceedToEditRecipient(recipientInfoModel: ReceiverInfoV3Model) { |
|
|
|
val intent = Intent(this, RecipientAddEditV3Activity::class.java) |
|
|
|
intent.putExtra(RecipientAddEditV3Activity.RECIPIENT_INFO_BUNDLE_KEY_v3, recipientInfoModel) |
|
|
|
startActivityForResult( |
|
|
|
intent, |
|
|
|
RecipientAddEditV3Activity.RECIPIENT_ACTION_EDIT_REQUEST_CODE_v3 |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
override fun proceedToShowTermsConditions(recipientInfoModel: ReceiverInfoV3Model?) { |
|
|
|
val intent = Intent(this, BeneficiaryAddEditV3TermsActivity::class.java) |
|
|
|
intent.putExtra( |
|
|
|
BeneficiaryAddEditV3TermsActivity.RECIPIENT_TERMS_BUNDLE_KEY_v3, |
|
|
|
recipientInfoModel |
|
|
|
) |
|
|
|
startActivityForResult( |
|
|
|
intent, |
|
|
|
RecipientAddEditV3Activity.RECIPIENT_ACTION_EDIT_REQUEST_CODE_v3 |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun promptToEditRecipient( |
|
|
|
genericDialogPromptListener: GenericPromptDialog.GenericDialogPromptListener?, |
|
|
|
message: String? |
|
|
|
) { |
|
|
|
val genericPromptDialog = GenericPromptDialog() |
|
|
|
genericPromptDialog.setTitleMessage(getString(R.string.important_text)) |
|
|
|
genericPromptDialog.setBodyMessage(message) |
|
|
|
genericPromptDialog.setIconsRes(-1) |
|
|
|
genericPromptDialog.setCancellable(true) |
|
|
|
genericPromptDialog.setListener(genericDialogPromptListener) |
|
|
|
if (!genericPromptDialog.isAdded) genericPromptDialog.show( |
|
|
|
getSupportFragmentManager(), |
|
|
|
"RECIPIENTEDITPROMPT" |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
override fun proceedToDeleteRecipient(receiverInfoV3Model: Receiver) { |
|
|
|
// showBeneficiaryDeleteConfirmDialog(receiverInfoV3Model) |
|
|
|
} |
|
|
|
|
|
|
|
override fun proceedToEditRecipient(receiverInfoV3Model: Receiver) { |
|
|
|
} |
|
|
|
|
|
|
|
override fun onAllRecipientDeleted() { |
|
|
|
} |
|
|
|
override fun onAllRecipientDeleted() {} |
|
|
|
} |