history added in Dashboard History Screen
This commit is contained in:
parent
8f9c61dbac
commit
b3406a12bb
@ -107,6 +107,9 @@ public class ConfirmTransactionFragment extends DataBindingFragment implements D
|
|||||||
|
|
||||||
isMerchantCopy = true;
|
isMerchantCopy = true;
|
||||||
sharedViewModel.printerDisabled.setValue(!SystemParamsOperation.getInstance().getPrinterEnabled());
|
sharedViewModel.printerDisabled.setValue(!SystemParamsOperation.getInstance().getPrinterEnabled());
|
||||||
|
if (sharedViewModel.getTransMenu().getValue() != TransMenu.REPRINT) {
|
||||||
|
sharedViewModel.suppressReprintButtons.setValue(false);
|
||||||
|
}
|
||||||
|
|
||||||
if(sharedViewModel.getTransMenu().getValue() == TransMenu.REVIEW) {
|
if(sharedViewModel.getTransMenu().getValue() == TransMenu.REVIEW) {
|
||||||
|
|
||||||
@ -123,9 +126,17 @@ public class ConfirmTransactionFragment extends DataBindingFragment implements D
|
|||||||
} else if(sharedViewModel.getTransMenu().getValue() == TransMenu.REPRINT) {
|
} else if(sharedViewModel.getTransMenu().getValue() == TransMenu.REPRINT) {
|
||||||
|
|
||||||
sharedViewModel.reprintTransTypeMsg.setValue(getResourceString(R.string.txt_print_merchant_copy));
|
sharedViewModel.reprintTransTypeMsg.setValue(getResourceString(R.string.txt_print_merchant_copy));
|
||||||
|
boolean suppress = sharedViewModel.suppressReprintButtons.getValue() != null
|
||||||
|
&& sharedViewModel.suppressReprintButtons.getValue();
|
||||||
|
if (suppress) {
|
||||||
|
sharedViewModel.oneBtnLayout.setValue(8);
|
||||||
|
sharedViewModel.twoBtnLayout.setValue(8);
|
||||||
|
sharedViewModel.reprintBtnLayout.setValue(8);
|
||||||
|
} else {
|
||||||
sharedViewModel.oneBtnLayout.setValue(8);
|
sharedViewModel.oneBtnLayout.setValue(8);
|
||||||
sharedViewModel.twoBtnLayout.setValue(8);
|
sharedViewModel.twoBtnLayout.setValue(8);
|
||||||
sharedViewModel.reprintBtnLayout.setValue(sharedViewModel.printerDisabled.getValue() != null && sharedViewModel.printerDisabled.getValue() ? 8 : 0);
|
sharedViewModel.reprintBtnLayout.setValue(sharedViewModel.printerDisabled.getValue() != null && sharedViewModel.printerDisabled.getValue() ? 8 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
// printReceipt(true);
|
// printReceipt(true);
|
||||||
|
|
||||||
|
|||||||
@ -116,6 +116,7 @@ public class SharedViewModel extends ViewModel {
|
|||||||
|
|
||||||
public MutableLiveData<Integer> printReceiptButtons = new MutableLiveData<>(0);
|
public MutableLiveData<Integer> printReceiptButtons = new MutableLiveData<>(0);
|
||||||
public SingleLiveEvent<Boolean> printerDisabled = new SingleLiveEvent<>();
|
public SingleLiveEvent<Boolean> printerDisabled = new SingleLiveEvent<>();
|
||||||
|
public SingleLiveEvent<Boolean> suppressReprintButtons = new SingleLiveEvent<>();
|
||||||
|
|
||||||
public SingleLiveEvent<String> printReceiptMsg = new SingleLiveEvent<>();
|
public SingleLiveEvent<String> printReceiptMsg = new SingleLiveEvent<>();
|
||||||
|
|
||||||
@ -178,6 +179,7 @@ public class SharedViewModel extends ViewModel {
|
|||||||
this.repository = repository;
|
this.repository = repository;
|
||||||
setPrintStatus(PrintStatus.FIRST_PRINT);
|
setPrintStatus(PrintStatus.FIRST_PRINT);
|
||||||
isReprint.setValue(false);
|
isReprint.setValue(false);
|
||||||
|
suppressReprintButtons.setValue(false);
|
||||||
cardNo.setValue("");
|
cardNo.setValue("");
|
||||||
String sn = TerminalUtil.getInstance().getSerialNo();
|
String sn = TerminalUtil.getInstance().getSerialNo();
|
||||||
serialNumber.setValue(sn);
|
serialNumber.setValue(sn);
|
||||||
|
|||||||
@ -8,24 +8,17 @@ import androidx.annotation.Nullable;
|
|||||||
|
|
||||||
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||||
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||||
import com.utsmyanmar.baselib.util.DialogCallback;
|
|
||||||
import com.utsmyanmar.paylibs.model.PayDetail;
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
import com.utsmyanmar.paylibs.model.TradeData;
|
|
||||||
import com.utsmyanmar.paylibs.print.PrintHelper;
|
|
||||||
import com.utsmyanmar.paylibs.print.printx.PrintXReceipt;
|
|
||||||
import com.utsmyanmar.paylibs.print.printx.PrintXStatus;
|
|
||||||
import com.utsmyanmar.paylibs.utils.POSUtil;
|
import com.utsmyanmar.paylibs.utils.POSUtil;
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
|
||||||
import com.utsmyanmar.paylibs.utils.enums.HostType;
|
import com.utsmyanmar.paylibs.utils.enums.HostType;
|
||||||
|
import com.utsmyanmar.paylibs.utils.enums.TransMenu;
|
||||||
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType;
|
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType;
|
||||||
import com.utsmyanmar.paylibs.utils.params.Params;
|
|
||||||
import com.nexgo.oaf.apiv3.SdkResult;
|
|
||||||
import com.utsmm.kbz.BR;
|
import com.utsmm.kbz.BR;
|
||||||
import com.utsmm.kbz.R;
|
import com.utsmm.kbz.R;
|
||||||
import com.utsmm.kbz.config.Constants;
|
import com.utsmm.kbz.config.Constants;
|
||||||
import com.utsmm.kbz.databinding.FragmentDashboardHistoryScreenBinding;
|
import com.utsmm.kbz.databinding.FragmentDashboardHistoryScreenBinding;
|
||||||
import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
||||||
import com.utsmm.kbz.ui.management.HistoryAdapter;
|
import com.utsmm.kbz.ui.management.CardViewAdapter;
|
||||||
import com.utsmm.kbz.ui.management.ManagementViewModel;
|
import com.utsmm.kbz.ui.management.ManagementViewModel;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -34,7 +27,7 @@ public class DashboardHistoryFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
private ManagementViewModel managementViewModel;
|
private ManagementViewModel managementViewModel;
|
||||||
private SharedViewModel sharedViewModel;
|
private SharedViewModel sharedViewModel;
|
||||||
private HistoryAdapter detailReportAdapter;
|
private CardViewAdapter cardViewAdapter;
|
||||||
private int routeId;
|
private int routeId;
|
||||||
|
|
||||||
private final ArrayList<PayDetail> lists = new ArrayList<>();
|
private final ArrayList<PayDetail> lists = new ArrayList<>();
|
||||||
@ -48,8 +41,7 @@ public class DashboardHistoryFragment extends DataBindingFragment {
|
|||||||
@Override
|
@Override
|
||||||
protected DataBindingConfig getDataBindingConfig() {
|
protected DataBindingConfig getDataBindingConfig() {
|
||||||
return new DataBindingConfig(R.layout.fragment_dashboard_history_screen, BR.manageViewModel, managementViewModel)
|
return new DataBindingConfig(R.layout.fragment_dashboard_history_screen, BR.manageViewModel, managementViewModel)
|
||||||
.addBindingParam(BR.sharedViewModel, sharedViewModel)
|
.addBindingParam(BR.sharedViewModel, sharedViewModel);
|
||||||
.addBindingParam(BR.click, new ClickEvent());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -78,8 +70,6 @@ public class DashboardHistoryFragment extends DataBindingFragment {
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
setToolBarTitleWithBackIcon(getString(R.string.title_history));
|
setToolBarTitleWithBackIcon(getString(R.string.title_history));
|
||||||
|
|
||||||
managementViewModel.detailReportLayoutVisibility.setValue(0);
|
|
||||||
managementViewModel.detailReportBottomLayoutVisibility.setValue(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void observeHistory() {
|
private void observeHistory() {
|
||||||
@ -98,23 +88,14 @@ public class DashboardHistoryFragment extends DataBindingFragment {
|
|||||||
managementViewModel.detailReportBottomLayoutVisibility.setValue(0);
|
managementViewModel.detailReportBottomLayoutVisibility.setValue(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
HostType hostType = sharedViewModel.hostType.getValue();
|
|
||||||
|
|
||||||
for (PayDetail payDetail : payDetailList) {
|
for (PayDetail payDetail : payDetailList) {
|
||||||
if (hostType == HostType.MPU) {
|
|
||||||
if (payDetail.getTransactionType() != TransactionsType.MMQR.value
|
|
||||||
&& payDetail.getTransactionType() != TransactionsType.REVERSAL.value
|
|
||||||
&& payDetail.getTransactionType() != TransactionsType.SETTLEMENT.value
|
|
||||||
&& POSUtil.getInstance().getYesterdayDate()
|
|
||||||
.compareTo(POSUtil.getInstance().getDateByString(payDetail.transDate)) < 1) {
|
|
||||||
lists.add(payDetail);
|
|
||||||
}
|
|
||||||
} else if (hostType == HostType.QR) {
|
|
||||||
if (payDetail.getTransactionType() == TransactionsType.MMQR.value
|
if (payDetail.getTransactionType() == TransactionsType.MMQR.value
|
||||||
&& payDetail.getQrTransStatus() == 1) {
|
|| payDetail.getTransactionType() == TransactionsType.MMQR_REFUND.value) {
|
||||||
lists.add(payDetail);
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
if (POSUtil.getInstance().getYesterdayDate()
|
||||||
|
.compareTo(POSUtil.getInstance().getDateByString(payDetail.transDate)) < 1) {
|
||||||
lists.add(payDetail);
|
lists.add(payDetail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,67 +105,15 @@ public class DashboardHistoryFragment extends DataBindingFragment {
|
|||||||
managementViewModel.detailReportLayoutVisibility.setValue(0);
|
managementViewModel.detailReportLayoutVisibility.setValue(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
detailReportAdapter = new HistoryAdapter(lists);
|
cardViewAdapter = new CardViewAdapter(lists, payDetail -> {
|
||||||
((FragmentDashboardHistoryScreenBinding) mBinding).setAdapter(detailReportAdapter);
|
sharedViewModel.setTransMenu(TransMenu.REPRINT);
|
||||||
|
sharedViewModel.suppressReprintButtons.setValue(true);
|
||||||
|
sharedViewModel.payDetail.postValue(payDetail);
|
||||||
|
routeId = R.id.action_dashboardHistoryFragment_to_confirmTransactionFragment;
|
||||||
|
safeRouteTo(currentId(), routeId, hostId());
|
||||||
|
});
|
||||||
|
((FragmentDashboardHistoryScreenBinding) mBinding).setMyAdapter(cardViewAdapter);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void navigateMain() {
|
|
||||||
routeId = R.id.action_dashboardHistoryFragment_to_nav_main;
|
|
||||||
safeNavigateToRouteId();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ClickEvent {
|
|
||||||
public void onCancel() {
|
|
||||||
navigateMain();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onPrint() {
|
|
||||||
TradeData tradeData = Params.newTrade(false);
|
|
||||||
PayDetail payDetail = tradeData.getPayDetail();
|
|
||||||
payDetail.setTransType(TransactionsType.DETAIL_REPORT.name);
|
|
||||||
payDetail.setTransactionType(TransactionsType.DETAIL_REPORT.value);
|
|
||||||
|
|
||||||
if (PrintHelper.getInstance().paperRollStatus() == SdkResult.Printer_PaperLack) {
|
|
||||||
showPrinterAlertDialog(getString(R.string.txt_paper_roll_not_ready), new DialogCallback() {
|
|
||||||
@Override
|
|
||||||
public void onClickCancel() {
|
|
||||||
dismissPrinterAlertDialog();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickRetry() {
|
|
||||||
dismissPrinterAlertDialog();
|
|
||||||
|
|
||||||
if (PrintHelper.getInstance().paperRollStatus() != SdkResult.Success) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PrintXReceipt.getInstance().printDetailReport(payDetail, lists, sharedViewModel.hostType.getValue(), new PrintXStatus() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure() {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (SystemParamsOperation.getInstance().isAlertSound()) {
|
|
||||||
startSound(getString(R.string.txt_audio_printer_alert));
|
|
||||||
}
|
|
||||||
} else if (PrintHelper.getInstance().paperRollStatus() == SdkResult.Success) {
|
|
||||||
PrintXReceipt.getInstance().printDetailReport(payDetail, lists, sharedViewModel.hostType.getValue(), new PrintXStatus() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure() {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
|
|
||||||
import com.utsmyanmar.paylibs.model.PayDetail;
|
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||||
import com.utsmm.kbz.R;
|
import com.utsmm.kbz.R;
|
||||||
import com.utsmm.kbz.databinding.ItemViewDetailReportBinding;
|
import com.utsmm.kbz.databinding.ItemViewHistoryBinding;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -35,7 +35,7 @@ public class HistoryAdapter extends RecyclerView.Adapter<HistoryAdapter.ViewHold
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public HistoryAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public HistoryAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
ItemViewDetailReportBinding binding = DataBindingUtil.inflate(
|
ItemViewHistoryBinding binding = DataBindingUtil.inflate(
|
||||||
LayoutInflater.from(parent.getContext()),
|
LayoutInflater.from(parent.getContext()),
|
||||||
R.layout.item_view_history, parent, false);
|
R.layout.item_view_history, parent, false);
|
||||||
|
|
||||||
@ -58,9 +58,9 @@ public class HistoryAdapter extends RecyclerView.Adapter<HistoryAdapter.ViewHold
|
|||||||
|
|
||||||
|
|
||||||
public class ViewHolder extends RecyclerView.ViewHolder{
|
public class ViewHolder extends RecyclerView.ViewHolder{
|
||||||
public ItemViewDetailReportBinding itemBinding;
|
public ItemViewHistoryBinding itemBinding;
|
||||||
|
|
||||||
public ViewHolder(ItemViewDetailReportBinding itemRowBinding){
|
public ViewHolder(ItemViewHistoryBinding itemRowBinding){
|
||||||
super(itemRowBinding.getRoot());
|
super(itemRowBinding.getRoot());
|
||||||
this.itemBinding = itemRowBinding;
|
this.itemBinding = itemRowBinding;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -362,6 +362,7 @@ public class ReprintAnyTransactionFragment extends DataBindingFragment {
|
|||||||
* */
|
* */
|
||||||
// sharedViewModel.transMenu.postValue(TransMenu.REPRINT);
|
// sharedViewModel.transMenu.postValue(TransMenu.REPRINT);
|
||||||
sharedViewModel.setTransMenu(TransMenu.REPRINT);
|
sharedViewModel.setTransMenu(TransMenu.REPRINT);
|
||||||
|
sharedViewModel.suppressReprintButtons.setValue(false);
|
||||||
// payDetail.setTransType(payDetail.getTransType()+"(REPRINT)");
|
// payDetail.setTransType(payDetail.getTransType()+"(REPRINT)");
|
||||||
//tempo guarding the Reprint duplicate by kmk
|
//tempo guarding the Reprint duplicate by kmk
|
||||||
if (!payDetail.getTransType().contains("REPRINT")) {
|
if (!payDetail.getTransType().contains("REPRINT")) {
|
||||||
|
|||||||
@ -180,12 +180,22 @@ public class TMSProcessFragment extends DataBindingFragment {
|
|||||||
} else if (e instanceof HttpException) {
|
} else if (e instanceof HttpException) {
|
||||||
HttpException error = (HttpException)e;
|
HttpException error = (HttpException)e;
|
||||||
try {
|
try {
|
||||||
SiriusError siriusError = new Gson().fromJson(error.response().errorBody().string(), SiriusError.class);
|
String errorBody = error.response() != null && error.response().errorBody() != null
|
||||||
if(tmsUpdate == TMSUpdate.CHECK){
|
? error.response().errorBody().string()
|
||||||
tmsProcessViewModel.setTmsDownloadMsg(siriusError.getMessage());
|
: "";
|
||||||
|
String message = (errorBody == null || errorBody.trim().isEmpty())
|
||||||
|
? ("Network error (" + error.code() + ")")
|
||||||
|
: errorBody;
|
||||||
|
if (errorBody != null) {
|
||||||
|
String trimmed = errorBody.trim();
|
||||||
|
if (trimmed.startsWith("{")) {
|
||||||
|
SiriusError siriusError = new Gson().fromJson(trimmed, SiriusError.class);
|
||||||
|
message = siriusError != null ? siriusError.getMessage() : trimmed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tmsUpdate == TMSUpdate.CHECK){
|
||||||
|
tmsProcessViewModel.setTmsDownloadMsg(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throw new RuntimeException(ex);
|
throw new RuntimeException(ex);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|||||||
@ -11,95 +11,128 @@
|
|||||||
name="manageViewModel"
|
name="manageViewModel"
|
||||||
type="com.utsmm.kbz.ui.management.ManagementViewModel" />
|
type="com.utsmm.kbz.ui.management.ManagementViewModel" />
|
||||||
<variable
|
<variable
|
||||||
name="adapter"
|
name="myAdapter"
|
||||||
type="com.utsmm.kbz.ui.management.HistoryAdapter" />
|
type="com.utsmm.kbz.ui.management.CardViewAdapter" />
|
||||||
<variable
|
|
||||||
name="click"
|
|
||||||
type="com.utsmm.kbz.ui.dashboard.DashboardHistoryFragment.ClickEvent" />
|
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:padding="12dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:background="@color/white">
|
||||||
|
|
||||||
|
<!-- Compact Header Section -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:visibility="@{manageViewModel.detailReportLayoutVisibility}"
|
android:id="@+id/headerSection"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:paddingTop="24dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<!-- Transaction History Icon -->
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:src="@drawable/ic_txn_history"
|
||||||
|
app:tint="@color/colorPrimary"
|
||||||
|
android:alpha="0.9"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:background="@drawable/bg_oval" />
|
||||||
|
|
||||||
|
<!-- Title -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/title_history"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:layout_marginBottom="4dp" />
|
||||||
|
|
||||||
|
<!-- Subtitle -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="View recent card transactions"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:alpha="0.75"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:layout_marginBottom="20dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- Transaction List -->
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:visibility="@{manageViewModel.detailReportBottomLayoutVisibility}"
|
||||||
|
app:adapter="@{myAdapter}"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
tools:listitem="@layout/item_view_trans"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/headerSection"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent" />
|
||||||
|
|
||||||
|
<!-- Empty State Section -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/emptyStateSection"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:orientation="vertical"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:gravity="center"
|
||||||
|
android:visibility="@{manageViewModel.detailReportLayoutVisibility}"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:orientation="vertical">
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
<!-- Empty State Animation -->
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
<com.airbnb.lottie.LottieAnimationView
|
||||||
android:id="@+id/lav_no_trans"
|
android:id="@+id/lav_no_trans"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="200dp"
|
||||||
android:layout_height="300dp"
|
android:layout_height="200dp"
|
||||||
android:layout_margin="8dp"
|
android:layout_marginBottom="24dp"
|
||||||
app:lottie_autoPlay="true"
|
app:lottie_autoPlay="true"
|
||||||
app:lottie_fileName="lottie_no_trans.json"
|
app:lottie_fileName="lottie_no_trans.json"
|
||||||
app:lottie_loop="true" />
|
app:lottie_loop="true" />
|
||||||
|
|
||||||
|
<!-- Empty State Title -->
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/rubik_regular"
|
|
||||||
android:text="@string/txt_trans_not_found"
|
android:text="@string/txt_trans_not_found"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textSize="22sp"
|
android:textSize="20sp"
|
||||||
android:layout_marginTop="8dp"
|
android:textStyle="bold"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:fontFamily="sans-serif-medium"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_marginBottom="8dp" />
|
||||||
app:layout_constraintTop_toBottomOf="@+id/lav_no_trans" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<!-- Empty State Description -->
|
||||||
android:id="@+id/recyclerView"
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
|
||||||
app:adapter="@{adapter}"
|
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/linearLayout3"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:listitem="@layout/item_view_history" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/linearLayout3"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="8dp"
|
android:text="No card transactions found"
|
||||||
android:orientation="horizontal"
|
android:textAlignment="center"
|
||||||
android:visibility="@{manageViewModel.detailReportBottomLayoutVisibility}"
|
android:textColor="@color/colorPrimary"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:textSize="14sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:alpha="0.7"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
android:fontFamily="sans-serif"
|
||||||
|
android:paddingHorizontal="32dp" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatButton
|
|
||||||
android:id="@+id/btn_amount_cancel"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="4dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/bg_rounded_btn_cancel_cv"
|
|
||||||
android:onClick="@{()->click.onCancel()}"
|
|
||||||
android:text="@string/layout_cancel"
|
|
||||||
android:textColor="@color/colorPrimary" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatButton
|
|
||||||
android:id="@+id/btn_amount_confirm"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="4dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/bg_rounded_btn_cv"
|
|
||||||
android:onClick="@{()->click.onPrint()}"
|
|
||||||
android:text="@string/layout_print"
|
|
||||||
android:textColor="@color/white" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
@ -688,6 +688,9 @@
|
|||||||
app:popUpToInclusive="true"
|
app:popUpToInclusive="true"
|
||||||
android:id="@+id/action_dashboardHistoryFragment_to_nav_main"
|
android:id="@+id/action_dashboardHistoryFragment_to_nav_main"
|
||||||
app:destination="@id/nav_main" />
|
app:destination="@id/nav_main" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_dashboardHistoryFragment_to_confirmTransactionFragment"
|
||||||
|
app:destination="@id/confirmTransactionFragment" />
|
||||||
</fragment>
|
</fragment>
|
||||||
<fragment
|
<fragment
|
||||||
tools:layout="@layout/fragment_print_receipt_screen"
|
tools:layout="@layout/fragment_print_receipt_screen"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user