Browse Source

Merge branch 'MYNotification' into UIChanges

new_design
Mukesh Dhungana 2 years ago
parent
commit
07000ea9b2
  1. 7
      app/build.gradle
  2. 5
      app/src/main/AndroidManifest.xml
  3. 15
      app/src/main/java/com/remit/jmecustomer/features/home/view/HomeActivityV2.java
  4. 27
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/MyNotificationViewModelFactory.java
  5. 83
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/adapter/MyNotificationListingRVAdapter.java
  6. 33
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/adapter/MyNotificationListingRVViewholder.java
  7. 159
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/gateway/MyNotificationGateway.java
  8. 140
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/model/MyNotificationDTO.java
  9. 53
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/model/MyNotificationDetailDTO.java
  10. 30
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/presenter/MyNotificationGatewayInterface.java
  11. 43
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/presenter/MyNotificationPresenterInterface.java
  12. 282
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/presenter/MyNotificationViewModel.java
  13. 127
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/view/MyNotificationActivity.java
  14. 107
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/view/MyNotificationFragment.java
  15. 101
      app/src/main/java/com/remit/jmecustomer/features/mynotifications/view/MyNotificationListingFragment.java
  16. 2
      app/src/main/java/com/remit/jmecustomer/utils/https/API_URL.java
  17. 8
      app/src/main/java/com/remit/jmecustomer/utils/https/ApiEndpoints.java
  18. BIN
      app/src/main/res/drawable-xxhdpi/notify_error_color.png
  19. BIN
      app/src/main/res/drawable-xxhdpi/notify_error_grey.png
  20. BIN
      app/src/main/res/drawable-xxhdpi/notify_info_color.png
  21. BIN
      app/src/main/res/drawable-xxhdpi/notify_info_grey.png
  22. BIN
      app/src/main/res/drawable-xxhdpi/notify_success_color.png
  23. BIN
      app/src/main/res/drawable-xxhdpi/notify_success_grey.png
  24. 120
      app/src/main/res/layout/activity_home_v2.xml
  25. 13
      app/src/main/res/layout/activity_my_notifications.xml
  26. 102
      app/src/main/res/layout/fragment_my_notice_detail.xml
  27. 15
      app/src/main/res/layout/fragment_my_notice_listing.xml
  28. 12
      app/src/main/res/layout/fragment_notice_listing.xml
  29. 3
      app/src/main/res/layout/layout_sendmoney_toolbar.xml
  30. 100
      app/src/main/res/layout/my_notice_list_viewholder.xml
  31. 29
      app/src/main/res/layout/nav_drawer_fragment.xml
  32. 4
      app/src/main/res/values/strings.xml

7
app/build.gradle

@ -125,13 +125,6 @@ android {
enableSplit = false
}
}
sourceSets {
main {
java {
srcDirs 'src\\main\\java', 'src\\main\\java\\com.remit.jmecustomer.features'
}
}
}
}

5
app/src/main/AndroidManifest.xml

@ -293,6 +293,11 @@
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="com.remit.jmecustomer.features.mynotifications.view.MyNotificationActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden" />
<service
android:name="com.remit.jmecustomer.services.JMEFcmMessagingService"

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

@ -46,6 +46,7 @@ import com.remit.jmecustomer.features.home.gateway.HomeV2Gateway;
import com.remit.jmecustomer.features.home.presenter.HomeV2PresenterInterface;
import com.remit.jmecustomer.features.home.presenter.HomeViewModel;
import com.remit.jmecustomer.features.home.view.notifications.DimBackgroundView;
import com.remit.jmecustomer.features.mynotifications.view.MyNotificationActivity;
import com.remit.jmecustomer.features.notice.view.NoticeActivity;
import com.remit.jmecustomer.features.recipientlisting.view.recipientlisting.RecipientListingActivity;
import com.remit.jmecustomer.features.recipientmanagement.view.recipientlistingV3.RecipientListingV3Activity;
@ -90,6 +91,8 @@ public class HomeActivityV2 extends BaseActivity implements HomeParentViewContra
NavigationView nav_drawer;
@BindView(R.id.iv_help)
ImageView iv_help;
@BindView(R.id.iv_notification)
ImageView iv_notification;
@BindView(R.id.iv_nav)
ImageView iv_nav;
@BindView(R.id.drawer_home)
@ -127,8 +130,8 @@ public class HomeActivityV2 extends BaseActivity implements HomeParentViewContra
ImageView iv_close;
@BindView(R.id.content_view)
ViewGroup content_view;
@BindView(R.id.notificationCounterTxtView)
TextView notificationCounterTxtView;
@BindView(R.id.notificationCountTxtView)
TextView notificationCountTxtView;
private Fragment currentFragment;
private FragmentManager manager;
// private HomeV2PresenterInterface presenter;
@ -161,7 +164,11 @@ 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) {
@ -272,6 +279,8 @@ public class HomeActivityV2 extends BaseActivity implements HomeParentViewContra
break;
case R.id.view_account_statement:
startActivity(new Intent(this, WalletStatementV2Activity.class));
case R.id.iv_notification:
startActivity(new Intent(this, MyNotificationActivity.class));
break;
// case R.id.view_lawson_card_deposit: {
// WebRequestModel requestModel = new WebRequestModel(getStringfromStringId(R.string.lawson_card_deposit_text), LAWSON_CASH_DEPOSIT_URL, null);

27
app/src/main/java/com/remit/jmecustomer/features/mynotifications/MyNotificationViewModelFactory.java

@ -0,0 +1,27 @@
package com.remit.jmecustomer.features.mynotifications;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import com.remit.jmecustomer.features.mynotifications.gateway.MyNotificationGateway;
import com.remit.jmecustomer.features.mynotifications.presenter.MyNotificationPresenterInterface;
import com.remit.jmecustomer.features.mynotifications.presenter.MyNotificationViewModel;
public class MyNotificationViewModelFactory implements ViewModelProvider.Factory {
private final MyNotificationPresenterInterface.NoticeViewContractInterface view;
public MyNotificationViewModelFactory(MyNotificationPresenterInterface.NoticeViewContractInterface view) {
this.view = view;
}
@SuppressWarnings("unchecked")
@NonNull
@Override
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
return (T) new MyNotificationViewModel(view,new MyNotificationGateway());
}
}

83
app/src/main/java/com/remit/jmecustomer/features/mynotifications/adapter/MyNotificationListingRVAdapter.java

@ -0,0 +1,83 @@
package com.remit.jmecustomer.features.mynotifications.adapter;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.remit.jmecustomer.R;
import com.remit.jmecustomer.features.mynotifications.model.MyNotificationDTO;
import java.util.ArrayList;
import java.util.List;
public class MyNotificationListingRVAdapter extends RecyclerView.Adapter<MyNotificationListingRVViewholder> {
private final NoticeClickListener listener;
private List<MyNotificationDTO> noticeList;
public MyNotificationListingRVAdapter(NoticeClickListener listener) {
this.listener = listener;
noticeList = new ArrayList<>();
}
@NonNull
@Override
public MyNotificationListingRVViewholder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new MyNotificationListingRVViewholder(LayoutInflater.from(parent.getContext()).inflate(R.layout.my_notice_list_viewholder, parent, false));
}
@Override
public void onBindViewHolder(@NonNull MyNotificationListingRVViewholder holder, int position) {
MyNotificationDTO myNotificationDTO = noticeList.get(holder.getAdapterPosition());
holder.notice_title.setText(myNotificationDTO.getTitle());
holder.notice_body.setText(myNotificationDTO.getBody());
holder.notice_date.setText(myNotificationDTO.getCreateDate());
if (myNotificationDTO.getIsRead() != null && "1".equalsIgnoreCase(myNotificationDTO.getIsRead())) {
if (myNotificationDTO.getCategory() != null && myNotificationDTO.getCategory().equalsIgnoreCase("success"))
holder.imgNotificationStat.setBackgroundResource(R.drawable.notify_success_grey);
else if (myNotificationDTO.getCategory() != null && myNotificationDTO.getCategory().equalsIgnoreCase("info"))
holder.imgNotificationStat.setBackgroundResource(R.drawable.notify_info_grey);
else if (myNotificationDTO.getCategory() != null && myNotificationDTO.getCategory().equalsIgnoreCase("error"))
holder.imgNotificationStat.setBackgroundResource(R.drawable.notify_error_grey);
} else {
if (myNotificationDTO.getCategory() != null && myNotificationDTO.getCategory().equalsIgnoreCase("success"))
holder.imgNotificationStat.setBackgroundResource(R.drawable.notify_success_color);
else if (myNotificationDTO.getCategory() != null && myNotificationDTO.getCategory().equalsIgnoreCase("info"))
holder.imgNotificationStat.setBackgroundResource(R.drawable.notify_info_color);
else if (myNotificationDTO.getCategory() != null && myNotificationDTO.getCategory().equalsIgnoreCase("error"))
holder.imgNotificationStat.setBackgroundResource(R.drawable.notify_error_color);
}
holder.itemView.setOnClickListener(view -> {
if (listener != null)
listener.onNoticeClicked(noticeList.get(holder.getAdapterPosition()));
});
}
@Override
public int getItemCount() {
return noticeList.size();
}
public void setData(List<MyNotificationDTO> data) {
if (data != null && data.size() > 0) {
this.noticeList.clear();
this.noticeList.addAll(data);
notifyDataSetChanged();
}
}
public void resetData() {
this.noticeList = null;
notifyDataSetChanged();
}
public interface NoticeClickListener {
void onNoticeClicked(MyNotificationDTO itemModel);
}
}

33
app/src/main/java/com/remit/jmecustomer/features/mynotifications/adapter/MyNotificationListingRVViewholder.java

@ -0,0 +1,33 @@
package com.remit.jmecustomer.features.mynotifications.adapter;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.remit.jmecustomer.R;
import butterknife.BindView;
import butterknife.ButterKnife;
public class MyNotificationListingRVViewholder extends RecyclerView.ViewHolder {
@BindView(R.id.tv_notification_title)
TextView notice_title;
@BindView(R.id.tv_notification_body)
TextView notice_body;
@BindView(R.id.tv_notification_date)
TextView notice_date;
@BindView(R.id.imgNotificationStat)
ImageView imgNotificationStat;
public MyNotificationListingRVViewholder(@NonNull View itemView) {
super(itemView);
ButterKnife.bind(this,itemView);
}
}

159
app/src/main/java/com/remit/jmecustomer/features/mynotifications/gateway/MyNotificationGateway.java

