Browse Source

recent transactions filter changes

new_design
Mohan Shiwakoti 1 year ago
parent
commit
f9a4a42d27
  1. 7
      app/src/main/java/com/remit/jmecustomer/features/homeV3/view/HomeActivityV3.kt
  2. 2
      app/src/main/java/com/remit/jmecustomer/features/homeV3/view/HomeFragmentV3.kt
  3. 4
      app/src/main/java/com/remit/jmecustomer/features/myTransfers/adapters/RecentTransactionsAdapter.kt
  4. 3
      app/src/main/java/com/remit/jmecustomer/features/myTransfers/view/MyBeneficiaryAllActivity.kt
  5. 2
      app/src/main/java/com/remit/jmecustomer/features/myTransfers/view/MyTransferActivity.kt
  6. 87
      app/src/main/java/com/remit/jmecustomer/features/myTransfers/view/MyTransfersFragment.kt
  7. 4
      app/src/main/java/com/remit/jmecustomer/features/recipientmanagement/gateway/recipientlistingV3/RecipientListingV3Gateway.java
  8. 3
      app/src/main/java/com/remit/jmecustomer/features/recipientmanagement/presenter/recipientlistingV3/RecipientListingV3InteractorInterface.java
  9. 9
      app/src/main/java/com/remit/jmecustomer/features/recipientmanagement/presenter/recipientlistingV3/RecipientListingV3Presenter.java
  10. 20
      app/src/main/java/com/remit/jmecustomer/features/recipientmanagement/presenter/recipientlistingV3/RecipientListingV3PresenterInterface.java
  11. 1
      app/src/main/java/com/remit/jmecustomer/features/sendmoney/view/SendMoneyV2TransactionCompleteActivity.java
  12. 5
      app/src/main/java/com/remit/jmecustomer/utils/https/ApiEndpoints.java
  13. 78
      app/src/main/res/layout/fragment_my_transfers.xml

7
app/src/main/java/com/remit/jmecustomer/features/homeV3/view/HomeActivityV3.kt

@ -97,6 +97,7 @@ class HomeActivityV3 : BaseActivity(), HomeParentViewContractV2,
private var sendMoneyRequiredData: SendMoneyRequiredDataV3? = null
private var presenterTransaction: TransactionHistoryV2Presenter? = null
lateinit var homeFragmentV3: HomeFragmentV3
private var isTransactionComplete: Boolean = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityHomeV3Binding.inflate(layoutInflater)
@ -112,6 +113,8 @@ class HomeActivityV3 : BaseActivity(), HomeParentViewContractV2,
intent.getBooleanExtra(HomeActivityV2.PROMPT_FINGERPRINT_BUNDLE_FLAG, false)
)
isTransactionComplete = intent?.extras?.getBoolean("trans", false) ?: false
viewModel = ViewModelProvider(this, homeViewModelFactory).get(HomeViewModel::class.java)
viewModel!!.getRequiredData()
sendMoneyRequiredData = SendMoneyRequiredDataV3(ReceiverInfoV3Model())
@ -139,6 +142,10 @@ class HomeActivityV3 : BaseActivity(), HomeParentViewContractV2,
binding.tabLayout.addTab(tab2)
binding.tabLayout.addTab(tab3)
if (isTransactionComplete) {
binding.vpDashboard.currentItem = 1
}
binding.vpDashboard.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrolled(
position: Int,

2
app/src/main/java/com/remit/jmecustomer/features/homeV3/view/HomeFragmentV3.kt

@ -157,6 +157,8 @@ class HomeFragmentV3 : BaseFragment(), View.OnClickListener,
if (homeViewRelatedDTOV2.homeNotificationViewDTO != null) {
this.homeViewRelatedDTOV2 = homeViewRelatedDTOV2
showNotificationView(homeViewRelatedDTOV2.homeNotificationViewDTO)
} else {
removeNotification()
}
homeViewModel?.showChangedNotification(homeViewRelatedDTOV2.notificationCount)
}

