Preyea Regmi
4 years ago
17 changed files with 616 additions and 61 deletions
-
48app/src/main/AndroidManifest.xml
-
12app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/gateway/CashPickupToWalletGateway.java
-
18app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/model/CashPickupTxnDetailDTO.java
-
42app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/presenter/CashPickupToWalletPresenter.java
-
2app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/view/CashPickupToWalletActivity.java
-
24app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/view/CashPickupTxnDetailFragment.java
-
4app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/view/SearchCashPickupTxnFragment.java
-
12app/src/main/java/com/swifttech/remit/android/features/withdraw/gateway/WithdrawGateway.java
-
76app/src/main/java/com/swifttech/remit/android/features/withdraw/model/WithdrawStatusResponseDTO.java
-
10app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawGatewayInterface.java
-
204app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawPresenter.java
-
18app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawPresenterInterface.java
-
43app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawViewLiveData.java
-
49app/src/main/java/com/swifttech/remit/android/features/withdraw/view/WithdrawActivity.java
-
26app/src/main/res/layout/activity_cash_pickup_to_wallet.xml
-
68app/src/main/res/layout/activity_withdraw.xml
-
21app/src/main/res/layout/fragment_cash_pickup_txn_detail.xml
@ -0,0 +1,76 @@ |
|||
package com.swifttech.remit.android.features.withdraw.model; |
|||
|
|||
import android.util.Log; |
|||
|
|||
import com.google.gson.annotations.Expose; |
|||
import com.google.gson.annotations.SerializedName; |
|||
import com.swifttech.remit.android.utils.Utils; |
|||
|
|||
public class WithdrawStatusResponseDTO { |
|||
|
|||
@SerializedName("minAmount") |
|||
@Expose |
|||
private String minAmount; |
|||
@SerializedName("maxAmount") |
|||
@Expose |
|||
private String maxAmount; |
|||
@SerializedName("serviceCharge") |
|||
@Expose |
|||
private String serviceCharge; |
|||
@SerializedName("noticeMessage") |
|||
@Expose |
|||
private String noticeMessage; |
|||
|
|||
public String getMinAmount() { |
|||
return minAmount; |
|||
} |
|||
|
|||
public void setMinAmount(String minAmount) { |
|||
this.minAmount = minAmount; |
|||
} |
|||
|
|||
public String getMaxAmount() { |
|||
return maxAmount; |
|||
} |
|||
|
|||
public void setMaxAmount(String maxAmount) { |
|||
this.maxAmount = maxAmount; |
|||
} |
|||
|
|||
public String getServiceCharge() { |
|||
return serviceCharge; |
|||
} |
|||
|
|||
public void setServiceCharge(String serviceCharge) { |
|||
this.serviceCharge = serviceCharge; |
|||
} |
|||
|
|||
public String getNoticeMessage() { |
|||
return noticeMessage; |
|||
} |
|||
|
|||
public void setNoticeMessage(String noticeMessage) { |
|||
this.noticeMessage = noticeMessage; |
|||
} |
|||
|
|||
|
|||
|
|||
public boolean isWithdrawAmountGreaterThanMinThreshold(double amount) { |
|||
Double minThreshold = Utils.formatCurrencyForComparision(this.minAmount); |
|||
Log.d("Withdraw","Entered amount: "+amount+" min threshold amount: "+minThreshold+" result: "+(minThreshold >= 0 && (amount > minThreshold))); |
|||
return minThreshold >= 0 && (amount > minThreshold); |
|||
} |
|||
|
|||
public boolean isWithdrawAmountLessThanMaxThreshold(double amount) { |
|||
Double maxThreshold = Utils.formatCurrencyForComparision(this.maxAmount); |
|||
Log.d("Withdraw","Entered amount: "+amount+" max threshold amount: "+maxThreshold+" result: "+(maxThreshold > 0 && (amount >= maxThreshold))); |
|||
|
|||
return maxThreshold > 0 && (amount <= maxThreshold); |
|||
} |
|||
|
|||
public void seedDummyValues() { |
|||
this.minAmount="1,000"; |
|||
this.maxAmount="10,000"; |
|||
this.serviceCharge="1,000"; |
|||
} |
|||
} |
@ -1,4 +1,12 @@ |
|||
package com.swifttech.remit.android.features.withdraw.presenter; |
|||
|
|||
public interface WithdrawGatewayInterface { |
|||
import com.swifttech.remit.android.base.PrivilegedGatewayInterface; |
|||
|
|||
import io.reactivex.Observable; |
|||
import okhttp3.ResponseBody; |
|||
|
|||
public interface WithdrawGatewayInterface extends PrivilegedGatewayInterface { |
|||
|
|||
Observable<ResponseBody> checkWithdrawStatus(String auth,String userID); |
|||
Observable<ResponseBody> performWithdraw(String auth,String userID,String amount,String password); |
|||
} |
@ -1,8 +1,22 @@ |
|||
package com.swifttech.remit.android.features.withdraw.presenter; |
|||
|
|||
public interface WithdrawPresenterInterface { |
|||
import androidx.lifecycle.LiveData; |
|||
|
|||
interface WithdrawContract |
|||
import com.swifttech.remit.android.base.BaseContractInterface; |
|||
import com.swifttech.remit.android.base.BasePresenterInterface; |
|||
import com.swifttech.remit.android.common.model.FormInputStateDTO; |
|||
|
|||
import io.reactivex.Observable; |
|||
|
|||
public interface WithdrawPresenterInterface extends BasePresenterInterface { |
|||
|
|||
|
|||
WithdrawViewLiveData subscribeToWithdrawAmountEventLiveData(Observable<CharSequence> specifiedAmount); |
|||
|
|||
void proceedToWithdraw(); |
|||
|
|||
|
|||
interface WithdrawContract extends BaseContractInterface |
|||
{ |
|||
|
|||
} |
|||
|
@ -0,0 +1,43 @@ |
|||
package com.swifttech.remit.android.features.withdraw.presenter; |
|||
|
|||
import androidx.lifecycle.LiveData; |
|||
import androidx.lifecycle.MutableLiveData; |
|||
|
|||
import com.swifttech.remit.android.common.model.FormInputStateDTO; |
|||
|
|||
public class WithdrawViewLiveData { |
|||
|
|||
MutableLiveData<FormInputStateDTO<String>> amountLiveData; |
|||
MutableLiveData<String> serviceCharge; |
|||
MutableLiveData<Boolean> allFieldValidLiveData; |
|||
|
|||
public WithdrawViewLiveData() { |
|||
amountLiveData = new MutableLiveData<>(); |
|||
serviceCharge = new MutableLiveData<>(); |
|||
allFieldValidLiveData = new MutableLiveData<>(); |
|||
} |
|||
|
|||
public LiveData<FormInputStateDTO<String>> getAmountLiveData() { |
|||
return amountLiveData; |
|||
} |
|||
|
|||
public void setAmountLiveData(FormInputStateDTO<String> amountLiveData) { |
|||
this.amountLiveData.setValue(amountLiveData); |
|||
} |
|||
|
|||
public LiveData<String> getServiceCharge() { |
|||
return serviceCharge; |
|||
} |
|||
|
|||
public void setServiceCharge(String serviceCharge) { |
|||
this.serviceCharge.setValue(serviceCharge); |
|||
} |
|||
|
|||
public LiveData<Boolean> getAllFieldValidLiveData() { |
|||
return allFieldValidLiveData; |
|||
} |
|||
|
|||
public void setAllFieldValidLiveData(Boolean allFieldValidLiveData) { |
|||
this.allFieldValidLiveData.setValue(allFieldValidLiveData); |
|||
} |
|||
} |
@ -1,9 +1,27 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
|
|||
|
|||
<LinearLayout 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"> |
|||
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/cashPickupViewPager" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"/> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</androidx.constraintlayout.widget.ConstraintLayout> |
|||
</LinearLayout> |
@ -1,9 +1,69 @@ |
|||
<?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" |
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
tools:context=".features.withdraw.view.WithdrawActivity"> |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
android:background="@color/m_layout_bg_color" |
|||
android:orientation="vertical" |
|||
tools:context=".features.sendmoney.view.SendMoneyV2Activity"> |
|||
|
|||
<include layout="@layout/layout_sendmoney_toolbar" /> |
|||
|
|||
<ScrollView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<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 required amount to withdraw from your wallet to your bank." |
|||
/> |
|||
|
|||
<com.swifttech.remit.android.common.view.MTextInputLayout |
|||
android:id="@+id/amount_TxtInputLayout" |
|||
app:errorEnabled="true" |
|||
style="@style/MTextInputLayoutForm" |
|||
app:endIconMode="clear_text" |
|||
android:hint="Enter Amount(MNT)" |
|||
> |
|||
|
|||
<com.swifttech.remit.android.common.view.MTextInputEditText |
|||
android:id="@+id/amount_edTxt" |
|||
style="@style/MTextInputEditText" |
|||
android:inputType="phone" |
|||
android:imeOptions="actionDone" |
|||
/> |
|||
|
|||
|
|||
</com.swifttech.remit.android.common.view.MTextInputLayout> |
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeTextView |
|||
android:layout_marginBottom="@dimen/_10sdp" |
|||
style="@style/MFormTitleDescriptionTextView" |
|||
android:id="@+id/service_charge_txt" |
|||
android:gravity="center" |
|||
tools:text="Per Transaction Service Charge: \n 1,000 MNT" |
|||
/> |
|||
|
|||
|
|||
<com.swifttech.remit.android.common.customwidgets.GmeButton |
|||
android:id="@+id/proceedBtn" |
|||
style="@style/MButton" |
|||
android:layout_gravity="center" |
|||
android:layout_marginTop="20dp" |
|||
android:layout_marginBottom="20dp" |
|||
android:text="@string/proceed_text" |
|||
/> |
|||
|
|||
</androidx.constraintlayout.widget.ConstraintLayout> |
|||
</LinearLayout> |
|||
</ScrollView> |
|||
</LinearLayout> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue