Browse Source

Managing notifications

master
Preyea Regmi 6 years ago
parent
commit
48378d46d3
  1. 9
      app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/presenter/HomeV2Presenter.java
  2. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/presenter/HomeV2PresenterInterface.java
  3. 8
      app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/view/HomeActivityV2.java
  4. 28
      app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/view/HomeFragmentV2.java
  5. 94
      app/src/main/res/layout/fragment_home_v2.xml

9
app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/presenter/HomeV2Presenter.java

@ -71,9 +71,12 @@ public class HomeV2Presenter extends BasePresenter implements HomeV2PresenterInt
@Override
public void manuallyUpdateKYCForStatusToSubmitted() {
String message = "Your registration request is in approval process. You will soon be able to use GME services.";
String title = "Verification in Process";
view.showKYCVerifiedIfRequired(true, message, title, true);
String kycMessage = "Your registration request is in approval process. You will soon be able to use GME services.";
String kycTitle = "Verification in Process";
String pennyTestTitle = "Verify your Bank Account";
String pennyTestMessage = "Please complete your primary bank account verification process.";
view.showPennyTestViewIfRequired(true,pennyTestTitle,pennyTestMessage);
view.showKYCVerifiedIfRequired(true, kycMessage, kycTitle, true);
gateway.updateSubmittedKycInCache(true);
gateway.updateVerifiedUserInCache(false);

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/presenter/HomeV2PresenterInterface.java

@ -33,5 +33,7 @@ public interface HomeV2PresenterInterface extends BasePresenterInterface {
void performLogout();
void showWithdrawView(Boolean action);
void showPennyTestViewIfRequired(boolean showView, String pennyTestTitle, String pennyTestMessage);
}
}

8
app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/view/HomeActivityV2.java

@ -357,7 +357,13 @@ public class HomeActivityV2 extends BaseActivity implements HomeParentViewContra
@Override
public void showKYCVerifiedIfRequired(boolean shouldShowView, String message, String title, boolean disableKYCViewClick) {
if (currentFragment != null && currentFragment instanceof HomeFragmentV2)
((HomeFragmentV2) currentFragment).showKYCVerifiedIfRequired(shouldShowView, message, title, disableKYCViewClick);
((HomeFragmentV2) currentFragment).showKYCVerifiedIfRequired(shouldShowView, message, title, disableKYCViewClick,null);
}
@Override
public void showPennyTestViewIfRequired(boolean showView, String pennyTestTitle, String pennyTestMessage) {
if (currentFragment != null && currentFragment instanceof HomeFragmentV2)
((HomeFragmentV2) currentFragment).showPennyTestViewIfRequired(showView, pennyTestMessage,pennyTestTitle);
}
@Override

28
app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/view/HomeFragmentV2.java

@ -76,7 +76,7 @@ public class HomeFragmentV2 extends BaseFragment implements HomeMenuRvAdapterV2.
private boolean disableKYCViewClick;
private HomeFragmentDataObserver homeFragmentDataObserver;
private CompositeDisposable compositeDisposable;
private boolean hasRequestedPennyTestEarlier=false;
private boolean hasRequestedPennyTestEarlier = false;
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@ -225,10 +225,9 @@ public class HomeFragmentV2 extends BaseFragment implements HomeMenuRvAdapterV2.
}
private void showPennyTestView(boolean hasRequestedPennyTestEarlier)
{
private void showPennyTestView(boolean hasRequestedPennyTestEarlier) {
Intent startPennyTestIntent = new Intent(getActivity(), PennyTestActivity.class);
startPennyTestIntent.putExtra(PennyTestActivity.HAS_REQUESTED_FOR_PENNY_TEST,hasRequestedPennyTestEarlier);
startPennyTestIntent.putExtra(PennyTestActivity.HAS_REQUESTED_FOR_PENNY_TEST, hasRequestedPennyTestEarlier);
startActivity(startPennyTestIntent);
}
@ -242,7 +241,7 @@ public class HomeFragmentV2 extends BaseFragment implements HomeMenuRvAdapterV2.
HomeParentViewContractV2 parentView = ((HomeParentViewContractV2) getActivity());
if (parentView != null)
parentView.getPresenter().manuallyUpdateKYCForStatusToSubmitted();
new Handler().postDelayed(()->showPennyTestView(false),500);
new Handler().postDelayed(() -> showPennyTestView(false), 500);
}
}
@ -258,20 +257,18 @@ public class HomeFragmentV2 extends BaseFragment implements HomeMenuRvAdapterV2.
}
}
public void showKYCVerifiedIfRequired(boolean shouldShowView, String message, String title, boolean disableKYCViewClick) {
public void showKYCVerifiedIfRequired(boolean shouldShowView, String message, String title, boolean disableKYCViewClick, Runnable callback) {
if (isUIReady()) {
if (shouldShowView) {
this.disableKYCViewClick = disableKYCViewClick;
kycVerificationBody.setText(message);
kycTitleLabel.setText(title);
if (kyc_notice_view.getVisibility() != View.VISIBLE)
Utils.expand(kyc_notice_view, null, 200);
Utils.expand(kyc_notice_view, callback, 200);
} else {
if (kyc_notice_view.getVisibility() != View.GONE)
Utils.collapse(kyc_notice_view, () -> {
// kycVerificationBody.setText(message);
// kycVerificationBody.setText(title);
}, 200);
}
} else {
@ -282,12 +279,11 @@ public class HomeFragmentV2 extends BaseFragment implements HomeMenuRvAdapterV2.
kycVerificationBody.setText(message);
kycTitleLabel.setText(title);
if (kyc_notice_view.getVisibility() != View.VISIBLE)
Utils.expand(kyc_notice_view, null, 200);
Utils.expand(kyc_notice_view, callback, 200);
} else {
if (kyc_notice_view.getVisibility() != View.GONE)
Utils.collapse(kyc_notice_view, () -> {
}, 200);
}
@ -336,11 +332,13 @@ public class HomeFragmentV2 extends BaseFragment implements HomeMenuRvAdapterV2.
@Override
protected void onSuccess(HomeV2Presenter.HomeFragmentRelatedData dashboardRelatedData) {
hasRequestedPennyTestEarlier = dashboardRelatedData.hasRequestedPennyTest();
updateInfo(dashboardRelatedData.getUserName(), dashboardRelatedData.getYearlyLimit(), dashboardRelatedData.getRewardPoint());
showKYCVerifiedIfRequired(dashboardRelatedData.isShouldShowKycView(), dashboardRelatedData.getKycMessage(), dashboardRelatedData.getKycTitle(), dashboardRelatedData.isDisableKYCViewClick());
hasRequestedPennyTestEarlier=dashboardRelatedData.hasRequestedPennyTest();
new Handler().postDelayed(() -> showPennyTestViewIfRequired(dashboardRelatedData.isPennyTestPending(), dashboardRelatedData.getPennyTestMessage(), dashboardRelatedData.getPennyTestTitle())
, 400);
// showKYCVerifiedIfRequired(dashboardRelatedData.isShouldShowKycView(), dashboardRelatedData.getKycMessage(), dashboardRelatedData.getKycTitle(), dashboardRelatedData.isDisableKYCViewClick(),
// () -> new Handler().postDelayed(()-> showPennyTestViewIfRequired(dashboardRelatedData.isPennyTestPending(), dashboardRelatedData.getPennyTestMessage(), dashboardRelatedData.getPennyTestTitle()),200));
showKYCVerifiedIfRequired(dashboardRelatedData.isShouldShowKycView(), dashboardRelatedData.getKycMessage(), dashboardRelatedData.getKycTitle(), dashboardRelatedData.isDisableKYCViewClick(),
() -> showPennyTestViewIfRequired(dashboardRelatedData.isPennyTestPending(), dashboardRelatedData.getPennyTestMessage(), dashboardRelatedData.getPennyTestTitle()));
}
@Override

94
app/src/main/res/layout/fragment_home_v2.xml

@ -77,7 +77,57 @@
</RelativeLayout>
<android.support.constraint.ConstraintLayout
<!--<android.support.constraint.ConstraintLayout-->
<!--android:id="@+id/penny_test_pending_view"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginBottom="4dp"-->
<!--android:background="@color/white"-->
<!--android:padding="8dp"-->
<!--android:visibility="gone">-->
<!--<ImageView-->
<!--android:id="@+id/penny_test_view"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginStart="10dp"-->
<!--android:src="@drawable/ic_kyc_non_verified_userstatus"-->
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toTopOf="parent" />-->
<!--<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView-->
<!--android:id="@+id/penny_test_label"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginStart="10dp"-->
<!--android:paddingLeft="10dp"-->
<!--android:paddingTop="4dp"-->
<!--android:paddingBottom="2dp"-->
<!--android:textColor="@color/colorAccent"-->
<!--android:textSize="14sp"-->
<!--app:layout_constraintStart_toEndOf="@+id/penny_test_view"-->
<!--app:layout_constraintTop_toTopOf="@+id/penny_test_view" />-->
<!--<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView-->
<!--android:id="@+id/penny_test_text"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginStart="10dp"-->
<!--android:layout_marginEnd="10dp"-->
<!--android:paddingLeft="10dp"-->
<!--android:paddingTop="2dp"-->
<!--android:paddingRight="4dp"-->
<!--android:textColor="@color/darkgray"-->
<!--android:textSize="10sp"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintStart_toEndOf="@+id/penny_test_view"-->
<!--app:layout_constraintTop_toBottomOf="@+id/penny_test_label" />-->
<!--</android.support.constraint.ConstraintLayout>-->
<RelativeLayout
android:id="@+id/penny_test_pending_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -90,44 +140,44 @@
android:id="@+id/penny_test_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:src="@drawable/ic_kyc_non_verified_userstatus"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:src="@drawable/ic_kyc_non_verified_userstatus" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/penny_test_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_toRightOf="@id/penny_test_view"
android:paddingBottom="2dp"
android:paddingLeft="10dp"
android:paddingTop="4dp"
android:paddingBottom="2dp"
android:textColor="@color/colorAccent"
android:textSize="14sp"
app:layout_constraintStart_toEndOf="@+id/penny_test_view"
app:layout_constraintTop_toTopOf="@+id/penny_test_view" />
android:textSize="14sp" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/penny_test_text"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="8dp"
android:layout_below="@id/penny_test_label"
android:layout_toLeftOf="@id/iv_gme_branch_loc2"
android:layout_toRightOf="@id/penny_test_view"
android:paddingLeft="10dp"
android:paddingTop="2dp"
android:paddingRight="4dp"
android:paddingTop="2dp"
android:textColor="@color/darkgray"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="@+id/penny_test_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/penny_test_view"
app:layout_constraintTop_toBottomOf="@+id/penny_test_label" />
android:textSize="10sp" />
<ImageView
android:visibility="invisible"
android:id="@+id/iv_gme_branch_loc2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/penny_test_text"
android:layout_alignParentRight="true"
android:src="@drawable/ic_gme_location_circlebackground" />
</android.support.constraint.ConstraintLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/user_status_layout"

Loading…
Cancel
Save