4
app/src/main/java/com/remit/jmecustomer/features/myTransfers/adapters/RecentTransactionsAdapter.kt

@ -45,11 +45,11 @@ class RecentTransactionsAdapter(private var items: MutableList<RecentTransaction
}
if (item.payStatus.equals("Paid")) {
holder.bindings.tvStatus.text = mContext?.getString(R.string.successful)
holder.bindings.tvStatus.text = item.getPayStatus()
holder.bindings.tvStatus.setBackgroundResource(R.drawable.rounded_green)
holder.bindings.tvViewStatus.text = mContext?.getString(R.string.view_status)
} else {
holder.bindings.tvStatus.text = mContext?.getString(R.string.pending)
holder.bindings.tvStatus.text = item.getPayStatus()
holder.bindings.tvStatus.setBackgroundResource(R.drawable.rounded_red)
holder.bindings.tvViewStatus.text = mContext?.getString(R.string.edit_details)
holder.bindings.tvResend.visibility = View.GONE

3
app/src/main/java/com/remit/jmecustomer/features/myTransfers/view/MyBeneficiaryAllActivity.kt

@ -20,7 +20,6 @@ import com.remit.jmecustomer.features.recipientmanagement.presenter.recipientlis
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,
@ -47,7 +46,7 @@ class MyBeneficiaryAllActivity : BaseActivity(),
fun init() {
presenter = RecipientListingV3Presenter(this, RecipientListingV3Gateway())
presenter!!.getAllRecipientListV5(null , Constants.CURRENT_COUNTRY_ID)
presenter!!.getAllRecipientListV5(null, "0", "","","")
var data: ArrayList<Receiver> = ArrayList()
adapter = MyBeneficiariesAllAdapter(data, this)
val layoutManagerVertical = LinearLayoutManager(this)

2
app/src/main/java/com/remit/jmecustomer/features/myTransfers/view/MyTransferActivity.kt

@ -114,7 +114,7 @@ class MyTransferActivity : BaseActivity(),
fun performDefaultAction(countryId: String?) {
// iv_cancel!!.visibility = View.INVISIBLE
presenter!!.getAllRecipientListV5(null, countryId)
presenter!!.getAllRecipientListV5(null, countryId, "", "", "")
}

87
app/src/main/java/com/remit/jmecustomer/features/myTransfers/view/MyTransfersFragment.kt

@ -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()
}
}

4
app/src/main/java/com/remit/jmecustomer/features/recipientmanagement/gateway/recipientlistingV3/RecipientListingV3Gateway.java

@ -18,8 +18,8 @@ public class RecipientListingV3Gateway extends PrivilegedGateway implements Reci
}
@Override
public Observable<ResponseBody> getAllRecipientFromNetworkV5(String auth, String Uid, String countryId) {
return HttpClientV2.getInstance().getAllRecipientV5(auth, Uid , countryId);
public Observable<ResponseBody> getAllRecipientFromNetworkV5(String auth, String Uid, String countryId, JsonObject jsonObject) {
return HttpClientV2.getInstance().getAllRecipientV5(auth, Uid , countryId , jsonObject);
}
@Override

3
app/src/main/java/com/remit/jmecustomer/features/recipientmanagement/presenter/recipientlistingV3/RecipientListingV3InteractorInterface.java

@ -1,5 +1,6 @@
package com.remit.jmecustomer.features.recipientmanagement.presenter.recipientlistingV3;
import com.google.gson.JsonObject;
import com.remit.jmecustomer.base.BaseInteractorInterface;
import com.remit.jmecustomer.base.PrivilegedGatewayInterface;
@ -12,7 +13,7 @@ public interface RecipientListingV3InteractorInterface extends BaseInteractorInt
interface RecipientListingV3GatewayInterface extends PrivilegedGatewayInterface {
Observable<ResponseBody> getAllRecipientFromNetwork(String auth, String Uid);
Observable<ResponseBody> getAllRecipientFromNetworkV5(String auth, String Uid , String countryId);
Observable<ResponseBody> getAllRecipientFromNetworkV5(String auth, String Uid , String countryId , JsonObject jsonObject);
Observable<ResponseBody> deleteRecipientFromNetwork(String auth, String Uid, String recipientID);

9
app/src/main/java/com/remit/jmecustomer/features/recipientmanagement/presenter/recipientlistingV3/RecipientListingV3Presenter.java

@ -1,5 +1,6 @@
package com.remit.jmecustomer.features.recipientmanagement.presenter.recipientlistingV3;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.remit.jmecustomer.R;
import com.remit.jmecustomer.base.BasePresenter;
@ -61,12 +62,16 @@ public class RecipientListingV3Presenter extends BasePresenter implements Recipi
}
@Override
public void getAllRecipientListV5(Runnable task, String countryId) {
public void getAllRecipientListV5(Runnable task, String countryId, String fromDate, String toDate, String Page) {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("fromDate", fromDate);
jsonObject.addProperty("toDate", toDate);
jsonObject.addProperty("Page", Page);
compositeDisposable.add(
this.gateway.getAllRecipientFromNetworkV5(
gateway.getAuth(),
gateway.getUserIDNumber(),
countryId)
countryId, jsonObject)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe(disposable -> view.showProgressBar(true, getStringfromStringId(R.string.processing_request_text)))

20
app/src/main/java/com/remit/jmecustomer/features/recipientmanagement/presenter/recipientlistingV3/RecipientListingV3PresenterInterface.java

@ -14,13 +14,14 @@ public interface RecipientListingV3PresenterInterface extends BasePresenterInter
void getAllRecipientList(Runnable task);
void getAllRecipientListV5(Runnable task , String countryId);
void getAllRecipientListV5(Runnable task, String countryId,
String fromDate, String toDate, String Page);
void deleteRecipient(String recipientId);
void verifyEmailCode(String emailCode);
void saveSelectedRecipientInformationForSendMoney(ReceiverInfoV3Model recipientInfoModel);
void searchForReciever(String keyword);
@ -29,16 +30,18 @@ public interface RecipientListingV3PresenterInterface extends BasePresenterInter
void saveSelectedRecipientInfomation(ReceiverInfoV3Model recipientInfoModel);
void onRecipentUpdatedSucesss(String receiverId );
void onRecipentUpdatedSucesss(String receiverId);
void requestForOtp(ReceiverInfoV3Model recipientInfoModel);
interface RecipientListingV3ContractInterface extends BaseContractInterface
{
interface RecipientListingV3ContractInterface extends BaseContractInterface {
void showAllRecipientToUser(List<Receiver> recipientInfoModelList, boolean changeLayoutBehavior);
default void showAllRecipientToUserV5(List<Receiver> recipientInfoModelList, List<RecentTransaction> recentTransactionList, boolean changeLayoutBehavior){};
default void showAllRecipientToUserV5(List<Receiver> recipientInfoModelList, List<RecentTransaction> recentTransactionList, boolean changeLayoutBehavior) {
}
;
void onRecipientDeletedSuccessfully(String recipientToBeDeleted);
@ -47,13 +50,14 @@ public interface RecipientListingV3PresenterInterface extends BasePresenterInter
void showNoRecipientFoundView(boolean action);
void promptToSendMoney(GenericPromptDialog.GenericDialogPromptListener listener,String message);
void promptToSendMoney(GenericPromptDialog.GenericDialogPromptListener listener, String message);
void redirectToSendMoney(SendMoneyRequiredDataV3 sendMoneyRequiredDataV3);
void proceedToEditRecipient(ReceiverInfoV3Model recipientInfoModel);
void proceedToShowTermsConditions(ReceiverInfoV3Model recipientInfoModel);
void promptToEditRecipient(GenericPromptDialog.GenericDialogPromptListener genericDialogPromptListener,String message);
void promptToEditRecipient(GenericPromptDialog.GenericDialogPromptListener genericDialogPromptListener, String message);
}
}

1
app/src/main/java/com/remit/jmecustomer/features/sendmoney/view/SendMoneyV2TransactionCompleteActivity.java

@ -323,6 +323,7 @@ public class SendMoneyV2TransactionCompleteActivity extends BaseActivity impleme
a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
a.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
a.putExtra(BUNDLE_ACTION_FETCH_ALL_DATA, true);
a.putExtra("trans", true);
startActivity(a);
finish();
break;

5
app/src/main/java/com/remit/jmecustomer/utils/https/ApiEndpoints.java

@ -190,10 +190,11 @@ public interface ApiEndpoints {
@Headers("Content-Type: application/json")
Observable<ResponseBody> getAllRecipientV3(@Header("Authorization") String token, @Path("senderId") String senderId);
@GET(API_URL.GET_ALL_RECIPIENT_V5)
@POST(API_URL.GET_ALL_RECIPIENT_V5)
@Headers("Content-Type: application/json")
Observable<ResponseBody> getAllRecipientV5(@Header("Authorization") String token, @Path("customer") String senderId ,
@Path("countryId") String countryId);
@Path("countryId") String countryId,
@Body() JsonObject jsonObject);
@GET(API_URL.GET_COUNTRY_AND_RELATED_SERVICES)
@Headers("Content-Type: application/json")

78
app/src/main/res/layout/fragment_my_transfers.xml

@ -146,7 +146,7 @@
<TextView
android:id="@+id/tv_transctions"
style="@style/TextStyle.VolteSemiBold14"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_16sdp"
android:layout_marginTop="@dimen/_8sdp"
@ -155,6 +155,80 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view2" />
<ImageView
app:layout_constraintTop_toTopOf="@+id/tv_transctions"
app:layout_constraintBottom_toBottomOf="@id/tv_transctions"
app:layout_constraintTop_toBottomOf="@+id/view2"
app:layout_constraintEnd_toEndOf="parent"
android:id="@+id/iv_calendar"
android:layout_marginEnd="@dimen/_10sdp"
android:layout_alignParentRight="true"
android:layout_width="@dimen/_40sdp"
android:padding="13dp"
android:gravity="center"
android:layout_height="@dimen/_40sdp"
app:srcCompat="@drawable/icv_calendar" />
<LinearLayout
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_transctions"
android:id="@+id/dateContainer"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal"
android:paddingBottom="@dimen/_3sdp"
android:paddingTop="@dimen/_7sdp"
android:visibility="gone">
<TextView
android:id="@+id/tv_from_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_6sdp"
style="@style/TextStyle.VolteSemiBold12"
android:layout_marginLeft="@dimen/_6sdp"
android:layout_marginRight="@dimen/_6sdp"
android:layout_marginStart="@dimen/_6sdp"
android:gravity="center"
android:padding="@dimen/_2sdp"
android:textColor="@color/darkgray"
android:textSize="@dimen/_11ssp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_6sdp"
android:layout_marginLeft="@dimen/_6sdp"
style="@style/TextStyle.VolteSemiBold12"
android:layout_marginRight="@dimen/_6sdp"
android:layout_marginStart="@dimen/_6sdp"
android:gravity="center"
android:padding="@dimen/_2sdp"
android:text="-"
android:textColor="@color/darkgray"
android:textSize="@dimen/_11ssp" />
<TextView
android:id="@+id/tv_to_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/TextStyle.VolteSemiBold12"
android:layout_marginEnd="@dimen/_6sdp"
android:layout_marginLeft="@dimen/_6sdp"
android:layout_marginRight="@dimen/_6sdp"
android:layout_marginStart="@dimen/_6sdp"
android:gravity="center"
android:padding="@dimen/_2sdp"
android:textColor="@color/darkgray"
android:textSize="@dimen/_11ssp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/transactionHistoryRv"
@ -166,7 +240,7 @@
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_transctions" />
app:layout_constraintTop_toBottomOf="@+id/dateContainer" />
<com.remit.jmecustomer.common.customwidgets.GmeEditText
android:paddingTop="50dp"

Loading…
Cancel
Save