Browse Source

Penny Test fixes

master
Preyea Regmi 6 years ago
parent
commit
5f9dc3e34f
  1. 2
      app/src/main/AndroidManifest.xml
  2. 30
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/pennytest/PennyTestActivity.java
  3. 23
      app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/pennytest/PennyTestOperationFragment.java
  4. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/withdrawV2/presenter/WithdrawV2Presenter.java
  5. 155
      app/src/main/res/layout/fragment_penny_test_operation.xml
  6. 2
      app/src/main/res/layout/fragment_penny_test_prompt.xml

2
app/src/main/AndroidManifest.xml

@ -569,7 +569,7 @@
<activity android:name=".kycV2.view.pennytest.PennyTestActivity"
android:screenOrientation="portrait"
android:excludeFromRecents="true"
android:theme="@style/ActivityDialog"></activity>
android:theme="@style/ActivityDialog"/>
</application>
</manifest>

30
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/pennytest/PennyTestActivity.java

@ -28,6 +28,7 @@ import android.widget.ProgressBar;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.BaseActivity;
import com.gmeremit.online.gmeremittance_native.customwidgets.ZoomOutTransformation;
import com.gmeremit.online.gmeremittance_native.kycV2.adapter.PennyTestViewPagerAdapter;
import com.gmeremit.online.gmeremittance_native.kycV2.presenter.pennytest.PennyTestPresenter;
import com.gmeremit.online.gmeremittance_native.kycV2.presenter.pennytest.PennyTestPresenterInterface;
@ -255,7 +256,12 @@ public class PennyTestActivity extends BaseActivity implements View.OnClickListe
if( currentFragment instanceof PennyTestPromptFragment)
morphButtonIntoProgressBar(()->this.presenter.requestForPennyTest());
else if(currentFragment instanceof PennyTestOperationFragment)
morphButtonIntoProgressBar(()->this.presenter.performPennyTest(((PennyTestOperationFragment)currentFragment).getCertNumber()));
morphButtonIntoProgressBar(()->{
String creditNumber=((PennyTestOperationFragment)currentFragment).getCertNumber();
if(creditNumber!=null)
this.presenter.performPennyTest(creditNumber);
});
break;
case R.id.iv_back:
@ -285,20 +291,6 @@ public class PennyTestActivity extends BaseActivity implements View.OnClickListe
}
public void closeViewWithPennyTestCompleted() {
Intent returnIntent = new Intent();
returnIntent.putExtra(PENNY_TEST_COMPLETED_PERFORMED_STATUS_BUNDLE_KEY, true);
setResult(Activity.RESULT_OK, returnIntent);
finish();
}
public void closeViewWithPennyTestRequested() {
Intent returnIntent = new Intent();
returnIntent.putExtra(PENNY_TEST_REQUEST_PERFORMED_STATUS_BUNDLE_KEY, true);
setResult(Activity.RESULT_OK, returnIntent);
finish();
}
@Override
public void onBackPressed() {
if(!isLoadingInProgress)
@ -346,6 +338,14 @@ public class PennyTestActivity extends BaseActivity implements View.OnClickListe
}
}
public void requestPennyTestAgain()
{
if(this.presenter!=null)
morphButtonIntoProgressBar(()->this.presenter.requestPennyTestAgain());
}
@Override
public void onPennyTestSuccess() {
Intent returnIntent = new Intent();

23
app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/pennytest/PennyTestOperationFragment.java

@ -27,6 +27,9 @@ public class PennyTestOperationFragment extends BaseFragment implements View.OnC
@BindView(R.id.resend_request)
TextView resendRequest;
@BindView(R.id.accountWrapper)
TextView accountWrapper;
@BindView(R.id.ed_creditNumber)
EditText creditNumber;
private String titleMessage=null;
@ -46,7 +49,6 @@ public class PennyTestOperationFragment extends BaseFragment implements View.OnC
private void init()
{
creditNumber.requestFocus();
}
@Override
@ -76,7 +78,14 @@ public class PennyTestOperationFragment extends BaseFragment implements View.OnC
public String getCertNumber() {
return creditNumber.getText().toString();
if(creditNumber.getText().toString().length()>0) {
accountWrapper.setError(null);
return creditNumber.getText().toString();
}
else {
accountWrapper.setError("Please enter a valid code");
return null;
}
}
@Override
@ -94,9 +103,13 @@ public class PennyTestOperationFragment extends BaseFragment implements View.OnC
}
private void requestPennyTestAgain() {
PennyTestPresenterInterface presenter= (PennyTestPresenterInterface) getActivity();
if(presenter!=null)
presenter.requestPennyTestAgain();
try {
((PennyTestActivity) getActivity()).requestPennyTestAgain();
}catch(NullPointerException e)
{
}
}
public void setTitle(String msg) {

4
app/src/main/java/com/gmeremit/online/gmeremittance_native/withdrawV2/presenter/WithdrawV2Presenter.java

@ -154,9 +154,9 @@ public class WithdrawV2Presenter extends BasePresenter implements WithdrawV2Pres
@Override
protected void onSuccess(GenericResponseDataModel<MessageResponseDataModel> response) {
if (response.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
view.showPopUpMessage(response.getMsg(), CustomAlertDialog.AlertType.SUCCESS, alertType -> view.exitView());
view.showPopUpMessage(response.getData().getMsg(), CustomAlertDialog.AlertType.SUCCESS, alertType -> view.exitView());
} else {
view.showPopUpMessage(response.getData().getMsg(), CustomAlertDialog.AlertType.FAILED, null);
view.showPopUpMessage(response.getMsg(), CustomAlertDialog.AlertType.FAILED, null);
}
}

155
app/src/main/res/layout/fragment_penny_test_operation.xml

@ -1,89 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView 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:isScrollContainer="false"
android:layout_height="match_parent">
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/titleText"
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="Please enter the amount deposited by GME inorder to complete your bank account verification process."
android:textSize="21sp"
app:layout_constraintBottom_toTopOf="@+id/accountWrapper"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintVertical_chainStyle="packed" />
<android.support.design.widget.TextInputLayout
android:id="@+id/accountWrapper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:hint="Deposit Reference"
android:textColorHint="@color/darkgray"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/image_example"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleText">
android:layout_height="wrap_content">
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText
android:id="@+id/ed_creditNumber"
style="@style/editetxtsingleline"
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/titleText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="false" />
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="Please enter the amount deposited by GME inorder to complete your bank account verification process."
android:textSize="17sp"
app:layout_constraintBottom_toTopOf="@+id/accountWrapper"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintVertical_chainStyle="packed" />
<android.support.design.widget.TextInputLayout
android:id="@+id/accountWrapper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:hint="Deposit Reference"
android:textColorHint="@color/darkgray"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/image_example"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleText">
</android.support.design.widget.TextInputLayout>
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeEditText
android:id="@+id/ed_creditNumber"
style="@style/editetxtsingleline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="text"
android:singleLine="false" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/image_example"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginEnd="8dp"
android:gravity="center"
android:padding="10dp"
android:text="View Sample"
android:textColor="#007aff"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="@+id/accountWrapper"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/accountWrapper" />
</android.support.design.widget.TextInputLayout>
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/image_example"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginEnd="8dp"
android:gravity="center"
android:padding="10dp"
android:text="View Sample"
android:textColor="#007aff"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="@+id/accountWrapper"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/accountWrapper" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/resend_request"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
android:gravity="center"
android:padding="10dp"
android:text="@string/resend_request"
android:textColor="@color/colorPrimary"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/accountWrapper" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/resend_request"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
android:gravity="center"
android:padding="10dp"
android:text="@string/resend_request"
android:textColor="@color/colorPrimary"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/accountWrapper" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>

2
app/src/main/res/layout/fragment_penny_test_prompt.xml

@ -15,7 +15,7 @@
android:paddingEnd="15dp"
android:paddingBottom="15dp"
android:text="Your bank account verification is required inorder to complete the registration. Do you want to verify it now?"
android:textSize="21sp"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"

Loading…
Cancel
Save