|
|
@ -37,6 +37,11 @@ import com.remit.jmecustomer.features.sendmoney.view.SendMoneyV2TransactionCompl |
|
|
|
import com.remit.jmecustomer.features.transactionhistory.presenter.TransactionHistoryV2Presenter |
|
|
|
import com.remit.jmecustomer.features.transactionhistory.view.RemitTransactionHistoryActivity.TransactionHistoryViewType |
|
|
|
import com.remit.jmecustomer.features.transactionhistory.view.international.InternationalTransactionHistoryContainerFragmentV2.SearchableTransactionHistory |
|
|
|
import com.remit.jmecustomer.utils.Constants |
|
|
|
import com.remit.jmecustomer.utils.Utils |
|
|
|
import com.tsongkha.spinnerdatepicker.DatePicker |
|
|
|
import com.tsongkha.spinnerdatepicker.DateRangePickerDialog.OnRangeDateSetListener |
|
|
|
import com.tsongkha.spinnerdatepicker.SpinnerDateRangePickerDialogBuilder |
|
|
|
import java.util.* |
|
|
|
|
|
|
|
class MyTransfersFragment : BaseFragment(), |
|
|
@ -70,7 +75,7 @@ class MyTransfersFragment : BaseFragment(), |
|
|
|
init() |
|
|
|
Handler().postDelayed({ |
|
|
|
if (!(requireActivity() as HomeActivityV3).isNotificaitonViewActive()) { |
|
|
|
performDefaultAction("151") |
|
|
|
performDefaultAction(Constants.CURRENT_COUNTRY_ID) |
|
|
|
} |
|
|
|
}, 2000) |
|
|
|
setUpData() |
|
|
@ -114,6 +119,7 @@ class MyTransfersFragment : BaseFragment(), |
|
|
|
|
|
|
|
override fun onResume() { |
|
|
|
super.onResume() |
|
|
|
performDefaultAction(Constants.CURRENT_COUNTRY_ID) |
|
|
|
binding.edtSearchTransfers!!.addTextChangedListener(searchEditTextTextWatcher) |
|
|
|
} |
|
|
|
|
|
|
@ -128,11 +134,12 @@ class MyTransfersFragment : BaseFragment(), |
|
|
|
binding.edtSearchTransfers!!.addTextChangedListener(searchEditTextTextWatcher) |
|
|
|
binding.addRecipientView.setOnClickListener(this) |
|
|
|
binding.rvInitials.setOnClickListener(this) |
|
|
|
binding.ivCalendar.setOnClickListener(this) |
|
|
|
} |
|
|
|
|
|
|
|
fun performDefaultAction(countryId: String?) { |
|
|
|
// iv_cancel!!.visibility = View.INVISIBLE |
|
|
|
presenter!!.getAllRecipientListV5(null, countryId) |
|
|
|
presenter!!.getAllRecipientListV5(null, countryId, "", "", "") |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -344,6 +351,10 @@ class MyTransfersFragment : BaseFragment(), |
|
|
|
), RecipientAddEditV3Activity.RECIPIENT_ACTION_EDIT_REQUEST_CODE_v3 |
|
|
|
) |
|
|
|
R.id.iv_back -> requireActivity().onBackPressed() |
|
|
|
|
|
|
|
R.id.iv_calendar -> { |
|
|
|
promptCalendarPicker() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -445,4 +456,76 @@ class MyTransfersFragment : BaseFragment(), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private fun promptCalendarPicker() { |
|
|
|
SpinnerDateRangePickerDialogBuilder() |
|
|
|
.context(requireContext()) |
|
|
|
.spinnerTheme(R.style.NumberPickerStyle) |
|
|
|
.showTitle(true) |
|
|
|
.showDaySpinner(true) |
|
|
|
.defaultDate(1990, 0, 1) |
|
|
|
.setCurrentDateAsMaxDate() |
|
|
|
.minDate(2017, 9, 10) |
|
|
|
.dialogTheme(R.style.DatePickerTheme) |
|
|
|
.showTitle(true) |
|
|
|
.setTitle(getString(R.string.filter_by_date_text)) |
|
|
|
.setFromTitle(getString(R.string.from_text) + " :") |
|
|
|
.setToTitle(getString(R.string.to_text) + " :") |
|
|
|
.setPositiveButtonText(getString(R.string.ok_text)) |
|
|
|
.setNegativeButtonText(getString(R.string.cancel_text)) |
|
|
|
.callback(object : OnRangeDateSetListener { |
|
|
|
private var startDate = "" |
|
|
|
private var endDate = "" |
|
|
|
override fun onFromDateSet( |
|
|
|
datePicker: DatePicker, |
|
|
|
year: Int, |
|
|
|
monthOfYear: Int, |
|
|
|
dayOfMonth: Int |
|
|
|
) { |
|
|
|
startDate = |
|
|
|
Integer.toString(year) + "-" + Integer.toString(monthOfYear + 1) + "-" + Integer.toString( |
|
|
|
dayOfMonth |
|
|
|
) |
|
|
|
binding.tvFromDate.setText( |
|
|
|
Utils.formateDateFromstring( |
|
|
|
Utils.getDefaultDateFormat(), |
|
|
|
"MMM d, yyyy", |
|
|
|
startDate |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
override fun onToDateSet( |
|
|
|
datePicker: DatePicker, |
|
|
|
year: Int, |
|
|
|
monthOfYear: Int, |
|
|
|
dayOfMonth: Int |
|
|
|
) { |
|
|
|
endDate = |
|
|
|
Integer.toString(year) + "-" + Integer.toString(monthOfYear + 1) + "-" + Integer.toString( |
|
|
|
dayOfMonth |
|
|
|
) |
|
|
|
binding.tvToDate.setText( |
|
|
|
Utils.formateDateFromstring( |
|
|
|
Utils.getDefaultDateFormat(), |
|
|
|
"MMM d, yyyy", |
|
|
|
endDate |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
override fun onInvalidRangeSelected() { |
|
|
|
showToastMessage(getString(R.string.invalid_date_range_selected)) |
|
|
|
} |
|
|
|
|
|
|
|
override fun onDateRangeReceivedSucess() { |
|
|
|
if (binding.dateContainer.getVisibility() != View.VISIBLE) binding.dateContainer.setVisibility( |
|
|
|
View.VISIBLE |
|
|
|
) |
|
|
|
presenter!!.getAllRecipientListV5(null, Constants.CURRENT_COUNTRY_ID, startDate, endDate, "5") |
|
|
|
} |
|
|
|
}) |
|
|
|
.build() |
|
|
|
.show() |
|
|
|
} |
|
|
|
} |