Browse Source

Minor fixes

master
Preyea Regmi 5 years ago
parent
commit
0d68035f54
  1. 8
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/presenter/ExchangeRatePresenter.java
  2. 8
      app/src/main/java/com/gmeremit/online/gmeremittance_native/notice/presenter/NoticeViewModel.java
  3. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/presenter/resend/ReSendMoneyV2Presenter.java
  4. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/HTTPConstants.java
  5. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/webbrowserV2/WebBrowserFragmentV2.java
  6. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/webbrowserV2/WebBrowserV2Activity.java

8
app/src/main/java/com/gmeremit/online/gmeremittance_native/exrate/presenter/ExchangeRatePresenter.java

@ -1,7 +1,6 @@
package com.gmeremit.online.gmeremittance_native.exrate.presenter;
import android.os.Handler;
import android.util.Log;
import com.gmeremit.online.gmeremittance_native.GmeApplication;
import com.gmeremit.online.gmeremittance_native.R;
@ -29,6 +28,8 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers;
import static com.gmeremit.online.gmeremittance_native.utils.https.HTTPConstants.HTTP_INVALID_REQUEST;
public class ExchangeRatePresenter extends BasePresenter implements ExchangeRatePresenterInterface {
private final ExchangeRatePresenterInterface.ExchangeRateContractInterfacee view;
@ -312,6 +313,11 @@ public class ExchangeRatePresenter extends BasePresenter implements ExchangeRate
view.showPayoutAmount(Utils.formatCurrencyWithoutTruncatingDecimal(pAmount));
view.showCollectionAmount(Utils.formatCurrency(cAmount));
}
else
{
clearExistingRateOnFailure();
view.showPopUpMessage(HTTP_INVALID_REQUEST, CustomAlertDialog.AlertType.FAILED, null);
}
} else {
clearExistingRateOnFailure();

8
app/src/main/java/com/gmeremit/online/gmeremittance_native/notice/presenter/NoticeViewModel.java

@ -96,11 +96,10 @@ public class NoticeViewModel extends BaseViewModel implements NoticePresenterInt
@Override
protected void onSuccess(GenericResponseDataModel<List<NoticeDTO>> t) {
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
if(t.getData()!=null&&t.getData().size()>0) {
if (t.getData() != null && t.getData().size() > 0) {
view.lazyInitViews();
sortNoticeList(t.getData());
}
else
} else
view.showPopUpMessage("You don't have any notification at the moment.", CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView());
} else {
@ -136,7 +135,8 @@ public class NoticeViewModel extends BaseViewModel implements NoticePresenterInt
// }
// return 0;
// });
Collections.reverse(data);
if (data != null)
Collections.reverse(data);
noticeListLiveData.setValue(data);
}

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/resendV2/presenter/resend/ReSendMoneyV2Presenter.java

@ -163,7 +163,7 @@ public class ReSendMoneyV2Presenter extends BasePresenter implements ReSendMoney
@Override
public void getPrepData() {
if (previousTransactionRelatedData == null)
view.showPopUpMessage(HTTPConstants.HTTP_BAD_URL, CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView());
view.showPopUpMessage(HTTPConstants.HTTP_INVALID_REQUEST, CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView());
else {
compositeObservable.add(
this.gateway.getResendRelatedData(this.gateway.getAuth(), previousTransactionRelatedData.getSelectedTransaction().getTranId())

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/HTTPConstants.java

@ -8,7 +8,7 @@ public class HTTPConstants {
public static final String HTTP_RESPONSE_NO_INTERNET = "No internet";
public static final String HTTP_RESPONSE_UNKNOWN = "Unknown Error";
public static final String APPLICATION_WISE_ERROR_KEY = "1";
public static final String HTTP_BAD_URL = "Bad Request. Please contact GME Support.";
public static final String HTTP_INVALID_REQUEST = "Invalid Request. Please contact GME Support.";
private static final String HTTP_RESPONSE_405 = "405";

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/webbrowserV2/WebBrowserFragmentV2.java

@ -180,7 +180,7 @@ public abstract class WebBrowserFragmentV2 extends BaseFragment {
return HTTPConstants.HTTP_RESPONSE_NO_INTERNET;
case WebViewClient.ERROR_BAD_URL:
return HTTPConstants.HTTP_BAD_URL;
return HTTPConstants.HTTP_INVALID_REQUEST;
default:
return HTTPConstants.HTTP_RESPONSE_UNKNOWN;

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/webbrowserV2/WebBrowserV2Activity.java

@ -385,7 +385,7 @@ public abstract class WebBrowserV2Activity extends BaseActivity implements View
return HTTPConstants.HTTP_RESPONSE_NO_INTERNET;
case WebViewClient.ERROR_BAD_URL:
return HTTPConstants.HTTP_BAD_URL;
return HTTPConstants.HTTP_INVALID_REQUEST;
default:
return HTTPConstants.HTTP_RESPONSE_UNKNOWN;

Loading…
Cancel
Save