@ -0,0 +1,159 @@
package com.remit.jmecustomer.features.mynotifications.gateway;
import com.google.gson.JsonObject;
import com.remit.jmecustomer.base.PrivilegedGateway;
import com.remit.jmecustomer.features.mynotifications.model.MyNotificationDTO;
import com.remit.jmecustomer.features.mynotifications.model.MyNotificationDetailDTO;
import com.remit.jmecustomer.features.mynotifications.presenter.MyNotificationGatewayInterface;
import com.remit.jmecustomer.utils.https.HttpClientV2;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.Observable;
import okhttp3.ResponseBody;
public class MyNotificationGateway extends PrivilegedGateway implements MyNotificationGatewayInterface {
@Override
public Observable<ResponseBody> getNoticeList(String auth, String customerID) {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("customerId", customerID);
return HttpClientV2.getInstance().getMYNoticeList(auth, customerID);
}
@Override
public Observable<ResponseBody> getNoticeDetail(String auth, String noticeId) {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("rowId", noticeId);
return HttpClientV2.getInstance().getNoticeDetail(auth, jsonObject);
}
@Override
public Observable<ResponseBody> updateNotice(String auth, String noticeId) {
return HttpClientV2.getInstance().updateMyNotice(auth, noticeId);
}
@Override
public Observable<ResponseBody> setNoticeStatus(String auth, String tranId, String yesNo) {
return HttpClientV2.getInstance().setNoticeReadStatus(auth, tranId, yesNo);
}
@Override
public List<MyNotificationDTO> mockNoticeList() {
List<MyNotificationDTO> noticeList = new ArrayList<>();
MyNotificationDTO myNotificationDTO0 = new MyNotificationDTO();
myNotificationDTO0.setRowId("0");
myNotificationDTO0.setTitle("Title 1");
myNotificationDTO0.setBody("Deposit Slip of amount 10 JPY has been uploaded.");
myNotificationDTO0.setCreateDate("2077/01/01");
myNotificationDTO0.setIsRead("0");
myNotificationDTO0.setType("1");
myNotificationDTO0.setExtra("12");
myNotificationDTO0.setCategory("success");
myNotificationDTO0.setIsClickable("Y");
myNotificationDTO0.setUrl("https://japanremit.com/document/deposit/lawson/HowToUse.html");
noticeList.add(myNotificationDTO0);
MyNotificationDTO myNotificationDTO1 = new MyNotificationDTO();
myNotificationDTO1.setRowId("1");
myNotificationDTO1.setTitle("Title 2");
myNotificationDTO1.setBody("Deposit Slip of amount 10 JPY has been uploaded.");
myNotificationDTO1.setCreateDate("2077/01/02");
myNotificationDTO1.setIsRead("1");
myNotificationDTO1.setType("0");
myNotificationDTO1.setCategory("success");
noticeList.add(myNotificationDTO1);
MyNotificationDTO myNotificationDTO2 = new MyNotificationDTO();
myNotificationDTO2.setRowId("2");
myNotificationDTO2.setTitle("Title 3");
myNotificationDTO2.setBody("Deposit Slip of amount 10 JPY has been uploaded.");
myNotificationDTO2.setCreateDate("2077/01/02");
myNotificationDTO2.setIsRead("0");
myNotificationDTO2.setType("1");
myNotificationDTO2.setExtra("13");
myNotificationDTO2.setCategory("error");
noticeList.add(myNotificationDTO2);
MyNotificationDTO myNotificationDTO3 = new MyNotificationDTO();
myNotificationDTO3.setRowId("3");
myNotificationDTO3.setTitle("Title 4");
myNotificationDTO3.setBody("Deposit Slip of amount 10 JPY has been uploaded.");
myNotificationDTO3.setCreateDate("2077/01/03");
myNotificationDTO3.setIsRead("1");
myNotificationDTO3.setType("1");
myNotificationDTO3.setExtra("14");
myNotificationDTO3.setCategory("error");
noticeList.add(myNotificationDTO3);
MyNotificationDTO myNotificationDTO4 = new MyNotificationDTO();
myNotificationDTO4.setRowId("4");
myNotificationDTO4.setTitle("Title 5");
myNotificationDTO4.setBody("Deposit Slip of amount 10 JPY has been uploaded.");
myNotificationDTO4.setCreateDate("2077/01/04");
myNotificationDTO4.setIsRead("1");
myNotificationDTO4.setType("0");
myNotificationDTO4.setCategory("info");
noticeList.add(myNotificationDTO4);
MyNotificationDTO myNotificationDTO5 = new MyNotificationDTO();
myNotificationDTO5.setRowId("4");
myNotificationDTO5.setTitle("Title 5");
myNotificationDTO5.setBody("Deposit Slip of amount 10 JPY has been uploaded.");
myNotificationDTO5.setCreateDate("2077/01/04");
myNotificationDTO5.setIsRead("1");
myNotificationDTO5.setType("0");
myNotificationDTO5.setCategory("info");
noticeList.add(myNotificationDTO5);
MyNotificationDTO myNotificationDTO6 = new MyNotificationDTO();
myNotificationDTO6.setRowId("4");
myNotificationDTO6.setTitle("Title 5");
myNotificationDTO6.setBody("Deposit Slip of amount 10 JPY has been uploaded.");
myNotificationDTO6.setCreateDate("2077/01/04");
myNotificationDTO6.setIsRead("1");
myNotificationDTO6.setType("0");
myNotificationDTO6.setCategory("info");
noticeList.add(myNotificationDTO6);
MyNotificationDTO myNotificationDTO7 = new MyNotificationDTO();
myNotificationDTO7.setRowId("4");
myNotificationDTO7.setTitle("Title 5");
myNotificationDTO7.setBody("Deposit Slip of amount 10 JPY has been uploaded.");
myNotificationDTO7.setCreateDate("2077/01/04");
myNotificationDTO7.setIsRead("1");
myNotificationDTO7.setType("0");
myNotificationDTO7.setCategory("info");
noticeList.add(myNotificationDTO7);
MyNotificationDTO myNotificationDTO8 = new MyNotificationDTO();
myNotificationDTO8.setRowId("4");
myNotificationDTO8.setTitle("Title 5");
myNotificationDTO8.setBody("Deposit Slip of amount 10 JPY has been uploaded.");
myNotificationDTO8.setCreateDate("2077/01/04");
myNotificationDTO8.setIsRead("1");
myNotificationDTO8.setType("0");
myNotificationDTO8.setCategory("info");
noticeList.add(myNotificationDTO8);
return noticeList;
}
@Override
public MyNotificationDetailDTO mockNoticeDetail() {
MyNotificationDetailDTO myNotificationDetailDTO = new MyNotificationDetailDTO();
myNotificationDetailDTO.setTitle("Title 1");
myNotificationDetailDTO.setBody("This is Detail body of Title 1");
myNotificationDetailDTO.setCreateDate("2077/01/01");
myNotificationDetailDTO.setImageURL("https://p18cdn4static.sharpschool.com/UserFiles/Servers/Server_414551/Image/News/District%20News/Title%201.jpg");
return myNotificationDetailDTO;
}
}

140
app/src/main/java/com/remit/jmecustomer/features/mynotifications/model/MyNotificationDTO.java

@ -0,0 +1,140 @@
package com.remit.jmecustomer.features.mynotifications.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class MyNotificationDTO {
@SerializedName("rowId")
@Expose
private String rowId;
@SerializedName("customerId")
@Expose
private String customerId;
@SerializedName("title")
@Expose
private String title;
@SerializedName("body")
@Expose
private String body;
@SerializedName("createDate")
@Expose
private String createDate;
@SerializedName("isRead")// 0 => Not Read, 1=> Read,
@Expose
private String isRead;
@SerializedName("type")//0 => General Notice, 1=> Txn Notice
@Expose
private String type;
@SerializedName("extra")//If type==1, then extra will have Txn id
@Expose
private String extra;
@SerializedName("category")
@Expose
private String category;
@SerializedName("url")
@Expose
private String url;
@SerializedName("isClickable")
@Expose
private String isClickable;
public String getRowId() {
return rowId;
}
public void setRowId(String rowId) {
this.rowId = rowId;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String rowId) {
this.rowId = rowId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
public String getIsRead() {
return isRead;
}
public void setIsRead(String isRead) {
this.isRead = isRead;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getExtra() {
return extra;
}
public void setExtra(String extra) {
this.extra = extra;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getIsClickable() {
return isClickable;
}
public void setIsClickable(String isClickable) {
this.isClickable = isClickable;
}
}

53
app/src/main/java/com/remit/jmecustomer/features/mynotifications/model/MyNotificationDetailDTO.java

@ -0,0 +1,53 @@
package com.remit.jmecustomer.features.mynotifications.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class MyNotificationDetailDTO {
@SerializedName("title")
@Expose
private String title;
@SerializedName("body")
@Expose
private String body;
@SerializedName("createDate")
@Expose
private String createDate;
@SerializedName("imageURL")
@Expose
private String imageURL;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
public String getImageURL() {
return imageURL;
}
public void setImageURL(String imageURL) {
this.imageURL = imageURL;
}
}

30
app/src/main/java/com/remit/jmecustomer/features/mynotifications/presenter/MyNotificationGatewayInterface.java

@ -0,0 +1,30 @@
package com.remit.jmecustomer.features.mynotifications.presenter;
import com.remit.jmecustomer.base.PrivilegedGatewayInterface;
import com.remit.jmecustomer.features.mynotifications.model.MyNotificationDTO;
import com.remit.jmecustomer.features.mynotifications.model.MyNotificationDetailDTO;
import java.util.List;
import io.reactivex.Observable;
import okhttp3.ResponseBody;
public interface MyNotificationGatewayInterface extends PrivilegedGatewayInterface {
Observable<ResponseBody> getNoticeList(String auth, String customerID);
Observable<ResponseBody> getNoticeDetail(String auth, String noticeId);
Observable<ResponseBody> updateNotice(String auth, String noticeId);
Observable<ResponseBody> setNoticeStatus(String auth,String tranId,String noticeStat);
List<MyNotificationDTO> mockNoticeList();
MyNotificationDetailDTO mockNoticeDetail();
}

43
app/src/main/java/com/remit/jmecustomer/features/mynotifications/presenter/MyNotificationPresenterInterface.java

@ -0,0 +1,43 @@
package com.remit.jmecustomer.features.mynotifications.presenter;
import androidx.lifecycle.LiveData;
import com.remit.jmecustomer.base.BaseContractInterface;
import com.remit.jmecustomer.base.BasePresenterInterface;
import com.remit.jmecustomer.features.mynotifications.model.MyNotificationDTO;
import com.remit.jmecustomer.features.mynotifications.model.MyNotificationDetailDTO;
import java.util.List;
public interface MyNotificationPresenterInterface extends BasePresenterInterface {
void fetchNoticeListLiveData();
void fetchNoticeDetail(MyNotificationDTO selectedNotice);
LiveData<List<MyNotificationDTO>> getNoticeListLiveData();
LiveData<MyNotificationDetailDTO> getNoticeDetailLiveData();
void changeNoticeStat();
MyNotificationDTO getSelectedNotice();
void setSelectedNotice(MyNotificationDTO noticeState);
void updateNotification(String rowId);
interface NoticeViewContractInterface extends BaseContractInterface {
void lazyInitViews();
void showDetailScreen();
NoticeListContractInterface getNoticeListContract();
interface NoticeListContractInterface extends BaseContractInterface {
void showTranSendComplete();
}
}
}

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

@ -0,0 +1,282 @@
package com.remit.jmecustomer.features.mynotifications.presenter;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.google.gson.reflect.TypeToken;
import com.remit.jmecustomer.R;
import com.remit.jmecustomer.base.BaseViewModel;
import com.remit.jmecustomer.common.customwidgets.CustomAlertDialog;
import com.remit.jmecustomer.features.exrate.model.datav2.GenericApiResponseModel;
import com.remit.jmecustomer.features.mynotifications.model.MyNotificationDTO;
import com.remit.jmecustomer.features.mynotifications.model.MyNotificationDetailDTO;
import com.remit.jmecustomer.features.sendmoney.model.SendMoneyTransactionCompleteV2ResponseBody;
import com.remit.jmecustomer.utils.Constants;
import com.remit.jmecustomer.utils.https.GenericApiObserverResponseV2;
import com.remit.jmecustomer.utils.https.GenericResponseDataModel;
import java.lang.reflect.Type;
import java.util.Collections;
import java.util.List;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers;
public class MyNotificationViewModel extends BaseViewModel implements MyNotificationPresenterInterface {
private final NoticeViewContractInterface view;
private final MyNotificationGatewayInterface gateway;
private final CompositeDisposable compositeDisposable;
MutableLiveData<List<MyNotificationDTO>> noticeListLiveData;
MutableLiveData<MyNotificationDetailDTO> noticeDetailLiveData;
private MyNotificationDTO selectedNotice;
public MyNotificationViewModel(NoticeViewContractInterface view, MyNotificationGatewayInterface gatewayInterface) {
this.view = view;
this.gateway = gatewayInterface;
noticeListLiveData = new MutableLiveData<>();
noticeDetailLiveData = new MutableLiveData<>();
this.compositeDisposable = new CompositeDisposable();
}
@Override
public void onViewReady() {
}
@Override
public void onViewNotReady() {
}
@Override
public void fetchNoticeListLiveData() {
this.compositeDisposable.add(
this.gateway.getNoticeList(gateway.getAuth(), gateway.getUserIDNumber())
.doOnSubscribe(subs -> view.showProgressBar(true, ""))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> view.showProgressBar(false, ""))
.subscribeWith(new NoticeListObserver())
);
}
@Override
public void fetchNoticeDetail(MyNotificationDTO selectedNotice) {
this.compositeDisposable.add(
this.gateway.getNoticeDetail(gateway.getAuth(), selectedNotice.getRowId())
.doOnSubscribe(subs -> view.showProgressBar(true, ""))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> view.showProgressBar(false, ""))
.subscribeWith(new NoticeDetailObserver())
);
}
@Override
public void updateNotification(String rowId) {
this.compositeDisposable.add(
this.gateway.updateNotice(gateway.getAuth(), selectedNotice.getRowId())
.doOnSubscribe(subs -> view.showProgressBar(true, ""))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> view.showProgressBar(false, ""))
.subscribeWith(new UpdateNoticeObserver())
);
}
@Override
public LiveData<List<MyNotificationDTO>> getNoticeListLiveData() {
return noticeListLiveData;
}
@Override
public LiveData<MyNotificationDetailDTO> getNoticeDetailLiveData() {
return noticeDetailLiveData;
}
@Override
public void changeNoticeStat() {
this.compositeDisposable.add(
this.gateway.setNoticeStatus(gateway.getAuth(), selectedNotice.getExtra(), "Y")
.doOnSubscribe(subs -> view.showProgressBar(true, ""))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> view.showProgressBar(false, ""))
.subscribeWith(new NoticeStatUpdateObserver())
);
}
@Override
public MyNotificationDTO getSelectedNotice() {
return selectedNotice;
}
@Override
public void setSelectedNotice(MyNotificationDTO noticeState) {
this.selectedNotice = noticeState;
}
private void sortNoticeList(List<MyNotificationDTO> data) {
// DateFormat df = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a");
// Collections.sort(data, (o1, o2) -> {
// try {
// return df.parse(o1.getCreateDate()).compareTo(df.parse(o2.getCreateDate()));
// } catch (Exception pe) {
// Collections.reverse(data);
// }
// return 0;
// });
// if (data != null)
// Collections.reverse(data);
noticeListLiveData.setValue(data);
}
public class NoticeListObserver extends GenericApiObserverResponseV2<List<MyNotificationDTO>> {
@Override
protected Type getDataType() {
return TypeToken.getParameterized(List.class, MyNotificationDTO.class).getType();
}
@Override
protected void onSuccess(GenericResponseDataModel<List<MyNotificationDTO>> t) {
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
//sortNoticeList(gateway.mockNoticeList());
if (t.getData() != null && t.getData().size() > 0) {
view.lazyInitViews();
sortNoticeList(t.getData());
} else
view.showPopUpMessage(view.getContext().getResources().getString(R.string.donot_have_notification_text), CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView());
} else {
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView());
}
}
@Override
public void onFailed(String message) {
// view.lazyInitViews();
// sortNoticeList(gateway.mockNoticeList());
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView());
}
@Override
protected void onConnectionNotEstablished(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> view.exitView());
}
@Override
protected void unauthorizedAccess(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> view.logout());
}
}
public class NoticeDetailObserver extends GenericApiObserverResponseV2<MyNotificationDetailDTO> {
@Override
protected Type getDataType() {
return TypeToken.getParameterized(MyNotificationDetailDTO.class).getType();
}
@Override
protected void onSuccess(GenericResponseDataModel<MyNotificationDetailDTO> t) {
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
noticeDetailLiveData.setValue(t.getData());
view.showDetailScreen();
} else {
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, null);
}
}
@Override
public void onFailed(String message) {
// noticeDetailLiveData.setValue(gateway.mockNoticeDetail());
// view.showDetailScreen();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null);
}
@Override
protected void onConnectionNotEstablished(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null);
}
@Override
protected void unauthorizedAccess(String message) {
gateway.clearAllUserData();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> view.logout());
}
}
public class NoticeStatUpdateObserver extends GenericApiObserverResponseV2<SendMoneyTransactionCompleteV2ResponseBody> {
@Override
protected Type getDataType() {
return TypeToken.getParameterized(MyNotificationDetailDTO.class).getType();
}
@Override
protected void onSuccess(GenericResponseDataModel<SendMoneyTransactionCompleteV2ResponseBody> t) {
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
view.getNoticeListContract().showTranSendComplete();
} else {
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, null);
}
}
@Override
public void onFailed(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null);
}
@Override
protected void onConnectionNotEstablished(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null);
}
@Override
protected void unauthorizedAccess(String message) {
gateway.clearAllUserData();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> view.logout());
}
}
public class UpdateNoticeObserver extends GenericApiObserverResponseV2<List<MyNotificationDTO>> {
@Override
protected Type getDataType() {
return TypeToken.getParameterized(UpdateNoticeObserver.class).getType();
}
@Override
protected void onSuccess(GenericResponseDataModel<List<MyNotificationDTO>> t) {
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
//noticeListLiveData.setValue(t.);
} else {
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, null);
}
}
@Override
public void onFailed(String message) {
// noticeDetailLiveData.setValue(gateway.mockNoticeDetail());
// view.showDetailScreen();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null);
}
@Override
protected void onConnectionNotEstablished(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null);
}
@Override
protected void unauthorizedAccess(String message) {
gateway.clearAllUserData();
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, alertType -> view.logout());
}
}
}

127
app/src/main/java/com/remit/jmecustomer/features/mynotifications/view/MyNotificationActivity.java

@ -0,0 +1,127 @@
package com.remit.jmecustomer.features.mynotifications.view;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.viewpager.widget.ViewPager;
import com.remit.jmecustomer.R;
import com.remit.jmecustomer.base.BaseActivity;
import com.remit.jmecustomer.common.customwidgets.GenericViewPagerAdapter;
import com.remit.jmecustomer.features.home.view.HomeActivityV2;
import com.remit.jmecustomer.features.mynotifications.MyNotificationViewModelFactory;
import com.remit.jmecustomer.features.mynotifications.presenter.MyNotificationPresenterInterface;
import com.remit.jmecustomer.features.mynotifications.presenter.MyNotificationViewModel;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class MyNotificationActivity extends BaseActivity implements MyNotificationPresenterInterface.NoticeViewContractInterface, ViewPager.OnPageChangeListener {
@BindView(R.id.myNoticeViewPager)
ViewPager myNoticeViewPager;
@BindView(R.id.toolbar_title)
TextView toolbar_title;
private GenericViewPagerAdapter noticeViewPagerAdapter;
private MyNotificationListingFragment noticeListingFragment;
private MyNotificationFragment noticeDetailFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_notifications);
ButterKnife.bind(this);
initialize();
}
private void initialize() {
toolbar_title.setText(getString(R.string.my_notification_text));
MyNotificationViewModelFactory noticeViewModelFactory = new MyNotificationViewModelFactory(this);
MyNotificationViewModel viewModel = new ViewModelProvider(this, noticeViewModelFactory).get(MyNotificationViewModel.class);
viewModel.fetchNoticeListLiveData();
setupViewPager();
}
private void setupViewPager() {
List<Fragment> fragments = new ArrayList<>();
noticeListingFragment = new MyNotificationListingFragment();
noticeDetailFragment = new MyNotificationFragment();
fragments.add(noticeListingFragment);
fragments.add(noticeDetailFragment);
noticeViewPagerAdapter = new GenericViewPagerAdapter(getSupportFragmentManager(),fragments);
myNoticeViewPager.setOffscreenPageLimit(2);
myNoticeViewPager.addOnPageChangeListener(this);
myNoticeViewPager.setAdapter(noticeViewPagerAdapter);
}
@OnClick(R.id.iv_back)
public void backButtonPressed() {
this.onBackPressed();
}
@Override
public void lazyInitViews() {
setupViewPager();
}
@Override
public void showDetailScreen() {
myNoticeViewPager.setCurrentItem(1);
}
@Override
public NoticeListContractInterface getNoticeListContract() {
return noticeListingFragment;
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
@Override
public void onBackPressed() {
if (myNoticeViewPager.getCurrentItem() == 0) {
Intent redirectIntent = new Intent(this, HomeActivityV2.class);
redirectIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
redirectIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(redirectIntent);
finish();
} else
myNoticeViewPager.setCurrentItem(myNoticeViewPager.getCurrentItem() - 1);
}
}

107
app/src/main/java/com/remit/jmecustomer/features/mynotifications/view/MyNotificationFragment.java

@ -0,0 +1,107 @@
package com.remit.jmecustomer.features.mynotifications.view;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.remit.jmecustomer.R;
import com.remit.jmecustomer.base.BaseFragment;
import com.remit.jmecustomer.features.mynotifications.model.MyNotificationDetailDTO;
import com.remit.jmecustomer.features.mynotifications.presenter.MyNotificationViewModel;
import butterknife.BindView;
import butterknife.ButterKnife;
public class MyNotificationFragment extends BaseFragment {
@BindView(R.id.tv_my_notification_date)
TextView noticeDate;
@BindView(R.id.tv_my_notification_title)
TextView noticeTitle;
@BindView(R.id.tv_my_notification_body)
TextView noticeBody;
@BindView(R.id.my_notice_image)
ImageView noticeImage;
@BindView(R.id.my_progressBar)
ProgressBar imageProgessBar;
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_my_notice_detail, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
init();
performDefaultAction(savedInstanceState);
}
private void init() {
}
private void performDefaultAction(Bundle savedInstance) {
MyNotificationViewModel myNotificationViewModel = new ViewModelProvider(getActivity()).get(MyNotificationViewModel.class);
myNotificationViewModel.getNoticeDetailLiveData().observe(getViewLifecycleOwner(),this::updateNoticeDEtail);
}
private void updateNoticeDEtail(MyNotificationDetailDTO noticeDetail)
{
String date=getActivity().getResources().getString(R.string.date_text)+": "+noticeDetail.getCreateDate();
noticeDate.setText(date);
noticeTitle.setText(noticeDetail.getTitle());
noticeBody.setText(noticeDetail.getBody());
if(noticeDetail.getImageURL()==null||noticeDetail.getImageURL().length()==0)
{
imageProgessBar.setVisibility(View.GONE);
noticeImage.setVisibility(View.GONE);
}
else
{
imageProgessBar.setVisibility(View.VISIBLE);
Glide.with(this)
.asBitmap()
.load(noticeDetail.getImageURL())
.into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
// imageProgessBar.setVisibility(View.GONE);
// noticeImage.setImageBitmap(resource);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
}
}
}

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

@ -0,0 +1,101 @@
package com.remit.jmecustomer.features.mynotifications.view;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.RecyclerView;
import com.remit.jmecustomer.R;
import com.remit.jmecustomer.base.BaseFragment;
import com.remit.jmecustomer.features.mynotifications.adapter.MyNotificationListingRVAdapter;
import com.remit.jmecustomer.features.mynotifications.model.MyNotificationDTO;
import com.remit.jmecustomer.features.mynotifications.presenter.MyNotificationPresenterInterface;
import com.remit.jmecustomer.features.mynotifications.presenter.MyNotificationViewModel;
import com.remit.jmecustomer.features.sendmoney.view.SendMoneyV2TransactionCompleteActivity;
import java.util.LinkedList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
public class MyNotificationListingFragment extends BaseFragment implements MyNotificationListingRVAdapter.NoticeClickListener, MyNotificationPresenterInterface.NoticeViewContractInterface.NoticeListContractInterface {
@BindView(R.id.myNoticeRv)
RecyclerView myNoticeRv;
MyNotificationListingRVAdapter myNotificationListingRVAdapter;
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_my_notice_listing, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
init();
performDefaultAction(savedInstanceState);
}
private void init() {
myNotificationListingRVAdapter = new MyNotificationListingRVAdapter(this);
myNoticeRv.setAdapter(myNotificationListingRVAdapter);
// noticeRv.addItemDecoration(new LineDividerItemDecoration(noticeRv.getContext(), LineDividerItemDecoration.VERTICAL_LIST));
}
private void performDefaultAction(Bundle savedInstance) {
MyNotificationViewModel myNotificationViewModel = new ViewModelProvider(getActivity()).get(MyNotificationViewModel.class);
;
myNotificationViewModel.getNoticeListLiveData().observe(getViewLifecycleOwner(), this::updateNoticeList);
}
private void updateNoticeList(List<MyNotificationDTO> noticeList) {
myNotificationListingRVAdapter.setData(noticeList);
}
@Override
public void onNoticeClicked(MyNotificationDTO itemModel) {
new ViewModelProvider(getActivity()).get(MyNotificationViewModel.class).setSelectedNotice(itemModel);
handleNoticeClicked(itemModel);
}
private void handleNoticeClicked(MyNotificationDTO itemModel) {
if (itemModel.getIsClickable() != null && itemModel.getIsClickable().equals("Y")) {
new ViewModelProvider(getActivity()).get(MyNotificationViewModel.class).updateNotification(itemModel.getRowId());
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(itemModel.getUrl()));
startActivity(browserIntent);
}
// if (itemModel.getType().equals("0")) {
// new ViewModelProvider(getActivity()).get(MyNotificationViewModel.class).fetchNoticeDetail(itemModel);
// } else if (itemModel.getType().equals("1")) {
// if(itemModel.getIsRead().equals("1")){
// showTranSendComplete();
// }else{
// new ViewModelProvider(getActivity()).get(MyNotificationViewModel.class).changeNoticeStat();
// }
//
// }
}
@Override
public void showTranSendComplete() {
MyNotificationDTO selectedNotice = new ViewModelProvider(getActivity()).get(MyNotificationViewModel.class).getSelectedNotice();
Intent startReceiptActivity = new Intent(getActivity(), SendMoneyV2TransactionCompleteActivity.class);
startReceiptActivity.putExtra(SendMoneyV2TransactionCompleteActivity.SEND_MONEY_TID_BUNDLE_KEY, selectedNotice.getExtra());
startActivity(startReceiptActivity);
}
}

2
app/src/main/java/com/remit/jmecustomer/utils/https/API_URL.java

@ -114,5 +114,7 @@ public class API_URL {
public static final String FINGER_PRINT_SETUP = BuildConfig.API_VERSION + "/mobile/ChangeSettings";
public static final String SEND_MONEY_REJECT_TRANSACTION = BuildConfig.API_VERSION + "/mobile/sendmoney/RejectTransaction";
public static final String DEPOSIT_SLIP = BuildConfig.API_VERSION + "/mobile/DepositSlip";
public static final String MY_NOTIFICAION_LIST = BuildConfig.API_VERSION + "/mobile/GetNotificationList";
public static final String UPDATE_MY_NOTIFICAION = BuildConfig.API_VERSION + "/mobile/UpdateNotification";
}

8
app/src/main/java/com/remit/jmecustomer/utils/https/ApiEndpoints.java

@ -349,4 +349,12 @@ public interface ApiEndpoints {
@PartMap() Map<String, RequestBody> partMap,
@Part MultipartBody.Part depositSlipImageFile
);
@POST(API_URL.MY_NOTIFICAION_LIST)
@Headers("Content-Type: application/json")
Observable<ResponseBody> getMYNoticeList(@Header("Authorization") String token, @Query("customerId") String customerId);
@POST(API_URL.UPDATE_MY_NOTIFICAION)
@Headers("Content-Type: application/json")
Observable<ResponseBody> updateMyNotice(@Header("Authorization") String token, @Query("rowId") String rowId);
}

BIN
app/src/main/res/drawable-xxhdpi/notify_error_color.png

After

Width: 512  |  Height: 512  |  Size: 8.9 KiB

BIN
app/src/main/res/drawable-xxhdpi/notify_error_grey.png

After

Width: 512  |  Height: 512  |  Size: 16 KiB

BIN
app/src/main/res/drawable-xxhdpi/notify_info_color.png

After

Width: 512  |  Height: 512  |  Size: 20 KiB

BIN
app/src/main/res/drawable-xxhdpi/notify_info_grey.png

After

Width: 512  |  Height: 512  |  Size: 26 KiB

BIN
app/src/main/res/drawable-xxhdpi/notify_success_color.png

After

Width: 512  |  Height: 512  |  Size: 17 KiB

BIN
app/src/main/res/drawable-xxhdpi/notify_success_grey.png

After

Width: 512  |  Height: 512  |  Size: 22 KiB

120
app/src/main/res/layout/activity_home_v2.xml

@ -23,76 +23,104 @@
android:layout_height="match_parent">
<ImageView
android:layout_marginStart="@dimen/_13sdp"
android:id="@+id/iv_nav"
android:layout_width="@dimen/_17sdp"
android:layout_height="@dimen/_22sdp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
app:srcCompat="@drawable/icv_home_nav_icon"
android:layout_alignParentStart="true" />
android:layout_marginStart="@dimen/_13sdp"
app:srcCompat="@drawable/icv_home_nav_icon" />
<ImageView
android:layout_width="@dimen/_80sdp"
android:layout_height="@dimen/_25sdp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:srcCompat="@drawable/vd_jme_logo_only"
/>
app:srcCompat="@drawable/vd_jme_logo_only" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/_13sdp"
android:layout_toLeftOf="@+id/iv_help">
<ImageView
android:id="@+id/iv_notification"
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
android:layout_centerVertical="true"
android:padding="@dimen/_3sdp"
app:srcCompat="@drawable/icv_home_notification_badge" />
<com.remit.jmecustomer.common.customwidgets.JmeTextView
android:id="@+id/notificationCountTxtView"
android:layout_width="@dimen/_15sdp"
android:layout_height="@dimen/_15sdp"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/_12sdp"
android:layout_marginTop="-1dp"
android:background="@drawable/circular_white_bg"
android:gravity="center"
android:textColor="@color/colorAccent"
android:textSize="@dimen/_10ssp"
android:visibility="invisible" />
</RelativeLayout>
<ImageView
android:layout_alignParentRight="true"
android:id="@+id/iv_help"
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
app:srcCompat="@drawable/icv_help"
android:layout_marginEnd="@dimen/_13sdp"
android:layout_alignParentEnd="true" />
app:srcCompat="@drawable/icv_help" />
<com.remit.jmecustomer.common.customwidgets.JmeTextView
android:id="@+id/notificationCounterTxtView"
android:layout_width="@dimen/_15sdp"
android:layout_height="@dimen/_15sdp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_gravity="center"
android:background="@drawable/circular_white_bg"
android:gravity="center"
android:visibility="invisible"
android:layout_marginTop="@dimen/_4sdp"
android:layout_marginEnd="@dimen/_4sdp"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:background="@drawable/circular_white_bg"
android:gravity="center"
android:textColor="@color/colorAccent"
android:textSize="@dimen/_7ssp"/>
android:textSize="@dimen/_7ssp"
android:visibility="invisible" />
<RelativeLayout
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true">
<ImageView
android:visibility="invisible"
android:id="@+id/iv_notification"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="10dp"
app:srcCompat="@drawable/icv_home_notification_badge" />
<View
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_alignEnd="@+id/iv_notification"
android:layout_alignRight="@+id/iv_notification"
android:layout_alignTop="@+id/iv_notification"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="15dp"
android:background="@drawable/notification_dot"
android:gravity="center"
android:visibility="gone" />
android:visibility="gone">
<!-- <ImageView
android:id="@+id/iv_notification"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="10dp"
android:visibility="invisible"
app:srcCompat="@drawable/icv_home_notification_badge" />-->
<!-- <View-->
<!-- android:layout_width="12dp"-->
<!-- android:layout_height="12dp"-->
<!-- android:layout_alignEnd="@+id/iv_notification"-->
<!-- android:layout_alignRight="@+id/iv_notification"-->
<!-- android:layout_alignTop="@+id/iv_notification"-->
<!-- android:layout_marginEnd="8dp"-->
<!-- android:layout_marginRight="8dp"-->
<!-- android:layout_marginTop="15dp"-->
<!-- android:background="@drawable/notification_dot"-->
<!-- android:gravity="center"-->
<!-- android:visibility="gone" />-->
</RelativeLayout>
</RelativeLayout>
@ -128,15 +156,15 @@
</RelativeLayout>
<!--<jmecustomer.support.design.widget.NavigationView-->
<!--jmecustomer:id="@+id/nav_drawer"-->
<!--jmecustomer:layout_width="match_parent"-->
<!--jmecustomer:layout_height="match_parent"-->
<!--jmecustomer:layout_gravity="start"-->
<!--jmecustomer:layout_marginLeft="-64dp"-->
<!--jmecustomer:layout_marginStart="-64dp"-->
<!--jmecustomer:fitsSystemWindows="true">-->
<!--jmecustomer:id="@+id/nav_drawer"-->
<!--jmecustomer:layout_width="match_parent"-->
<!--jmecustomer:layout_height="match_parent"-->
<!--jmecustomer:layout_gravity="start"-->
<!--jmecustomer:layout_marginLeft="-64dp"-->
<!--jmecustomer:layout_marginStart="-64dp"-->
<!--jmecustomer:fitsSystemWindows="true">-->
<!--<include layout="@layout/nav_drawer_fragment" />-->
<!--<include layout="@layout/nav_drawer_fragment" />-->
<!--</jmecustomer.support.design.widget.NavigationView>-->
@ -148,9 +176,9 @@
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_drawer"
android:background="@android:color/transparent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

13
app/src/main/res/layout/activity_my_notifications.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<include layout="@layout/layout_sendmoney_toolbar" />
<com.remit.jmecustomer.common.customwidgets.SwipeDisabledViewPager
android:id="@+id/myNoticeViewPager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</androidx.appcompat.widget.LinearLayoutCompat>

102
app/src/main/res/layout/fragment_my_notice_detail.xml

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<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:layout_height="match_parent"
android:background="@color/gray">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/bright_gray2"
android:padding="@dimen/_8sdp">
<com.remit.jmecustomer.common.customwidgets.JmeTextView
android:id="@+id/tv_my_notification_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/darkgray2"
android:textSize="@dimen/_10ssp"
app:layout_constraintBottom_toTopOf="@+id/tv_my_notification_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:txtfontName="@string/regular"
tools:text="@string/date_text" />
<com.remit.jmecustomer.common.customwidgets.JmeTextView
android:id="@+id/tv_my_notification_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_5sdp"
android:ellipsize="end"
android:gravity="start"
android:maxLines="1"
android:textColor="@color/darkgray"
android:textSize="@dimen/_13ssp"
app:layout_constraintBottom_toTopOf="@+id/view16"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_my_notification_date"
app:txtfontName="@string/bold"
tools:text="When developed " />
<View
android:id="@+id/view16"
android:layout_width="match_parent"
android:layout_height="@dimen/_1sdp"
android:layout_marginTop="@dimen/_8sdp"
android:layout_marginBottom="@dimen/_8sdp"
android:background="@color/gray"
app:layout_constraintBottom_toTopOf="@+id/tv_my_notification_body"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_my_notification_title" />
<com.remit.jmecustomer.common.customwidgets.JmeTextView
android:id="@+id/tv_my_notification_body"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="start"
android:textColor="@color/darkgray"
android:textSize="@dimen/_12ssp"
app:layout_constraintBottom_toTopOf="@+id/my_notice_image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view16"
app:txtfontName="@string/regular"
tools:text="When developed " />
<ImageView
android:id="@+id/my_notice_image"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_8sdp"
android:minHeight="@dimen/_120sdp"
app:layout_constraintBottom_toTopOf="@+id/tv_my_notification_date"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_my_notification_body" />
<ProgressBar
android:id="@+id/my_progressBar"
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp"
app:layout_constraintBottom_toBottomOf="@+id/my_notice_image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_my_notification_body" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

15
app/src/main/res/layout/fragment_my_notice_listing.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:scrollbars="none"
android:id="@+id/myNoticeRv"
android:background="@color/body_light_grey"
xmlns:android="http://schemas.android.com/apk/res/android"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:orientation="vertical"
android:layout_width="match_parent"
android:paddingBottom="@dimen/_15sdp"/>

12
app/src/main/res/layout/fragment_notice_listing.xml

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView android:layout_height="match_parent"
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:scrollbars="none"
android:id="@+id/noticeRv"
android:background="@color/bright_gray2"
xmlns:android="http://schemas.android.com/apk/res/android"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/body_light_grey"
android:orientation="vertical"
android:layout_width="match_parent" />
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

3
app/src/main/res/layout/layout_sendmoney_toolbar.xml

@ -15,7 +15,8 @@
android:layout_height="match_parent"
android:layout_gravity="center"
android:padding="10dp"
app:srcCompat="@drawable/icv_back" />
app:srcCompat="@drawable/icv_back"
android:layout_marginLeft="@dimen/_10sdp"/>
<com.remit.jmecustomer.common.customwidgets.JmeTextView
android:id="@+id/toolbar_title"

100
app/src/main/res/layout/my_notice_list_viewholder.xml

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView 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="wrap_content"
android:layout_marginLeft="@dimen/_15sdp"
android:layout_marginTop="@dimen/_15sdp"
android:layout_marginRight="@dimen/_15sdp"
android:outlineAmbientShadowColor="@color/black"
android:outlineSpotShadowColor="@color/black"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/_12sdp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/_5sdp"
android:paddingLeft="@dimen/_8sdp"
android:paddingRight="@dimen/_8sdp">
<LinearLayout
android:id="@+id/jmeDepositLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/imgNotificationStat"
app:layout_constraintTop_toTopOf="parent">
<com.remit.jmecustomer.common.customwidgets.JmeTextView
android:id="@+id/tv_notification_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_5sdp"
android:ellipsize="end"
android:gravity="start"
android:maxLines="10"
android:textColor="@color/darkgray"
android:textSize="@dimen/_13sdp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/imgNotificationStat"
app:layout_constraintTop_toTopOf="parent"
app:txtfontName="@string/bold"
tools:text="When developed " />
<com.remit.jmecustomer.common.customwidgets.JmeTextView
android:id="@+id/tv_notification_body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_5sdp"
android:ellipsize="end"
android:gravity="start"
android:maxLines="10"
android:textColor="@color/darkgray"
android:textSize="@dimen/_12sdp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/imgNotificationStat"
app:layout_constraintTop_toBottomOf="@+id/tv_notification_title"
tools:text="When developed " />
<com.remit.jmecustomer.common.customwidgets.JmeTextView
android:id="@+id/tv_notification_date"
android:layout_width="385dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_4sdp"
android:layout_marginBottom="@dimen/_5sdp"
android:gravity="start"
android:textColor="#757575"
android:textSize="@dimen/_10ssp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/tv_notification_title"
app:layout_constraintTop_toBottomOf="@+id/tv_notification_body"
app:txtfontName="@string/regular"
tools:text="@string/date_text" />
</LinearLayout>
<ImageView
android:id="@+id/imgNotificationStat"
android:layout_width="@dimen/_18sdp"
android:layout_height="@dimen/_18sdp"
android:layout_marginLeft="@dimen/_50sdp"
android:layout_marginRight="@dimen/commonMargin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/jmeDepositLayout"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.1"
android:contentDescription="TODO" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>

29
app/src/main/res/layout/nav_drawer_fragment.xml

@ -243,6 +243,35 @@
android:textSize="@dimen/text_small" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:visibility="gone"
android:background="@color/divider" />
<LinearLayout
android:id="@+id/view_atm_cash_deposit"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/_15sdp"
android:layout_height="@dimen/_15sdp"
android:contentDescription="@string/app_name"
app:srcCompat="@drawable/icv_menu_wallet_statement" />
<com.remit.jmecustomer.common.customwidgets.JmeTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginStart="14dp"
android:text="ATM Bank Deposit"
android:textColor="@color/darkgray2"
android:textSize="@dimen/text_small" />
</LinearLayout>
<View

4
app/src/main/res/values/strings.xml

@ -628,4 +628,8 @@
<string name="eBanking_text">EBanking</string>
<string name="cash_deposit_text">Cash Deposit</string>
<string name="payment_method_text" >How to Deposit</string>
<!-- my notification -->
<string name="my_notification_text" translatable="false">My Notifications</string>
</resources><!---->
Loading…
Cancel
Save