Preyea Regmi
4 years ago
45 changed files with 2235 additions and 164 deletions
-
BIN.idea/caches/build_file_checksums.ser
-
1app/build.gradle
-
185app/src/main/AndroidManifest.xml
-
28app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/CashPickupViewModelFactory.java
-
7app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/gateway/CashPickupToWalletGateway.java
-
185app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/model/CashPickupTxnDetailDTO.java
-
13app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/presenter/CashPickupToWalletGatewayInterface.java
-
210app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/presenter/CashPickupToWalletPresenter.java
-
26app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/presenter/CashPickupToWalletPresenterInterface.java
-
101app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/view/CashPickupToWalletActivity.java
-
129app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/view/CashPickupTxnDetailFragment.java
-
68app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/view/SearchCashPickupTxnFragment.java
-
3app/src/main/java/com/swifttech/remit/android/features/login/view/LoginV2Activity.java
-
28app/src/main/java/com/swifttech/remit/android/features/otpverification/OTPVerificationViewModelFactory.java
-
26app/src/main/java/com/swifttech/remit/android/features/otpverification/gateway/OTPVerificationGateway.java
-
19app/src/main/java/com/swifttech/remit/android/features/otpverification/model/OTPSubmitModelDTO.java
-
14app/src/main/java/com/swifttech/remit/android/features/otpverification/presenter/OTPVerificationGatewayInterface.java
-
238app/src/main/java/com/swifttech/remit/android/features/otpverification/presenter/OTPVerificationPresenter.java
-
27app/src/main/java/com/swifttech/remit/android/features/otpverification/presenter/OTPVerificationPresenterInterface.java
-
67app/src/main/java/com/swifttech/remit/android/features/otpverification/view/OTPRequestFragment.java
-
108app/src/main/java/com/swifttech/remit/android/features/otpverification/view/OTPVerificationActivity.java
-
65app/src/main/java/com/swifttech/remit/android/features/otpverification/view/OTPVerifyFragment.java
-
8app/src/main/java/com/swifttech/remit/android/features/register/RegisterViewModelFactory.java
-
5app/src/main/java/com/swifttech/remit/android/features/register/gateway/RegisterV2Gateway.java
-
2app/src/main/java/com/swifttech/remit/android/features/register/presenter/RegisterV2InteractorInterface.java
-
25app/src/main/java/com/swifttech/remit/android/features/register/presenter/RegisterV2Presenter.java
-
14app/src/main/java/com/swifttech/remit/android/features/register/view/RegisterV2Activity.java
-
3app/src/main/java/com/swifttech/remit/android/features/splashscreen/view/SplashScreen.java
-
28app/src/main/java/com/swifttech/remit/android/features/withdraw/WithdrawViewModelFactory.java
-
8app/src/main/java/com/swifttech/remit/android/features/withdraw/gateway/WithdrawGateway.java
-
4app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawGatewayInterface.java
-
24app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawPresenter.java
-
9app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawPresenterInterface.java
-
44app/src/main/java/com/swifttech/remit/android/features/withdraw/view/WithdrawActivity.java
-
2app/src/main/java/com/swifttech/remit/android/utils/https/API_URL.java
-
8app/src/main/java/com/swifttech/remit/android/utils/https/ApiEndpoints.java
-
9app/src/main/res/layout/activity_cash_pickup_to_wallet.xml
-
27app/src/main/res/layout/activity_otpverification.xml
-
3app/src/main/res/layout/activity_register_v2.xml
-
9app/src/main/res/layout/activity_withdraw.xml
-
453app/src/main/res/layout/fragment_cash_pickup_txn_detail.xml
-
57app/src/main/res/layout/fragment_otp_request.xml
-
52app/src/main/res/layout/fragment_otp_verify.xml
-
55app/src/main/res/layout/fragment_search_cash_pickup_txn.xml
-
2app/src/main/res/values/strings.xml
@ -0,0 +1,28 @@ |
|||
package com.swifttech.remit.android.features.cashpickuptowallet; |
|||
|
|||
import androidx.annotation.NonNull; |
|||
import androidx.lifecycle.ViewModel; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
|
|||
import com.swifttech.remit.android.features.cashpickuptowallet.gateway.CashPickupToWalletGateway; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletPresenter; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletPresenterInterface; |
|||
import com.swifttech.remit.android.features.otpverification.gateway.OTPVerificationGateway; |
|||
import com.swifttech.remit.android.features.otpverification.presenter.OTPVerificationPresenter; |
|||
import com.swifttech.remit.android.features.otpverification.presenter.OTPVerificationPresenterInterface; |
|||
|
|||
public class CashPickupViewModelFactory implements ViewModelProvider.Factory { |
|||
|
|||
private final CashPickupToWalletPresenterInterface.CashPickupToWalletContract view; |
|||
|
|||
public CashPickupViewModelFactory(CashPickupToWalletPresenterInterface.CashPickupToWalletContract view) { |
|||
this.view=view; |
|||
} |
|||
|
|||
@SuppressWarnings("unchecked") |
|||
@NonNull |
|||
@Override |
|||
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) { |
|||
return (T) new CashPickupToWalletPresenter(view,new CashPickupToWalletGateway()); |
|||
} |
|||
} |
@ -0,0 +1,7 @@ |
|||
package com.swifttech.remit.android.features.cashpickuptowallet.gateway; |
|||
|
|||
import com.swifttech.remit.android.base.PrivilegedGateway; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletGatewayInterface; |
|||
|
|||
public class CashPickupToWalletGateway extends PrivilegedGateway implements CashPickupToWalletGatewayInterface { |
|||
} |
@ -0,0 +1,185 @@ |
|||
package com.swifttech.remit.android.features.cashpickuptowallet.model; |
|||
|
|||
import com.google.gson.annotations.Expose; |
|||
import com.google.gson.annotations.SerializedName; |
|||
|
|||
public class CashPickupTxnDetailDTO { |
|||
|
|||
@SerializedName("txnId") |
|||
@Expose |
|||
private String txnId; |
|||
@SerializedName("sendingCountryCode") |
|||
@Expose |
|||
private String sendingCountryCode; |
|||
@SerializedName("sendingCountryName") |
|||
@Expose |
|||
private String sendingCountryName; |
|||
@SerializedName("controlNo") |
|||
@Expose |
|||
private String controlNo; |
|||
@SerializedName("tranDate") |
|||
@Expose |
|||
private String tranDate; |
|||
@SerializedName("senderName") |
|||
@Expose |
|||
private String senderName; |
|||
@SerializedName("receiverName") |
|||
@Expose |
|||
private String receiverName; |
|||
@SerializedName("receiverAddress") |
|||
@Expose |
|||
private String receiverAddress; |
|||
@SerializedName("receiverMobile") |
|||
@Expose |
|||
private String receiverMobile; |
|||
@SerializedName("status") |
|||
@Expose |
|||
private String status; |
|||
@SerializedName("serviceFee") |
|||
@Expose |
|||
private String serviceFee; |
|||
@SerializedName("exrate") |
|||
@Expose |
|||
private String exrate; |
|||
@SerializedName("receivedAmount") |
|||
@Expose |
|||
private String receivedAmount; |
|||
@SerializedName("payoutAgent") |
|||
@Expose |
|||
private String payoutAgent; |
|||
|
|||
public String getTxnId() { |
|||
return txnId; |
|||
} |
|||
|
|||
public void setTxnId(String txnId) { |
|||
this.txnId = txnId; |
|||
} |
|||
|
|||
public String getSendingCountryCode() { |
|||
return sendingCountryCode; |
|||
} |
|||
|
|||
public void setSendingCountryCode(String sendingCountryCode) { |
|||
this.sendingCountryCode = sendingCountryCode; |
|||
} |
|||
|
|||
public String getSendingCountryName() { |
|||
return sendingCountryName; |
|||
} |
|||
|
|||
public void setSendingCountryName(String sendingCountryName) { |
|||
this.sendingCountryName = sendingCountryName; |
|||
} |
|||
|
|||
public String getControlNo() { |
|||
return controlNo; |
|||
} |
|||
|
|||
public void setControlNo(String controlNo) { |
|||
this.controlNo = controlNo; |
|||
} |
|||
|
|||
public String getTranDate() { |
|||
return tranDate; |
|||
} |
|||
|
|||
public void setTranDate(String tranDate) { |
|||
this.tranDate = tranDate; |
|||
} |
|||
|
|||
public String getSenderName() { |
|||
return senderName; |
|||
} |
|||
|
|||
public void setSenderName(String senderName) { |
|||
this.senderName = senderName; |
|||
} |
|||
|
|||
public String getReceiverName() { |
|||
return receiverName; |
|||
} |
|||
|
|||
public void setReceiverName(String receiverName) { |
|||
this.receiverName = receiverName; |
|||
} |
|||
|
|||
public String getReceiverAddress() { |
|||
return receiverAddress; |
|||
} |
|||
|
|||
public void setReceiverAddress(String receiverAddress) { |
|||
this.receiverAddress = receiverAddress; |
|||
} |
|||
|
|||
public String getReceiverMobile() { |
|||
return receiverMobile; |
|||
} |
|||
|
|||
public void setReceiverMobile(String receiverMobile) { |
|||
this.receiverMobile = receiverMobile; |
|||
} |
|||
|
|||
public String getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(String status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getServiceFee() { |
|||
return serviceFee; |
|||
} |
|||
|
|||
public void setServiceFee(String serviceFee) { |
|||
this.serviceFee = serviceFee; |
|||
} |
|||
|
|||
public String getReceivedAmount() { |
|||
return receivedAmount; |
|||
} |
|||
|
|||
public void setReceivedAmount(String receivedAmount) { |
|||
this.receivedAmount = receivedAmount; |
|||
} |
|||
|
|||
public String getPayoutAgent() { |
|||
return payoutAgent; |
|||
} |
|||
|
|||
public void setPayoutAgent(String payoutAgent) { |
|||
this.payoutAgent = payoutAgent; |
|||
} |
|||
|
|||
public String getExrate() { |
|||
return exrate; |
|||
} |
|||
|
|||
public void setExrate(String exrate) { |
|||
this.exrate = exrate; |
|||
} |
|||
|
|||
public boolean isTxnValidForRedeem() |
|||
{ |
|||
return "unpaid".equalsIgnoreCase(status); |
|||
} |
|||
|
|||
public String getTransferStatusLabel() { |
|||
if("unpaid".equalsIgnoreCase(status)) |
|||
{ |
|||
return "Transaction Pending"; |
|||
} |
|||
else if("paid".equalsIgnoreCase(status)) |
|||
{ |
|||
return "Transaction Successful"; |
|||
} |
|||
else if("cancelled".equalsIgnoreCase(status)) |
|||
{ |
|||
return "Transaction Cancelled"; |
|||
} |
|||
else |
|||
return "Transaction Status Unknown"; |
|||
|
|||
} |
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.swifttech.remit.android.features.cashpickuptowallet.presenter; |
|||
|
|||
import com.swifttech.remit.android.base.PrivilegedGatewayInterface; |
|||
|
|||
import io.reactivex.Observable; |
|||
import io.reactivex.disposables.Disposable; |
|||
import okhttp3.ResponseBody; |
|||
|
|||
public interface CashPickupToWalletGatewayInterface extends PrivilegedGatewayInterface { |
|||
Observable<ResponseBody> searchTxnByControlNo(String auth,String userID, String selectedControlNo); |
|||
|
|||
Observable<ResponseBody> redeemCashPickupTxn(String auth,String userID, String selectedControlNo,String txnId,String password); |
|||
} |
@ -0,0 +1,210 @@ |
|||
package com.swifttech.remit.android.features.cashpickuptowallet.presenter; |
|||
|
|||
|
|||
import androidx.appcompat.app.AppCompatActivity; |
|||
import androidx.lifecycle.LiveData; |
|||
import androidx.lifecycle.MutableLiveData; |
|||
|
|||
import com.google.gson.reflect.TypeToken; |
|||
import com.swifttech.remit.android.base.BaseViewModel; |
|||
import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.model.CashPickupTxnDetailDTO; |
|||
import com.swifttech.remit.android.features.security.RemitAuthManager; |
|||
import com.swifttech.remit.android.features.security.model.RemitAuthFailedResult; |
|||
import com.swifttech.remit.android.features.security.model.RemitAuthSuccessResult; |
|||
import com.swifttech.remit.android.features.security.model.RemitTxnParam; |
|||
import com.swifttech.remit.android.utils.Constants; |
|||
import com.swifttech.remit.android.utils.https.GenericApiObserverResponseV2; |
|||
import com.swifttech.remit.android.utils.https.GenericResponseDataModel; |
|||
import com.swifttech.remit.android.utils.https.MessageResponseDataModel; |
|||
|
|||
import java.lang.reflect.Type; |
|||
|
|||
import io.reactivex.Observable; |
|||
import io.reactivex.android.schedulers.AndroidSchedulers; |
|||
import io.reactivex.disposables.CompositeDisposable; |
|||
import io.reactivex.observers.DisposableObserver; |
|||
import io.reactivex.schedulers.Schedulers; |
|||
|
|||
public class CashPickupToWalletPresenter extends BaseViewModel implements CashPickupToWalletPresenterInterface { |
|||
private final CashPickupToWalletPresenterInterface.CashPickupToWalletContract view; |
|||
private final CashPickupToWalletGatewayInterface gateway; |
|||
private final MutableLiveData<Boolean> controlNoValidationEventLiveData; |
|||
private final MutableLiveData<CashPickupTxnDetailDTO> cashPickupTxnDetailDTOMutableLiveData; |
|||
private final CompositeDisposable viewSubs; |
|||
private final CompositeDisposable useCaseSubs; |
|||
private String selectedControlNo; |
|||
private CashPickupTxnDetailDTO currentCashPickupTxnDetail; |
|||
|
|||
public CashPickupToWalletPresenter(CashPickupToWalletPresenterInterface.CashPickupToWalletContract view, CashPickupToWalletGatewayInterface cashPickupToWalletGateway) { |
|||
this.view = view; |
|||
this.gateway = cashPickupToWalletGateway; |
|||
controlNoValidationEventLiveData = new MutableLiveData<>(); |
|||
cashPickupTxnDetailDTOMutableLiveData = new MutableLiveData<>(); |
|||
this.viewSubs = new CompositeDisposable(); |
|||
this.useCaseSubs = new CompositeDisposable(); |
|||
} |
|||
|
|||
@Override |
|||
public void onViewReady() { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onViewNotReady() { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void searchByControlNo() { |
|||
useCaseSubs.add( |
|||
gateway.searchTxnByControlNo(gateway.getAuth(), gateway.getUserID(), selectedControlNo) |
|||
.doOnSubscribe(subs -> view.showProgressBar(true, "")) |
|||
.subscribeOn(Schedulers.io()) |
|||
.observeOn(AndroidSchedulers.mainThread()) |
|||
.doFinally(() -> view.showProgressBar(false, "")) |
|||
.subscribeWith(new CashPickupTxnSearchObserver()) |
|||
); |
|||
} |
|||
|
|||
@Override |
|||
public void redeemCashPickup() { |
|||
RemitAuthManager.getGmeAuthManager((AppCompatActivity) view.getContext()) |
|||
.fromPaymentSource( |
|||
new RemitTxnParam( |
|||
"wallet", |
|||
"", |
|||
"" |
|||
).enableFallbackAuth() |
|||
).setListener(new RemitAuthManager.RemitAuthListener() { |
|||
@Override |
|||
public void onRemitAuthSuccess(RemitAuthSuccessResult result) { |
|||
useCaseSubs.add( |
|||
gateway.redeemCashPickupTxn(gateway.getAuth(), gateway.getUserID(), selectedControlNo, "", "") |
|||
.doOnSubscribe(subs -> view.showProgressBar(true, "")) |
|||
.subscribeOn(Schedulers.io()) |
|||
.observeOn(AndroidSchedulers.mainThread()) |
|||
.doFinally(() -> view.showProgressBar(false, "")) |
|||
.subscribeWith(new CashPickupTxnRedeemObserver()) |
|||
); |
|||
} |
|||
|
|||
@Override |
|||
public void onRemitAuthFailed(RemitAuthFailedResult failedResult) { |
|||
view.showToastMessage(failedResult.getFailedReason()); |
|||
} |
|||
|
|||
@Override |
|||
public void onRemitAuthCancelled() { |
|||
|
|||
} |
|||
}).prompt(); |
|||
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public LiveData<Boolean> subscribeToCashPickupSearchEvent(Observable<CharSequence> controlNo) { |
|||
viewSubs.add(controlNo.map(this::validateControlNo).subscribeWith(new DisposableObserver<Boolean>() { |
|||
@Override |
|||
public void onNext(Boolean aBoolean) { |
|||
controlNoValidationEventLiveData.setValue(aBoolean); |
|||
} |
|||
|
|||
@Override |
|||
public void onError(Throwable e) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onComplete() { |
|||
|
|||
} |
|||
})); |
|||
return controlNoValidationEventLiveData; |
|||
} |
|||
|
|||
private boolean validateControlNo(CharSequence controlNo) { |
|||
if (controlNo != null && controlNo.length() > 0) { |
|||
this.selectedControlNo = controlNo.toString(); |
|||
return true; |
|||
} else { |
|||
this.selectedControlNo = null; |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public LiveData<CashPickupTxnDetailDTO> subscribeToCashPickupTxnDetailEvent() { |
|||
return cashPickupTxnDetailDTOMutableLiveData; |
|||
} |
|||
|
|||
|
|||
public class CashPickupTxnSearchObserver extends GenericApiObserverResponseV2<CashPickupTxnDetailDTO> { |
|||
|
|||
@Override |
|||
protected Type getDataType() { |
|||
return TypeToken.getParameterized(CashPickupTxnDetailDTO.class).getType(); |
|||
} |
|||
|
|||
@Override |
|||
protected void onSuccess(GenericResponseDataModel<CashPickupTxnDetailDTO> t) { |
|||
if (Constants.SUCCESS_CODE_V2.equalsIgnoreCase(t.getErrorCode())) { |
|||
currentCashPickupTxnDetail=t.getData(); |
|||
cashPickupTxnDetailDTOMutableLiveData.setValue(t.getData()); |
|||
view.showTxnDetailScreen(); |
|||
} else { |
|||
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, null); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void onFailed(String message) { |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null); |
|||
} |
|||
|
|||
@Override |
|||
protected void onConnectionNotEstablished(String message) { |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
protected void unauthorizedAccess(String message) { |
|||
gateway.clearAllUserData(); |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> view.logout()); |
|||
|
|||
} |
|||
} |
|||
|
|||
public class CashPickupTxnRedeemObserver extends GenericApiObserverResponseV2<MessageResponseDataModel> { |
|||
|
|||
|
|||
@Override |
|||
protected void onSuccess(GenericResponseDataModel<MessageResponseDataModel> t) { |
|||
if (Constants.SUCCESS_CODE_V2.equalsIgnoreCase(t.getErrorCode())) { |
|||
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.SUCCESS, alertType -> view.exitView()); |
|||
} else { |
|||
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, null); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void onFailed(String message) { |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null); |
|||
} |
|||
|
|||
@Override |
|||
protected void onConnectionNotEstablished(String message) { |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
protected void unauthorizedAccess(String message) { |
|||
gateway.clearAllUserData(); |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> view.logout()); |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.swifttech.remit.android.features.cashpickuptowallet.presenter; |
|||
|
|||
import androidx.lifecycle.LiveData; |
|||
|
|||
import com.swifttech.remit.android.base.BaseContractInterface; |
|||
import com.swifttech.remit.android.base.BasePresenterInterface; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.model.CashPickupTxnDetailDTO; |
|||
|
|||
import io.reactivex.Observable; |
|||
|
|||
public interface CashPickupToWalletPresenterInterface extends BasePresenterInterface { |
|||
|
|||
void searchByControlNo(); |
|||
|
|||
void redeemCashPickup(); |
|||
|
|||
LiveData<Boolean> subscribeToCashPickupSearchEvent(Observable<CharSequence> controlNo); |
|||
|
|||
LiveData<CashPickupTxnDetailDTO> subscribeToCashPickupTxnDetailEvent(); |
|||
|
|||
interface CashPickupToWalletContract extends BaseContractInterface |
|||
{ |
|||
|
|||
void showTxnDetailScreen(); |
|||
} |
|||
} |
@ -0,0 +1,101 @@ |
|||
package com.swifttech.remit.android.features.cashpickuptowallet.view; |
|||
|
|||
import androidx.appcompat.app.AppCompatActivity; |
|||
import androidx.fragment.app.Fragment; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
import androidx.viewpager.widget.ViewPager; |
|||
|
|||
import android.os.Bundle; |
|||
import android.view.View; |
|||
import android.widget.TextView; |
|||
|
|||
import com.swifttech.remit.android.R; |
|||
import com.swifttech.remit.android.base.BaseActivity; |
|||
import com.swifttech.remit.android.common.customwidgets.GenericViewPagerAdapter; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.CashPickupViewModelFactory; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletPresenter; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletPresenterInterface; |
|||
import com.swifttech.remit.android.features.otpverification.OTPVerificationViewModelFactory; |
|||
import com.swifttech.remit.android.features.otpverification.presenter.OTPVerificationPresenter; |
|||
import com.swifttech.remit.android.features.otpverification.view.OTPRequestFragment; |
|||
import com.swifttech.remit.android.features.otpverification.view.OTPVerifyFragment; |
|||
|
|||
import java.util.ArrayList; |
|||
|
|||
import butterknife.BindView; |
|||
import butterknife.ButterKnife; |
|||
import butterknife.OnClick; |
|||
|
|||
public class CashPickupToWalletActivity extends BaseActivity implements CashPickupToWalletPresenterInterface.CashPickupToWalletContract { |
|||
|
|||
@BindView(R.id.otpVerificationViewPager) |
|||
ViewPager viewPager; |
|||
|
|||
|
|||
|
|||
@BindView(R.id.toolbar_title) |
|||
TextView toolbarTitle; |
|||
|
|||
GenericViewPagerAdapter viewPagerAdapter; |
|||
private SearchCashPickupTxnFragment searchCashPickupTxnFragment; |
|||
private CashPickupTxnDetailFragment cashPickupDetailFragment; |
|||
|
|||
private CashPickupToWalletPresenterInterface viewModel; |
|||
|
|||
|
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
setContentView(R.layout.activity_cash_pickup_to_wallet); |
|||
ButterKnife.bind(this); |
|||
init(); |
|||
} |
|||
|
|||
private void init() { |
|||
toolbarTitle.setText("Redeem CashPickup"); |
|||
viewModel = new ViewModelProvider(this, new CashPickupViewModelFactory(this)).get(CashPickupToWalletPresenter.class); |
|||
setupViewPager(); |
|||
|
|||
} |
|||
|
|||
private void setupViewPager() { |
|||
viewPagerAdapter = new GenericViewPagerAdapter(getSupportFragmentManager()); |
|||
|
|||
ArrayList<Fragment> fragments = new ArrayList<>(); |
|||
|
|||
searchCashPickupTxnFragment=new SearchCashPickupTxnFragment(); |
|||
cashPickupDetailFragment=new CashPickupTxnDetailFragment(); |
|||
|
|||
fragments.add(searchCashPickupTxnFragment); |
|||
fragments.add(cashPickupDetailFragment); |
|||
|
|||
viewPagerAdapter.addFragments(fragments); |
|||
|
|||
viewPager.setOffscreenPageLimit(3); |
|||
|
|||
viewPager.setAdapter(viewPagerAdapter); |
|||
|
|||
viewPager.setCurrentItem(0); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void showTxnDetailScreen() { |
|||
viewPager.setCurrentItem(1); |
|||
} |
|||
|
|||
@OnClick(R.id.iv_back) |
|||
public void onBackButtonPressed() |
|||
{ |
|||
onBackPressed(); |
|||
} |
|||
|
|||
@Override |
|||
public void onBackPressed() { |
|||
if (viewPager.getCurrentItem() == 0) { |
|||
super.onBackPressed(); |
|||
} else |
|||
viewPager.setCurrentItem(viewPager.getCurrentItem() - 1); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,129 @@ |
|||
package com.swifttech.remit.android.features.cashpickuptowallet.view; |
|||
|
|||
import android.os.Bundle; |
|||
import android.view.LayoutInflater; |
|||
import android.view.View; |
|||
import android.view.ViewGroup; |
|||
import android.widget.Button; |
|||
import android.widget.EditText; |
|||
import android.widget.ImageView; |
|||
import android.widget.TextView; |
|||
|
|||
import androidx.annotation.Nullable; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
|
|||
import com.jakewharton.rxbinding3.widget.RxTextView; |
|||
import com.swifttech.remit.android.R; |
|||
import com.swifttech.remit.android.base.BaseFragment; |
|||
import com.swifttech.remit.android.common.customwidgets.exchangecountrylistingdialog.CountryFlagMapper; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.model.CashPickupTxnDetailDTO; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletPresenter; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletPresenterInterface; |
|||
import com.swifttech.remit.android.features.inboundreceipt.view.ProgressPathView; |
|||
|
|||
import butterknife.BindView; |
|||
import butterknife.ButterKnife; |
|||
import butterknife.OnClick; |
|||
|
|||
public class CashPickupTxnDetailFragment extends BaseFragment { |
|||
|
|||
|
|||
@BindView(R.id.tv_control_no) |
|||
TextView tv_gme_control_no; |
|||
|
|||
|
|||
@BindView(R.id.transaction_date) |
|||
TextView transaction_date; |
|||
|
|||
@BindView(R.id.tv_receiver) |
|||
TextView tv_receiver; |
|||
|
|||
|
|||
@BindView(R.id.tv_address) |
|||
TextView tv_address; |
|||
|
|||
|
|||
@BindView(R.id.tv_mobile_no) |
|||
TextView tv_mobile_no; |
|||
|
|||
|
|||
@BindView(R.id.tv_agent_bank) |
|||
TextView tv_agent_bank; |
|||
|
|||
|
|||
@BindView(R.id.tv_total_sent_amount) |
|||
TextView tv_total_sent_amount; |
|||
|
|||
|
|||
@BindView(R.id.tv_service_fee) |
|||
TextView tv_service_fee; |
|||
|
|||
|
|||
@BindView(R.id.exrate_fee) |
|||
TextView exrate_fee; |
|||
|
|||
@BindView(R.id.transfer_label) |
|||
TextView transfer_label; |
|||
|
|||
@BindView(R.id.btn_submit) |
|||
Button btn_submit; |
|||
|
|||
|
|||
@BindView(R.id.senderFlagImageview) |
|||
ImageView senderFlagImageview; |
|||
|
|||
|
|||
private CashPickupToWalletPresenterInterface viewModel; |
|||
|
|||
|
|||
@Override |
|||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
|||
return inflater.inflate(R.layout.fragment_cash_pickup_txn_detail, container, false); |
|||
} |
|||
|
|||
@Override |
|||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
|||
super.onViewCreated(view, savedInstanceState); |
|||
ButterKnife.bind(this, view); |
|||
init(); |
|||
performDefaultAction(savedInstanceState); |
|||
} |
|||
|
|||
private void performDefaultAction(Bundle savedInstanceState) { |
|||
|
|||
viewModel.subscribeToCashPickupTxnDetailEvent().observe(getViewLifecycleOwner(), this::onCashPickupTxnDetailReceived); |
|||
} |
|||
|
|||
private void onCashPickupTxnDetailReceived(CashPickupTxnDetailDTO receiptViewModel) { |
|||
|
|||
tv_gme_control_no.setText(receiptViewModel.getControlNo()); |
|||
transaction_date.setText(receiptViewModel.getTranDate()); |
|||
tv_receiver.setText(receiptViewModel.getReceiverName()); |
|||
tv_address.setText(receiptViewModel.getReceiverAddress()); |
|||
tv_mobile_no.setText(receiptViewModel.getReceiverMobile()); |
|||
tv_agent_bank.setText(receiptViewModel.getPayoutAgent()); |
|||
tv_total_sent_amount.setText(receiptViewModel.getReceivedAmount()); |
|||
tv_service_fee.setText(receiptViewModel.getServiceFee()); |
|||
exrate_fee.setText(receiptViewModel.getExrate()); |
|||
transfer_label.setText(receiptViewModel.getTransferStatusLabel()); |
|||
senderFlagImageview.setImageResource(CountryFlagMapper.getFlagFromCountryCode(receiptViewModel.getSendingCountryCode())); |
|||
btn_submit.setEnabled(receiptViewModel.isTxnValidForRedeem()); |
|||
if (receiptViewModel.isTxnValidForRedeem()) |
|||
btn_submit.setVisibility(View.VISIBLE); |
|||
else |
|||
btn_submit.setVisibility(View.GONE); |
|||
} |
|||
|
|||
private void init() { |
|||
viewModel = new ViewModelProvider(requireActivity()).get(CashPickupToWalletPresenter.class); |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@OnClick(R.id.btn_submit) |
|||
public void searchByControlNo() { |
|||
|
|||
viewModel.searchByControlNo(); |
|||
} |
|||
} |
@ -0,0 +1,68 @@ |
|||
package com.swifttech.remit.android.features.cashpickuptowallet.view; |
|||
|
|||
import android.os.Bundle; |
|||
import android.view.LayoutInflater; |
|||
import android.view.View; |
|||
import android.view.ViewGroup; |
|||
import android.widget.Button; |
|||
import android.widget.EditText; |
|||
|
|||
import androidx.annotation.Nullable; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
|
|||
import com.jakewharton.rxbinding3.widget.RxTextView; |
|||
import com.swifttech.remit.android.R; |
|||
import com.swifttech.remit.android.base.BaseFragment; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletPresenter; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletPresenterInterface; |
|||
|
|||
import butterknife.BindView; |
|||
import butterknife.ButterKnife; |
|||
import butterknife.OnClick; |
|||
|
|||
public class SearchCashPickupTxnFragment extends BaseFragment { |
|||
|
|||
private CashPickupToWalletPresenterInterface viewModel; |
|||
|
|||
|
|||
@BindView(R.id.controlNo_edTxt) |
|||
EditText controlNoEditText; |
|||
|
|||
@BindView(R.id.search_btn) |
|||
Button btnSearch; |
|||
|
|||
|
|||
@Override |
|||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
|||
return inflater.inflate(R.layout.fragment_search_cash_pickup_txn, container, false); |
|||
} |
|||
|
|||
@Override |
|||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
|||
super.onViewCreated(view, savedInstanceState); |
|||
ButterKnife.bind(this, view); |
|||
init(); |
|||
performDefaultAction(savedInstanceState); |
|||
} |
|||
|
|||
private void performDefaultAction(Bundle savedInstanceState) { |
|||
|
|||
viewModel.subscribeToCashPickupSearchEvent(RxTextView.textChanges(controlNoEditText).skipInitialValue()).observe(getViewLifecycleOwner(), btnSearch::setEnabled); |
|||
} |
|||
|
|||
private void init() { |
|||
viewModel=new ViewModelProvider(requireActivity()).get(CashPickupToWalletPresenter.class); |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@OnClick(R.id.search_btn) |
|||
public void searchByControlNo() |
|||
{ |
|||
if(btnSearch.isEnabled()) |
|||
{ |
|||
viewModel.searchByControlNo(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.swifttech.remit.android.features.otpverification; |
|||
|
|||
import androidx.annotation.NonNull; |
|||
import androidx.lifecycle.ViewModel; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
|
|||
import com.swifttech.remit.android.features.login.gateway.LoginV2Gateway; |
|||
import com.swifttech.remit.android.features.login.presenter.LoginV2Presenter; |
|||
import com.swifttech.remit.android.features.login.presenter.LoginV2PresenterInterface; |
|||
import com.swifttech.remit.android.features.otpverification.gateway.OTPVerificationGateway; |
|||
import com.swifttech.remit.android.features.otpverification.presenter.OTPVerificationPresenter; |
|||
import com.swifttech.remit.android.features.otpverification.presenter.OTPVerificationPresenterInterface; |
|||
|
|||
public class OTPVerificationViewModelFactory implements ViewModelProvider.Factory { |
|||
|
|||
private final OTPVerificationPresenterInterface.OTPVerificationContract view; |
|||
|
|||
public OTPVerificationViewModelFactory(OTPVerificationPresenterInterface.OTPVerificationContract view) { |
|||
this.view=view; |
|||
} |
|||
|
|||
@SuppressWarnings("unchecked") |
|||
@NonNull |
|||
@Override |
|||
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) { |
|||
return (T) new OTPVerificationPresenter(view,new OTPVerificationGateway()); |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.swifttech.remit.android.features.otpverification.gateway; |
|||
|
|||
import com.google.gson.JsonObject; |
|||
import com.swifttech.remit.android.base.PrivilegedGateway; |
|||
import com.swifttech.remit.android.features.otpverification.presenter.OTPVerificationGatewayInterface; |
|||
import com.swifttech.remit.android.utils.https.HttpClientV2; |
|||
|
|||
import io.reactivex.Observable; |
|||
import okhttp3.ResponseBody; |
|||
|
|||
public class OTPVerificationGateway extends PrivilegedGateway implements OTPVerificationGatewayInterface { |
|||
@Override |
|||
public Observable<ResponseBody> requestOTP(String basicAuth, String mobileNumber) { |
|||
JsonObject jsonObject = new JsonObject(); |
|||
jsonObject.addProperty("mobileNumber",mobileNumber); |
|||
return HttpClientV2.getInstance().requestRegistrationOTP(basicAuth,jsonObject); |
|||
} |
|||
|
|||
@Override |
|||
public Observable<ResponseBody> submitOTP(String basicAuth, String selectedMobileNumber, String selectedOTP) { |
|||
JsonObject jsonObject = new JsonObject(); |
|||
jsonObject.addProperty("OTP",selectedOTP); |
|||
jsonObject.addProperty("mobileNumber",selectedMobileNumber); |
|||
return HttpClientV2.getInstance().submitRegistrationOTP(basicAuth,jsonObject); |
|||
} |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.swifttech.remit.android.features.otpverification.model; |
|||
|
|||
import com.google.gson.annotations.Expose; |
|||
import com.google.gson.annotations.SerializedName; |
|||
|
|||
public class OTPSubmitModelDTO { |
|||
|
|||
@SerializedName("referenceId") |
|||
@Expose |
|||
private String referenceId; |
|||
|
|||
public String getReferenceId() { |
|||
return referenceId; |
|||
} |
|||
|
|||
public void setReferenceId(String referenceId) { |
|||
this.referenceId = referenceId; |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.swifttech.remit.android.features.otpverification.presenter; |
|||
|
|||
import com.swifttech.remit.android.base.PrivilegedGatewayInterface; |
|||
|
|||
import io.reactivex.Observable; |
|||
import io.reactivex.disposables.Disposable; |
|||
import okhttp3.ResponseBody; |
|||
|
|||
public interface OTPVerificationGatewayInterface extends PrivilegedGatewayInterface { |
|||
|
|||
Observable<ResponseBody> requestOTP(String basicAuth, String mobileNumber); |
|||
|
|||
Observable<ResponseBody> submitOTP(String basicAuth, String selectedMobileNumber, String selectedOTP); |
|||
} |
@ -0,0 +1,238 @@ |
|||
package com.swifttech.remit.android.features.otpverification.presenter; |
|||
|
|||
import android.os.Parcelable; |
|||
import android.util.Log; |
|||
|
|||
import androidx.lifecycle.LiveData; |
|||
import androidx.lifecycle.MutableLiveData; |
|||
|
|||
import com.google.gson.reflect.TypeToken; |
|||
import com.swifttech.remit.android.base.BaseViewModel; |
|||
import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog; |
|||
import com.swifttech.remit.android.features.otpverification.model.OTPSubmitModelDTO; |
|||
import com.swifttech.remit.android.utils.Constants; |
|||
import com.swifttech.remit.android.utils.https.GenericApiObserverResponseV2; |
|||
import com.swifttech.remit.android.utils.https.GenericResponseDataModel; |
|||
import com.swifttech.remit.android.utils.https.MessageResponseDataModel; |
|||
|
|||
import java.lang.reflect.Type; |
|||
|
|||
import io.reactivex.Observable; |
|||
import io.reactivex.android.schedulers.AndroidSchedulers; |
|||
import io.reactivex.disposables.CompositeDisposable; |
|||
import io.reactivex.observers.DisposableObserver; |
|||
import io.reactivex.schedulers.Schedulers; |
|||
|
|||
public class OTPVerificationPresenter extends BaseViewModel implements OTPVerificationPresenterInterface { |
|||
|
|||
|
|||
private final OTPVerificationContract view; |
|||
private final OTPVerificationGatewayInterface gateway; |
|||
private final CompositeDisposable useCaseSubs; |
|||
private final CompositeDisposable viewSubs; |
|||
private final MutableLiveData<Boolean> mobileValidaitonLiveData; |
|||
private final MutableLiveData<Boolean> otpValidaitonLiveData; |
|||
private String selectedMobileNumber; |
|||
private String selectedOTP; |
|||
|
|||
public OTPVerificationPresenter(OTPVerificationContract view, OTPVerificationGatewayInterface gateway) { |
|||
this.view=view; |
|||
this.gateway=gateway; |
|||
this.useCaseSubs=new CompositeDisposable(); |
|||
this.viewSubs=new CompositeDisposable(); |
|||
this.mobileValidaitonLiveData =new MutableLiveData<>(); |
|||
this.otpValidaitonLiveData=new MutableLiveData<>(); |
|||
} |
|||
|
|||
@Override |
|||
public void onViewReady() { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onViewNotReady() { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public LiveData<Boolean> subscribeToMobileNumberValidationEvent(Observable<CharSequence> mobileNumber) { |
|||
viewSubs.add( |
|||
mobileNumber.map(this::validateMobileNoForOTPRequest) |
|||
.subscribeWith(new DisposableObserver<Boolean>() |
|||
{ |
|||
|
|||
@Override |
|||
public void onNext(Boolean aBoolean) { |
|||
mobileValidaitonLiveData.setValue(aBoolean); |
|||
} |
|||
|
|||
@Override |
|||
public void onError(Throwable e) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onComplete() { |
|||
|
|||
} |
|||
}) |
|||
); |
|||
return mobileValidaitonLiveData; |
|||
} |
|||
|
|||
private boolean validateMobileNoForOTPRequest(CharSequence mobileNumber) { |
|||
if(mobileNumber!=null&&mobileNumber.length()>0) { |
|||
this.selectedMobileNumber = mobileNumber.toString(); |
|||
return true; |
|||
} |
|||
else { |
|||
this.selectedMobileNumber = null; |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void requestForOTP() { |
|||
useCaseSubs.add( |
|||
this.gateway.requestOTP(gateway.getBasicAuth(view.getContext()),selectedMobileNumber) |
|||
.doOnSubscribe(subs->view.showProgressBar(true,"")) |
|||
.subscribeOn(Schedulers.io()) |
|||
.observeOn(AndroidSchedulers.mainThread()) |
|||
.doFinally(()->view.showProgressBar(false,"")) |
|||
.subscribeWith(new OTPRequestOBserver()) |
|||
); |
|||
} |
|||
|
|||
@Override |
|||
public LiveData<Boolean> subscribeToOTPNumberValidation(Observable<CharSequence> otpSubject) { |
|||
viewSubs.add( |
|||
otpSubject.map(this::validateOTPForSubmission) |
|||
.subscribeWith(new DisposableObserver<Boolean>() |
|||
{ |
|||
|
|||
@Override |
|||
public void onNext(Boolean aBoolean) { |
|||
otpValidaitonLiveData.setValue(aBoolean); |
|||
} |
|||
|
|||
@Override |
|||
public void onError(Throwable e) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onComplete() { |
|||
|
|||
} |
|||
}) |
|||
); |
|||
return otpValidaitonLiveData; |
|||
} |
|||
|
|||
@Override |
|||
public void submitOTP() { |
|||
useCaseSubs.add( |
|||
this.gateway.submitOTP(gateway.getBasicAuth(view.getContext()),selectedMobileNumber,selectedOTP) |
|||
.doOnSubscribe(subs->view.showProgressBar(true,"")) |
|||
.subscribeOn(Schedulers.io()) |
|||
.observeOn(AndroidSchedulers.mainThread()) |
|||
.doFinally(()->view.showProgressBar(false,"")) |
|||
.subscribeWith(new OTPSubmitObserver()) |
|||
); |
|||
} |
|||
|
|||
private boolean validateOTPForSubmission(CharSequence otp) { |
|||
if(otp!=null&&otp.length()==5) |
|||
{ |
|||
this.selectedOTP=otp.toString(); |
|||
return true; |
|||
} |
|||
else |
|||
{ |
|||
this.selectedOTP=null; |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
|
|||
public class OTPRequestOBserver extends GenericApiObserverResponseV2<MessageResponseDataModel> |
|||
{ |
|||
|
|||
@Override |
|||
protected void onSuccess(GenericResponseDataModel<MessageResponseDataModel> t) { |
|||
if(Constants.SUCCESS_CODE_V2.equalsIgnoreCase(t.getErrorCode())) |
|||
{ |
|||
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.SUCCESS,alertType -> |
|||
{ |
|||
view.showOTPView(); |
|||
//TODO Currently we receive OTP in the response |
|||
view.showToastMessage(t.getExtra()); |
|||
} |
|||
); |
|||
|
|||
} |
|||
else |
|||
{ |
|||
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.SUCCESS,alertType -> view.exitView()); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void onFailed(String message) { |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,alertType -> view.exitView()); |
|||
} |
|||
|
|||
@Override |
|||
protected void onConnectionNotEstablished(String message) { |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,alertType -> view.exitView()); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
protected void unauthorizedAccess(String message) { |
|||
gateway.clearAllUserData(); |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,alertType -> view.logout()); |
|||
|
|||
} |
|||
} |
|||
|
|||
public class OTPSubmitObserver extends GenericApiObserverResponseV2<OTPSubmitModelDTO> |
|||
{ |
|||
|
|||
|
|||
@Override |
|||
protected Type getDataType() { |
|||
return TypeToken.getParameterized(OTPSubmitModelDTO.class).getType(); |
|||
} |
|||
|
|||
@Override |
|||
protected void onSuccess(GenericResponseDataModel<OTPSubmitModelDTO> t) { |
|||
if(Constants.SUCCESS_CODE_V2.equalsIgnoreCase(t.getErrorCode())) |
|||
{ |
|||
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.SUCCESS,alertType -> view.onOTPVerificationCompleted(selectedMobileNumber,t.getData().getReferenceId())); |
|||
|
|||
} |
|||
else |
|||
{ |
|||
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.SUCCESS,null); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void onFailed(String message) { |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,null); |
|||
} |
|||
|
|||
@Override |
|||
protected void onConnectionNotEstablished(String message) { |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,null); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
protected void unauthorizedAccess(String message) { |
|||
gateway.clearAllUserData(); |
|||
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,null); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.swifttech.remit.android.features.otpverification.presenter; |
|||
|
|||
import androidx.lifecycle.LiveData; |
|||
|
|||
import com.jakewharton.rxbinding3.InitialValueObservable; |
|||
import com.swifttech.remit.android.base.BaseContractInterface; |
|||
|
|||
import io.reactivex.Observable; |
|||
import io.reactivex.subjects.PublishSubject; |
|||
|
|||
public interface OTPVerificationPresenterInterface { |
|||
|
|||
LiveData<Boolean> subscribeToMobileNumberValidationEvent(Observable<CharSequence> mobileObservable); |
|||
|
|||
void requestForOTP(); |
|||
|
|||
LiveData<Boolean> subscribeToOTPNumberValidation(Observable<CharSequence> otpObservable); |
|||
|
|||
void submitOTP(); |
|||
|
|||
public interface OTPVerificationContract extends BaseContractInterface { |
|||
|
|||
void showOTPView(); |
|||
|
|||
void onOTPVerificationCompleted(String selectedMobileNumber, String referenceId); |
|||
} |
|||
} |
@ -0,0 +1,67 @@ |
|||
package com.swifttech.remit.android.features.otpverification.view; |
|||
|
|||
import android.os.Bundle; |
|||
import android.view.LayoutInflater; |
|||
import android.view.View; |
|||
import android.view.ViewGroup; |
|||
import android.widget.Button; |
|||
import android.widget.EditText; |
|||
|
|||
import androidx.annotation.Nullable; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
|
|||
import com.jakewharton.rxbinding3.widget.RxTextView; |
|||
import com.swifttech.remit.android.R; |
|||
import com.swifttech.remit.android.base.BaseFragment; |
|||
import com.swifttech.remit.android.features.otpverification.presenter.OTPVerificationPresenter; |
|||
|
|||
|
|||
import butterknife.BindView; |
|||
import butterknife.ButterKnife; |
|||
import butterknife.OnClick; |
|||
|
|||
public class OTPRequestFragment extends BaseFragment { |
|||
|
|||
private OTPVerificationPresenter viewModel; |
|||
|
|||
@BindView(R.id.mobile_edTxt) |
|||
EditText mobileEditText; |
|||
|
|||
@BindView(R.id.btn_submit) |
|||
Button btnSubmit; |
|||
|
|||
@Override |
|||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
|||
return inflater.inflate(R.layout.fragment_otp_request, container, false); |
|||
} |
|||
|
|||
@Override |
|||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
|||
super.onViewCreated(view, savedInstanceState); |
|||
ButterKnife.bind(this, view); |
|||
init(); |
|||
performDefaultAction(savedInstanceState); |
|||
} |
|||
|
|||
private void performDefaultAction(Bundle savedInstanceState) { |
|||
|
|||
viewModel.subscribeToMobileNumberValidationEvent(RxTextView.textChanges(mobileEditText).skipInitialValue()).observe(getViewLifecycleOwner(),btnSubmit::setEnabled); |
|||
} |
|||
|
|||
private void init() { |
|||
viewModel=new ViewModelProvider(requireActivity()).get(OTPVerificationPresenter.class); |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@OnClick(R.id.btn_submit) |
|||
public void requestForOTP() |
|||
{ |
|||
if(btnSubmit.isEnabled()) |
|||
{ |
|||
viewModel.requestForOTP(); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,108 @@ |
|||
package com.swifttech.remit.android.features.otpverification.view; |
|||
|
|||
import androidx.appcompat.app.AppCompatActivity; |
|||
import androidx.fragment.app.Fragment; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
import androidx.viewpager.widget.ViewPager; |
|||
|
|||
import android.app.Activity; |
|||
import android.content.Intent; |
|||
import android.os.Bundle; |
|||
import android.view.View; |
|||
import android.widget.TextView; |
|||
|
|||
import com.google.android.material.tabs.TabLayout; |
|||
import com.swifttech.remit.android.R; |
|||
import com.swifttech.remit.android.base.BaseActivity; |
|||
import com.swifttech.remit.android.common.customwidgets.GenericViewPagerAdapter; |
|||
import com.swifttech.remit.android.features.otpverification.OTPVerificationViewModelFactory; |
|||
import com.swifttech.remit.android.features.otpverification.presenter.OTPVerificationPresenter; |
|||
import com.swifttech.remit.android.features.otpverification.presenter.OTPVerificationPresenterInterface; |
|||
import com.swifttech.remit.android.features.register.view.RegisterV2Activity; |
|||
|
|||
import java.util.ArrayList; |
|||
|
|||
import butterknife.BindView; |
|||
import butterknife.ButterKnife; |
|||
import butterknife.OnClick; |
|||
|
|||
public class OTPVerificationActivity extends BaseActivity implements OTPVerificationPresenterInterface.OTPVerificationContract { |
|||
|
|||
@BindView(R.id.otpVerificationViewPager) |
|||
ViewPager viewPager; |
|||
|
|||
|
|||
@BindView(R.id.iv_back) |
|||
View iv_back; |
|||
|
|||
|
|||
@BindView(R.id.toolbar_title) |
|||
TextView toolbarTitle; |
|||
|
|||
GenericViewPagerAdapter viewPagerAdapter; |
|||
private OTPRequestFragment otpRequestFragment; |
|||
private OTPVerifyFragment otpVerifyFragment; |
|||
private OTPVerificationPresenterInterface viewModel; |
|||
|
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
setContentView(R.layout.activity_otpverification); |
|||
ButterKnife.bind(this); |
|||
init(); |
|||
} |
|||
|
|||
private void init() { |
|||
toolbarTitle.setText("Mobile Verification"); |
|||
viewModel = new ViewModelProvider(this, new OTPVerificationViewModelFactory(this)).get(OTPVerificationPresenter.class); |
|||
setupViewPager(); |
|||
|
|||
} |
|||
|
|||
private void setupViewPager() { |
|||
viewPagerAdapter = new GenericViewPagerAdapter(getSupportFragmentManager()); |
|||
|
|||
ArrayList<Fragment> fragments = new ArrayList<>(); |
|||
|
|||
otpRequestFragment=new OTPRequestFragment(); |
|||
otpVerifyFragment=new OTPVerifyFragment(); |
|||
|
|||
fragments.add(otpRequestFragment); |
|||
fragments.add(otpVerifyFragment); |
|||
|
|||
viewPagerAdapter.addFragments(fragments); |
|||
|
|||
viewPager.setOffscreenPageLimit(3); |
|||
|
|||
viewPager.setAdapter(viewPagerAdapter); |
|||
|
|||
viewPager.setCurrentItem(0); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void showOTPView() { |
|||
hideKeyBoard(); |
|||
viewPager.setCurrentItem(1); |
|||
} |
|||
|
|||
@OnClick(R.id.iv_back) |
|||
public void onBackButtonPressed() |
|||
{ |
|||
onBackPressed(); |
|||
} |
|||
|
|||
@Override |
|||
public void onBackPressed() { |
|||
if (viewPager.getCurrentItem() == 0) { |
|||
super.onBackPressed(); |
|||
} else |
|||
viewPager.setCurrentItem(viewPager.getCurrentItem() - 1); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onOTPVerificationCompleted(String selectedMobileNumber, String referenceId) { |
|||
RegisterV2Activity.showRegisterActivity(this,referenceId,selectedMobileNumber); |
|||
} |
|||
} |
@ -0,0 +1,65 @@ |
|||
package com.swifttech.remit.android.features.otpverification.view; |
|||
|
|||
import android.os.Bundle; |
|||
import android.view.LayoutInflater; |
|||
import android.view.View; |
|||
import android.view.ViewGroup; |
|||
import android.widget.Button; |
|||
|
|||
import androidx.annotation.Nullable; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
|
|||
import com.jakewharton.rxbinding3.widget.RxTextView; |
|||
import com.mukesh.OtpView; |
|||
import com.swifttech.remit.android.R; |
|||
import com.swifttech.remit.android.base.BaseFragment; |
|||
import com.swifttech.remit.android.features.otpverification.presenter.OTPVerificationPresenter; |
|||
import com.swifttech.remit.android.features.otpverification.presenter.OTPVerificationPresenterInterface; |
|||
|
|||
import butterknife.BindView; |
|||
import butterknife.ButterKnife; |
|||
import butterknife.OnClick; |
|||
import io.reactivex.subjects.PublishSubject; |
|||
|
|||
public class OTPVerifyFragment extends BaseFragment { |
|||
|
|||
@BindView(R.id.otp_view) |
|||
OtpView otpView; |
|||
|
|||
|
|||
@BindView(R.id.btn_submit) |
|||
Button btnSubmit; |
|||
|
|||
private OTPVerificationPresenterInterface viewModel; |
|||
|
|||
@Override |
|||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
|||
return inflater.inflate(R.layout.fragment_otp_verify, container, false); |
|||
} |
|||
|
|||
@Override |
|||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
|||
super.onViewCreated(view, savedInstanceState); |
|||
ButterKnife.bind(this, view); |
|||
init(); |
|||
performDefaultAction(savedInstanceState); |
|||
} |
|||
|
|||
private void performDefaultAction(Bundle savedInstanceState) { |
|||
viewModel.subscribeToOTPNumberValidation(RxTextView.textChanges(otpView)).observe(getViewLifecycleOwner(),btnSubmit::setEnabled); |
|||
} |
|||
|
|||
private void init() { |
|||
viewModel=new ViewModelProvider(requireActivity()).get(OTPVerificationPresenter.class); |
|||
} |
|||
|
|||
|
|||
@OnClick(R.id.btn_submit) |
|||
public void submitOTP() |
|||
{ |
|||
if(btnSubmit.isEnabled()) |
|||
{ |
|||
viewModel.submitOTP(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.swifttech.remit.android.features.withdraw; |
|||
|
|||
import androidx.annotation.NonNull; |
|||
import androidx.lifecycle.ViewModel; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
|
|||
import com.swifttech.remit.android.features.cashpickuptowallet.gateway.CashPickupToWalletGateway; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletPresenter; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletPresenterInterface; |
|||
import com.swifttech.remit.android.features.withdraw.gateway.WithdrawGateway; |
|||
import com.swifttech.remit.android.features.withdraw.presenter.WithdrawPresenter; |
|||
import com.swifttech.remit.android.features.withdraw.presenter.WithdrawPresenterInterface; |
|||
|
|||
public class WithdrawViewModelFactory implements ViewModelProvider.Factory { |
|||
|
|||
private final WithdrawPresenterInterface.WithdrawContract view; |
|||
|
|||
public WithdrawViewModelFactory(WithdrawPresenterInterface.WithdrawContract view) { |
|||
this.view=view; |
|||
} |
|||
|
|||
@SuppressWarnings("unchecked") |
|||
@NonNull |
|||
@Override |
|||
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) { |
|||
return (T) new WithdrawPresenter(view,new WithdrawGateway()); |
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
package com.swifttech.remit.android.features.withdraw.gateway; |
|||
|
|||
import com.swifttech.remit.android.base.PrivilegedGateway; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletGatewayInterface; |
|||
import com.swifttech.remit.android.features.withdraw.presenter.WithdrawGatewayInterface; |
|||
|
|||
public class WithdrawGateway extends PrivilegedGateway implements WithdrawGatewayInterface { |
|||
} |
@ -0,0 +1,4 @@ |
|||
package com.swifttech.remit.android.features.withdraw.presenter; |
|||
|
|||
public interface WithdrawGatewayInterface { |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.swifttech.remit.android.features.withdraw.presenter; |
|||
|
|||
import com.swifttech.remit.android.base.BaseViewModel; |
|||
|
|||
|
|||
public class WithdrawPresenter extends BaseViewModel { |
|||
private final WithdrawPresenterInterface.WithdrawContract view; |
|||
private final WithdrawGatewayInterface gateway; |
|||
|
|||
public WithdrawPresenter(WithdrawPresenterInterface.WithdrawContract view, WithdrawGatewayInterface withdrawGateway) { |
|||
this.view=view; |
|||
this.gateway=withdrawGateway; |
|||
} |
|||
|
|||
@Override |
|||
public void onViewReady() { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onViewNotReady() { |
|||
|
|||
} |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.swifttech.remit.android.features.withdraw.presenter; |
|||
|
|||
public interface WithdrawPresenterInterface { |
|||
|
|||
interface WithdrawContract |
|||
{ |
|||
|
|||
} |
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.swifttech.remit.android.features.withdraw.view; |
|||
|
|||
import androidx.appcompat.app.AppCompatActivity; |
|||
import androidx.lifecycle.ViewModelProvider; |
|||
|
|||
import android.os.Bundle; |
|||
import android.view.View; |
|||
import android.widget.TextView; |
|||
|
|||
import com.swifttech.remit.android.R; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.CashPickupViewModelFactory; |
|||
import com.swifttech.remit.android.features.cashpickuptowallet.presenter.CashPickupToWalletPresenter; |
|||
import com.swifttech.remit.android.features.withdraw.WithdrawViewModelFactory; |
|||
import com.swifttech.remit.android.features.withdraw.presenter.WithdrawPresenter; |
|||
import com.swifttech.remit.android.features.withdraw.presenter.WithdrawPresenterInterface; |
|||
|
|||
import butterknife.BindView; |
|||
import butterknife.ButterKnife; |
|||
|
|||
public class WithdrawActivity extends AppCompatActivity implements WithdrawPresenterInterface.WithdrawContract { |
|||
|
|||
@BindView(R.id.iv_back) |
|||
View iv_back; |
|||
|
|||
@BindView(R.id.toolbar_title) |
|||
TextView toolbarTitle; |
|||
|
|||
private WithdrawPresenter viewModel; |
|||
|
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
setContentView(R.layout.activity_withdraw); |
|||
ButterKnife.bind(this); |
|||
init(); |
|||
} |
|||
|
|||
private void init() { |
|||
toolbarTitle.setText("Withdraw"); |
|||
viewModel = new ViewModelProvider(this, new WithdrawViewModelFactory(this)).get(WithdrawPresenter.class); |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,9 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
tools:context=".features.cashpickuptowallet.view.CashPickupToWalletActivity"> |
|||
|
|||
</androidx.constraintlayout.widget.ConstraintLayout> |
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:background="@color/background_gray" |
|||
android:orientation="vertical" |
|||
android:fitsSystemWindows="true"> |
|||
|
|||
|
|||
|
|||
<include layout="@layout/layout_sendmoney_toolbar" /> |
|||
|
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.SwipeDisabledViewPager |
|||
android:id="@+id/otpVerificationViewPager" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"/> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</LinearLayout> |
@ -0,0 +1,9 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
tools:context=".features.withdraw.view.WithdrawActivity"> |
|||
|
|||
</androidx.constraintlayout.widget.ConstraintLayout> |
@ -0,0 +1,453 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:background="@color/background_gray" |
|||
android:orientation="vertical"> |
|||
|
|||
<androidx.constraintlayout.widget.ConstraintLayout |
|||
android:id="@+id/relativeLayout4" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:layout_margin="@dimen/_8sdp" |
|||
android:background="@drawable/ic_recharge_share_background"> |
|||
|
|||
|
|||
<ImageView |
|||
android:id="@+id/senderFlagImageview" |
|||
android:layout_width="@dimen/_30sdp" |
|||
android:layout_height="@dimen/_30sdp" |
|||
android:src="@drawable/flag_default" |
|||
app:layout_constraintEnd_toStartOf="@+id/view12" |
|||
app:layout_constraintStart_toEndOf="@+id/guideline5" |
|||
app:layout_constraintTop_toTopOf="@+id/gmeIconImageview" /> |
|||
|
|||
<com.swifttech.remit.android.features.inboundreceipt.view.ProgressPathView |
|||
android:id="@+id/view12" |
|||
android:layout_width="0dp" |
|||
android:layout_height="@dimen/_1sdp" |
|||
android:layout_marginStart="@dimen/_2sdp" |
|||
android:layout_marginEnd="@dimen/_2sdp" |
|||
app:layout_constraintBottom_toBottomOf="@+id/gmeIconImageview" |
|||
app:layout_constraintEnd_toStartOf="@+id/gmeIconImageview" |
|||
app:layout_constraintHorizontal_bias="0.5" |
|||
app:layout_constraintStart_toEndOf="@+id/senderFlagImageview" |
|||
app:layout_constraintTop_toTopOf="@+id/gmeIconImageview" /> |
|||
|
|||
<ImageView |
|||
android:id="@+id/gmeIconImageview" |
|||
android:layout_width="@dimen/_30sdp" |
|||
android:layout_height="@dimen/_30sdp" |
|||
android:src="@drawable/ic_gme_logo_white" |
|||
android:layout_marginTop="@dimen/_20sdp" |
|||
android:layout_marginBottom="@dimen/_20sdp" |
|||
app:layout_constraintEnd_toStartOf="@+id/view13" |
|||
app:layout_constraintStart_toEndOf="@+id/view12" |
|||
app:layout_constraintTop_toBottomOf="@+id/transfer_label" |
|||
app:layout_constraintBottom_toBottomOf="parent"/> |
|||
|
|||
<com.swifttech.remit.android.features.inboundreceipt.view.ProgressPathView |
|||
android:id="@+id/view13" |
|||
android:layout_width="0dp" |
|||
android:layout_height="@dimen/_1sdp" |
|||
android:layout_marginStart="@dimen/_2sdp" |
|||
android:layout_marginEnd="@dimen/_2sdp" |
|||
app:layout_constraintBottom_toBottomOf="@+id/receiverFlagImageview" |
|||
app:layout_constraintEnd_toStartOf="@+id/receiverFlagImageview" |
|||
app:layout_constraintHorizontal_bias="0.5" |
|||
app:layout_constraintStart_toEndOf="@+id/gmeIconImageview" |
|||
app:layout_constraintTop_toTopOf="@+id/receiverFlagImageview" /> |
|||
|
|||
<ImageView |
|||
android:id="@+id/receiverFlagImageview" |
|||
android:layout_width="@dimen/_30sdp" |
|||
android:layout_height="@dimen/_30sdp" |
|||
android:src="@drawable/flag_south_korea" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintHorizontal_bias="0.5" |
|||
app:layout_constraintEnd_toStartOf="@+id/guideline4" |
|||
app:layout_constraintTop_toTopOf="@+id/gmeIconImageview" /> |
|||
|
|||
|
|||
|
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/transfer_label" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginStart="@dimen/_6sdp" |
|||
android:layout_marginEnd="@dimen/_6sdp" |
|||
android:layout_marginTop="@dimen/_6sdp" |
|||
android:padding="@dimen/_4sdp" |
|||
tools:text="@string/transfer_success_text" |
|||
android:textColor="@color/white" |
|||
android:textSize="@dimen/_14ssp" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent" |
|||
app:txtfontName="@string/semibold" /> |
|||
|
|||
|
|||
|
|||
|
|||
<androidx.constraintlayout.widget.Guideline |
|||
android:id="@+id/guideline4" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="vertical" |
|||
app:layout_constraintGuide_percent="0.9" /> |
|||
|
|||
<androidx.constraintlayout.widget.Guideline |
|||
android:id="@+id/guideline5" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="vertical" |
|||
app:layout_constraintGuide_percent="0.1" /> |
|||
|
|||
|
|||
</androidx.constraintlayout.widget.ConstraintLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:layout_margin="@dimen/_8sdp" |
|||
android:background="@drawable/ic_rectangle_white_extra_corners"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="horizontal"> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:padding="@dimen/_8sdp" |
|||
android:text="@string/transaction_date_text" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" /> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/transaction_date" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_alignParentRight="true" |
|||
android:layout_weight="1" |
|||
android:gravity="end" |
|||
android:padding="@dimen/_8sdp" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" |
|||
app:txtfontName="@string/semibold" /> |
|||
</LinearLayout> |
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:layout_margin="@dimen/_8sdp" |
|||
android:background="@drawable/ic_rectangle_white_extra_corners" |
|||
android:orientation="vertical"> |
|||
|
|||
<LinearLayout |
|||
android:id="@+id/nameContainer" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="horizontal" |
|||
android:weightSum="1"> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:padding="@dimen/_8sdp" |
|||
android:text="@string/receiver_text" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" /> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/tv_receiver" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:gravity="end" |
|||
android:padding="@dimen/_8sdp" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" |
|||
app:txtfontName="@string/semibold" /> |
|||
</LinearLayout> |
|||
|
|||
<View |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
android:background="@color/gray" /> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="horizontal"> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/receiver_label" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:padding="@dimen/_8sdp" |
|||
android:text="@string/address_text" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" /> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/tv_address" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:gravity="end" |
|||
android:padding="@dimen/_8sdp" |
|||
android:singleLine="true" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" |
|||
app:txtfontName="@string/semibold" /> |
|||
</LinearLayout> |
|||
|
|||
<View |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
android:layout_below="@id/receiver_label" |
|||
android:background="@color/gray" /> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="horizontal"> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/mobile_label" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_below="@id/receiver_label" |
|||
android:padding="@dimen/_8sdp" |
|||
android:text="@string/mobile_text" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" /> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/tv_mobile_no" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:gravity="end" |
|||
android:padding="@dimen/_8sdp" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" |
|||
app:txtfontName="@string/semibold" /> |
|||
</LinearLayout> |
|||
|
|||
<View |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
android:layout_below="@id/mobile_label" |
|||
android:background="@color/gray" /> |
|||
|
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content"> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:gravity="left" |
|||
android:padding="@dimen/_8sdp" |
|||
android:text="@string/payout_agent_text" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" /> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/tv_agent_bank" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:ellipsize="end" |
|||
android:gravity="end" |
|||
android:padding="@dimen/_8sdp" |
|||
android:singleLine="false" |
|||
android:text="" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" |
|||
app:txtfontName="@string/semibold" /> |
|||
</LinearLayout> |
|||
|
|||
<View |
|||
android:id="@+id/account_no_container_divider" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
android:background="@color/gray" |
|||
android:visibility="gone" /> |
|||
|
|||
<LinearLayout |
|||
android:id="@+id/account_no_container" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:visibility="gone"> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:gravity="left" |
|||
android:padding="@dimen/_8sdp" |
|||
android:text="@string/account_number_text" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" /> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/tv_acc_no" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:gravity="end" |
|||
android:maxLines="2" |
|||
android:padding="@dimen/_8sdp" |
|||
android:singleLine="false" |
|||
android:text="" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" |
|||
app:txtfontName="@string/semibold" /> |
|||
</LinearLayout> |
|||
|
|||
|
|||
<View |
|||
android:id="@+id/total_sent_amount_divider" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
android:background="@color/gray" /> |
|||
|
|||
<LinearLayout |
|||
android:id="@+id/total_sent_amount_layout" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content"> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:padding="@dimen/_8sdp" |
|||
android:text="@string/total_sent_amount_text" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" /> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/tv_total_sent_amount" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:gravity="end" |
|||
android:padding="@dimen/_8sdp" |
|||
android:text="" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" |
|||
app:txtfontName="@string/semibold" /> |
|||
</LinearLayout> |
|||
|
|||
<!----> |
|||
<View |
|||
android:id="@+id/service_fee_divider" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
android:background="@color/gray" /> |
|||
|
|||
<LinearLayout |
|||
android:id="@+id/service_fee_layout" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content"> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:padding="@dimen/_8sdp" |
|||
android:text="@string/service_fee_text" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" /> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/tv_service_fee" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:gravity="end" |
|||
android:padding="@dimen/_8sdp" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" |
|||
app:txtfontName="@string/semibold" /> |
|||
</LinearLayout> |
|||
<!----> |
|||
<View |
|||
android:id="@+id/coupon_fee_divider" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
android:background="@color/gray" /> |
|||
|
|||
<!----> |
|||
<View |
|||
android:id="@+id/exrate_divider" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
|
|||
android:background="@color/gray" /> |
|||
|
|||
<LinearLayout |
|||
android:id="@+id/exrate_layout" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content"> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:padding="@dimen/_8sdp" |
|||
android:text="@string/ex_rate_text" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" /> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:id="@+id/exrate_fee" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:gravity="end" |
|||
android:padding="@dimen/_8sdp" |
|||
android:textColor="@color/darkgray" |
|||
android:textSize="@dimen/_11ssp" |
|||
app:txtfontName="@string/semibold" /> |
|||
</LinearLayout> |
|||
|
|||
<View |
|||
android:id="@+id/total_amount_divider" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="1dp" |
|||
|
|||
android:background="@color/gray" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeButton |
|||
style="@style/MButton" |
|||
android:visibility="visible" |
|||
android:id="@+id/btn_submit" |
|||
android:layout_gravity="center" |
|||
android:layout_marginBottom="30dp" |
|||
android:layout_marginTop="20dp" |
|||
android:background="@drawable/ic_rounded_background_red_coloured" |
|||
android:text="@string/redeem_text" |
|||
android:textAllCaps="false" |
|||
android:textColor="@color/white" |
|||
android:enabled="true" |
|||
android:textSize="16sp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
</ScrollView> |
@ -0,0 +1,57 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
android:orientation="vertical" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
<LinearLayout |
|||
style="@style/MFormBound" |
|||
android:orientation="vertical" |
|||
> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
style="@style/MFormTitleTextView" |
|||
android:text="Verify Your Mobile Number" |
|||
/> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:layout_marginTop="@dimen/_5sdp" |
|||
android:layout_marginBottom="@dimen/_10sdp" |
|||
style="@style/MFormTitleDescriptionTextView" |
|||
android:text="Please provide us your mobile number to verify and proceed for registration" |
|||
/> |
|||
|
|||
<com.swifttech.remit.android.common.view.MTextInputLayout |
|||
android:id="@+id/mobile_TxtInputLayout" |
|||
app:errorEnabled="true" |
|||
style="@style/MTextInputLayoutForm" |
|||
app:endIconMode="clear_text" |
|||
android:hint="@string/mobile_number_text" |
|||
app:startIconDrawable="@drawable/vd_phone" |
|||
> |
|||
|
|||
<com.swifttech.remit.android.common.view.MTextInputEditText |
|||
android:id="@+id/mobile_edTxt" |
|||
style="@style/MTextInputEditText" |
|||
android:inputType="phone" |
|||
android:imeOptions="actionDone" |
|||
/> |
|||
|
|||
|
|||
</com.swifttech.remit.android.common.view.MTextInputLayout> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeButton |
|||
android:id="@+id/btn_submit" |
|||
style="@style/MButton" |
|||
android:layout_gravity="center" |
|||
android:layout_marginBottom="4dp" |
|||
android:layout_marginTop="30dp" |
|||
android:text="@string/proceed_text" |
|||
/> |
|||
</LinearLayout> |
|||
|
|||
</LinearLayout> |
@ -0,0 +1,52 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
android:orientation="vertical" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
<LinearLayout |
|||
style="@style/MFormBound" |
|||
android:orientation="vertical" |
|||
> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
style="@style/MFormTitleTextView" |
|||
android:text="Complete your mobile verification" |
|||
/> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:layout_marginTop="@dimen/_5sdp" |
|||
android:layout_marginBottom="@dimen/_10sdp" |
|||
style="@style/MFormTitleDescriptionTextView" |
|||
android:text="Please enter the 6-digit OTP code send to your mobile number" |
|||
/> |
|||
|
|||
|
|||
<com.mukesh.OtpView |
|||
style="@style/OtpWidget.OtpView" |
|||
android:layout_marginTop="@dimen/_10sdp" |
|||
android:layout_gravity="center" |
|||
android:id="@+id/otp_view" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:inputType="number" |
|||
android:textColor="@color/darkgray" |
|||
app:itemCount="5" |
|||
app:lineColor="@color/colorPrimary" |
|||
app:viewType="line" |
|||
/> |
|||
|
|||
|
|||
|
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeButton |
|||
android:id="@+id/btn_submit" |
|||
style="@style/MButton" |
|||
android:layout_gravity="center" |
|||
android:layout_marginBottom="4dp" |
|||
android:layout_marginTop="30dp" |
|||
android:text="@string/confirm_text" |
|||
/> |
|||
</LinearLayout> |
|||
|
|||
</LinearLayout> |
@ -0,0 +1,55 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:id="@+id/nestedScrollView" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:background="@color/background_gray" |
|||
android:clickable="true" |
|||
android:scrollbars="none"> |
|||
|
|||
<LinearLayout |
|||
android:id="@+id/rootView" |
|||
style="@style/MFormBoundWithCornerRadius" |
|||
android:orientation="vertical" |
|||
> |
|||
|
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:layout_marginTop="@dimen/_5sdp" |
|||
android:layout_marginBottom="@dimen/_10sdp" |
|||
style="@style/MFormTitleDescriptionTextView" |
|||
android:text="Please enter the Control No that you received inorder to redeem the amount into your wallet" |
|||
/> |
|||
|
|||
<com.swifttech.remit.android.common.view.MTextInputLayout |
|||
android:id="@+id/controlNo_TxtInputLayout" |
|||
app:errorEnabled="true" |
|||
style="@style/MTextInputLayoutForm" |
|||
app:endIconMode="clear_text" |
|||
android:hint="@string/control_no_text" |
|||
> |
|||
|
|||
<com.swifttech.remit.android.common.view.MTextInputEditText |
|||
android:id="@+id/controlNo_edTxt" |
|||
style="@style/MTextInputEditText" |
|||
android:inputType="phone" |
|||
android:imeOptions="actionDone" |
|||
/> |
|||
|
|||
|
|||
</com.swifttech.remit.android.common.view.MTextInputLayout> |
|||
|
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeButton |
|||
android:id="@+id/search_btn" |
|||
style="@style/MButton" |
|||
android:layout_gravity="center" |
|||
android:layout_marginTop="20dp" |
|||
android:layout_marginBottom="20dp" |
|||
android:text="@string/search_text" |
|||
/> |
|||
|
|||
</LinearLayout> |
|||
</androidx.core.widget.NestedScrollView> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue