Browse Source

Merge branch 'UIChanges' into MYRewards

new_design
Mukesh Dhungana 2 years ago
parent
commit
7508647b37
  1. 7
      app/src/main/java/com/remit/jmecustomer/common/customwidgets/CustomAlertDialog.java
  2. 31
      app/src/main/java/com/remit/jmecustomer/features/home/model/HomeViewRelatedDTOV2.java
  3. 2
      app/src/main/java/com/remit/jmecustomer/features/home/presenter/HomeV2PresenterInterface.java
  4. 7
      app/src/main/java/com/remit/jmecustomer/features/home/presenter/HomeViewModel.java
  5. 15
      app/src/main/java/com/remit/jmecustomer/features/home/view/HomeActivityV2.java
  6. 5
      app/src/main/java/com/remit/jmecustomer/features/home/view/HomeFragmentV2.java
  7. 17
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/presenter/MyNotificationViewModel.java
  8. 4
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/view/MyNotificationListingFragment.java

7
app/src/main/java/com/remit/jmecustomer/common/customwidgets/CustomAlertDialog.java

@ -64,10 +64,11 @@ public class CustomAlertDialog extends DialogFragment {
break;
case FAILED:
String walletNumber = RemitApplication.getStorage().getString(PrefKeys.USER_WALLET_NUMBER, "");
//String walletNumber = RemitApplication.getStorage().getString(PrefKeys.USER_WALLET_NUMBER, "");
String memberShipId = RemitApplication.getStorage().getString(PrefKeys.USER_REFERRAL_CODE, "");
String message = getString(R.string.error_text);
if (walletNumber.length() > 0)
message += " - (" + walletNumber + ")";
if (memberShipId.length() > 0)
message += " - (" + memberShipId + ")";
dialogTitleTxt.setText(message);
logo = AnimatedVectorDrawableCompat.create(getActivity(), R.drawable.avd_fail_transition);
break;

31
app/src/main/java/com/remit/jmecustomer/features/home/model/HomeViewRelatedDTOV2.java

@ -2,17 +2,17 @@ package com.remit.jmecustomer.features.home.model;
public class HomeViewRelatedDTOV2 {
private boolean shouldShowTermsAndCondition;
private String bankName;
private String walletNo;
private String yearlyLimit;
private boolean shouldShowTermsAndCondition;
private String bankName;
private String walletNo;
private String yearlyLimit;
private HomeNotificationViewDTO homeNotificationViewDTO;
private String userName;
private String availableBalance;
private String rewardPoint;
private String referralCode;
private String notificationCount;
public HomeViewRelatedDTOV2(boolean shouldShowKycView, String kycMessage, String kycTitle, boolean disableKYCViewClick, String userName, String availableBalance, String rewardPoint, boolean isPennyTestPending, boolean hasRequestedPennyTest, String pennyTestTitle, String pennyTestMessage, boolean shouldShowAutoDebitNotice, String autoDebitTitle, String autoDebitBody) {
@ -22,18 +22,20 @@ public class HomeViewRelatedDTOV2 {
}
public HomeViewRelatedDTOV2(String userName, String availableBalance,String yearlyLimit, String rewardPoint , String bankName,String walletNo, HomeNotificationViewDTO homeNotificationViewDTO,boolean shouldShowTermsAndCondition,String referralCode) {
public HomeViewRelatedDTOV2(String userName, String availableBalance, String yearlyLimit, String rewardPoint, String bankName, String walletNo, HomeNotificationViewDTO homeNotificationViewDTO, boolean shouldShowTermsAndCondition, String referralCode, String notificationCount) {
this.userName = userName;
this.availableBalance = availableBalance;
this.yearlyLimit=yearlyLimit;
this.yearlyLimit = yearlyLimit;
this.rewardPoint = rewardPoint;
this.homeNotificationViewDTO =homeNotificationViewDTO;
this.bankName=bankName;
this.walletNo=walletNo;
this.shouldShowTermsAndCondition=shouldShowTermsAndCondition;
this.referralCode=referralCode;
this.homeNotificationViewDTO = homeNotificationViewDTO;
this.bankName = bankName;
this.walletNo = walletNo;
this.shouldShowTermsAndCondition = shouldShowTermsAndCondition;
this.referralCode = referralCode;
this.notificationCount = notificationCount;
}
public String getUserName() {
return userName;
}
@ -47,7 +49,6 @@ public class HomeViewRelatedDTOV2 {
}
public HomeNotificationViewDTO getHomeNotificationViewDTO() {
return homeNotificationViewDTO;
}
@ -71,4 +72,8 @@ public class HomeViewRelatedDTOV2 {
public String getReferralCode() {
return referralCode;
}
public String getNotificationCount() {
return notificationCount;
}
}

2
app/src/main/java/com/remit/jmecustomer/features/home/presenter/HomeV2PresenterInterface.java

@ -41,6 +41,7 @@ public interface HomeV2PresenterInterface extends BasePresenterInterface {
void setNewToken(String newToken);
void showChangedNotification(String noticeCount);
LiveData<HomeViewRelatedDTOV2> subscribeToHomeRelatedDataEvent();
@ -75,6 +76,7 @@ public interface HomeV2PresenterInterface extends BasePresenterInterface {
void showFingerprintAvailablityToUser();
void showChangedNotification(String noticeCount);
}
}

7
app/src/main/java/com/remit/jmecustomer/features/home/presenter/HomeViewModel.java

@ -121,6 +121,10 @@ public class HomeViewModel extends BaseViewModel implements HomeV2PresenterInter
}
}
@Override
public void showChangedNotification(String noticeCount) {
view.showChangedNotification(noticeCount);
}
@Override
public void postEmailCodeToVerify(String OTP) {
@ -303,7 +307,8 @@ public class HomeViewModel extends BaseViewModel implements HomeV2PresenterInter
userInfoModelV2.getWalletNumber(),
notificationViewDTO,
shouldShowTermsAndCondition,
userInfoModelV2.getReferralCode()
userInfoModelV2.getReferralCode(),
userInfoModelV2.getNotificationCount()
));
//If no notification is generated then we can show privileged Operation View

15
app/src/main/java/com/remit/jmecustomer/features/home/view/HomeActivityV2.java

@ -130,8 +130,10 @@ public class HomeActivityV2 extends BaseActivity implements HomeParentViewContra
ImageView iv_close;
@BindView(R.id.content_view)
ViewGroup content_view;
@BindView(R.id.notificationCountTxtView)
TextView notificationCountTxtView;
private Fragment currentFragment;
private FragmentManager manager;
// private HomeV2PresenterInterface presenter;
@ -164,11 +166,6 @@ public class HomeActivityV2 extends BaseActivity implements HomeParentViewContra
RemitApplication.getStorage().edit().putString(PrefKeys.USER_FCM_ID, token);
}
});
String noticeCount = RemitApplication.getStorage().getString(PrefKeys.NOTIFICATION_COUNT, "");
if (!noticeCount.isEmpty()) {
notificationCountTxtView.setText(RemitApplication.getStorage().getString(PrefKeys.NOTIFICATION_COUNT, ""));
notificationCountTxtView.setVisibility(View.VISIBLE);
}
}
private void performDefaultAction(Bundle savedInstanceState) {
@ -702,5 +699,13 @@ public class HomeActivityV2 extends BaseActivity implements HomeParentViewContra
showExitConfirmationDialog();
}
}
@Override
public void showChangedNotification(String noticeCount) {
if (!noticeCount.isEmpty()) {
notificationCountTxtView.setText(RemitApplication.getStorage().getString(PrefKeys.NOTIFICATION_COUNT, ""));
notificationCountTxtView.setVisibility(View.VISIBLE);
}
}
}

5
app/src/main/java/com/remit/jmecustomer/features/home/view/HomeFragmentV2.java

@ -22,6 +22,8 @@ import androidx.transition.Transition;
import androidx.transition.TransitionListenerAdapter;
import androidx.transition.TransitionManager;
import com.remit.jmecustomer.RemitApplication;
import com.remit.jmecustomer.base.PrefKeys;
import com.remit.jmecustomer.features.home.adapters.HomeMenuRvAdapterV2;
import com.remit.jmecustomer.features.home.model.HomeNotificationViewDTO;
import com.remit.jmecustomer.features.home.model.HomeViewRelatedDTOV2;
@ -234,6 +236,7 @@ public class HomeFragmentV2 extends BaseFragment implements
tv_namelabel.setText(homeViewRelatedDTOV2.getUserName());
tv_yearly_remaining.setText(homeViewRelatedDTOV2.getAvailableBalance());
tv_wallet_no.setText(homeViewRelatedDTOV2.getReferralCode());
homeViewModel.showChangedNotification(homeViewRelatedDTOV2.getNotificationCount());
}
@ -269,7 +272,7 @@ public class HomeFragmentV2 extends BaseFragment implements
}
private void showPennyTestView() {
KYCV3Activity.startActivity(getActivity(), true, "", "",false);
KYCV3Activity.startActivity(getActivity(), true, "", "", false);
}

17
app/src/main/java/com/remit/jmecustomer/features/mynotifications/presenter/MyNotificationViewModel.java

@ -147,7 +147,7 @@ public class MyNotificationViewModel extends BaseViewModel implements MyNotifica
@Override
protected void onSuccess(GenericResponseDataModel<List<MyNotificationDTO>> t) {
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
//sortNoticeList(gateway.mockNoticeList());
// sortNoticeList(gateway.mockNoticeList());
if (t.getData() != null && t.getData().size() > 0) {
view.lazyInitViews();
sortNoticeList(t.getData());
@ -246,15 +246,18 @@ public class MyNotificationViewModel extends BaseViewModel implements MyNotifica
}
}
public class UpdateNoticeObserver extends GenericApiObserverResponseV2<List<MyNotificationDTO>> {
@Override
protected Type getDataType() {
return TypeToken.getParameterized(UpdateNoticeObserver.class).getType();
}
public class UpdateNoticeObserver extends GenericApiObserverResponseV2<MyNotificationDTO> {
@Override
protected void onSuccess(GenericResponseDataModel<List<MyNotificationDTO>> t) {
protected void onSuccess(GenericResponseDataModel<MyNotificationDTO> t) {
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
List<MyNotificationDTO> list = noticeListLiveData.getValue();
for (int i = 0; i < list.size(); i++) {
if (list.get(i).getRowId().equals(selectedNotice.getRowId())) {
list.get(i).setIsRead("1");
}
}
noticeListLiveData.setValue(list);
//noticeListLiveData.setValue(t.);
} else {
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, null);

4
app/src/main/java/com/remit/jmecustomer/features/mynotifications/view/MyNotificationListingFragment.java

@ -73,11 +73,11 @@ public class MyNotificationListingFragment extends BaseFragment implements MyNot
}
private void handleNoticeClicked(MyNotificationDTO itemModel) {
if (itemModel.getIsClickable() != null && itemModel.getIsClickable().equals("Y")) {
new ViewModelProvider(getActivity()).get(MyNotificationViewModel.class).updateNotification(itemModel.getRowId());
if (itemModel.getIsClickable() != null && itemModel.getIsClickable().equals("Y") && !itemModel.getUrl().isEmpty()) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(itemModel.getUrl()));
startActivity(browserIntent);
}
new ViewModelProvider(getActivity()).get(MyNotificationViewModel.class).updateNotification(itemModel.getRowId());
// if (itemModel.getType().equals("0")) {
// new ViewModelProvider(getActivity()).get(MyNotificationViewModel.class).fetchNoticeDetail(itemModel);
// } else if (itemModel.getType().equals("1")) {

Loading…
Cancel
Save